diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c4b6a1c508..50f2a53f74 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,6 +32,7 @@ To send us a pull request, please: 1. Fork the repository. 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 3. Ensure local tests pass. +4. Ensure code files are formatted using language provided tools such as `terraform fmt`. 4. Commit to your fork using clear commit messages. 5. Send us a pull request, answering any default questions in the pull request interface. 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. diff --git a/Makefile b/Makefile index 58a581a67b..95924443c4 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ +.PHONY: serve serve: - cd site; hugo serve \ No newline at end of file + cd site; hugo serve + +.PHONY: tf-fmt +tf-fmt: + cd ./terraform && terraform fmt --recursive diff --git a/terraform/cluster-only/main.tf b/terraform/cluster-only/main.tf index 7a50bc52e9..52c5119f3a 100644 --- a/terraform/cluster-only/main.tf +++ b/terraform/cluster-only/main.tf @@ -1,5 +1,5 @@ module "cluster" { - source = "../modules/cluster" + source = "../modules/cluster" id = var.id } \ No newline at end of file diff --git a/terraform/full/main.tf b/terraform/full/main.tf index 238e11808a..bb8acd2153 100644 --- a/terraform/full/main.tf +++ b/terraform/full/main.tf @@ -1,14 +1,14 @@ data "aws_region" "current" {} module "cluster" { - source = "../modules/cluster" + source = "../modules/cluster" id = var.id map_roles = [{ - rolearn = module.ide.cloud9_iam_role + rolearn = module.ide.cloud9_iam_role username = "cloud9" - groups = ["system:masters"] + groups = ["system:masters"] }] } @@ -31,11 +31,11 @@ resource "aws_s3_object" "bootstrap_archive" { } module "ide" { - source = "../modules/ide" + source = "../modules/ide" - environment_name = module.cluster.eks_cluster_id - subnet_id = module.cluster.public_subnet_ids[0] - additional_cloud9_policies = [{ + environment_name = module.cluster.eks_cluster_id + subnet_id = module.cluster.public_subnet_ids[0] + additional_cloud9_policies = [{ Version = "2012-10-17", Statement = [ { @@ -51,7 +51,7 @@ module "ide" { ] } ] - },{ + }, { Version = "2012-10-17", Statement = [ { diff --git a/terraform/modules/cluster/addons.tf b/terraform/modules/cluster/addons.tf index 58f7a354de..61378b46d7 100644 --- a/terraform/modules/cluster/addons.tf +++ b/terraform/modules/cluster/addons.tf @@ -5,6 +5,6 @@ module "eks-blueprints-kubernetes-addons" { enable_aws_load_balancer_controller = true aws_load_balancer_controller_helm_config = { - version = var.aws_load_balancer_controller_version + version = var.aws_load_balancer_controller_version } } \ No newline at end of file diff --git a/terraform/modules/cluster/main.tf b/terraform/modules/cluster/main.tf index 7e98a8041e..581dd5bbbe 100644 --- a/terraform/modules/cluster/main.tf +++ b/terraform/modules/cluster/main.tf @@ -35,7 +35,7 @@ provider "helm" { locals { tenant = "eksw" environment = "env" - zone = var.id + zone = var.id cluster_version = var.cluster_version diff --git a/terraform/modules/cluster/outputs.tf b/terraform/modules/cluster/outputs.tf index 565ebb5685..c5c1c93c3e 100644 --- a/terraform/modules/cluster/outputs.tf +++ b/terraform/modules/cluster/outputs.tf @@ -10,10 +10,10 @@ output "configure_kubectl" { output "private_subnet_ids" { description = "Private Subnet Ids" - value = module.aws_vpc.private_subnets + value = module.aws_vpc.private_subnets } output "public_subnet_ids" { description = "Public Subnet Ids" - value = module.aws_vpc.public_subnets + value = module.aws_vpc.public_subnets } \ No newline at end of file diff --git a/terraform/modules/cluster/variables.tf b/terraform/modules/cluster/variables.tf index 6a9eb34a21..e6e8a02f23 100644 --- a/terraform/modules/cluster/variables.tf +++ b/terraform/modules/cluster/variables.tf @@ -16,5 +16,5 @@ variable "map_roles" { username = string groups = list(string) })) - default = [] + default = [] } \ No newline at end of file diff --git a/terraform/modules/ide/cloud9.tf b/terraform/modules/ide/cloud9.tf index b88122b13e..25d5e89a83 100644 --- a/terraform/modules/ide/cloud9.tf +++ b/terraform/modules/ide/cloud9.tf @@ -1,8 +1,8 @@ resource "aws_cloud9_environment_ec2" "c9_workspace" { - instance_type = var.instance_type - name = var.environment_name + instance_type = var.instance_type + name = var.environment_name automatic_stop_time_minutes = 90 - + tags = { Cloud9Bootstrap = "Active" } @@ -61,7 +61,7 @@ resource "aws_iam_policy" "cloud9_additional_policy" { resource "aws_iam_role_policy_attachment" "cloud9_additional_policy" { count = length(var.additional_cloud9_policies) - + role = aws_iam_role.cloud9_role.name policy_arn = aws_iam_policy.cloud9_additional_policy[count.index].arn } @@ -76,9 +76,9 @@ resource "aws_lambda_invocation" "cloud9_instance_profile" { function_name = module.cloud9_bootstrap_lambda.lambda_function_name input = jsonencode({ - instance_id = data.aws_instance.cloud9_instance.id - instance_profile_arn = aws_iam_instance_profile.cloud9_ssm_instance_profile.arn + instance_id = data.aws_instance.cloud9_instance.id + instance_profile_arn = aws_iam_instance_profile.cloud9_ssm_instance_profile.arn instance_profile_name = aws_iam_instance_profile.cloud9_ssm_instance_profile.name - disk_size = var.disk_size + disk_size = var.disk_size }) } \ No newline at end of file diff --git a/terraform/modules/ide/variables.tf b/terraform/modules/ide/variables.tf index 9ddeab4cbd..899f09a175 100644 --- a/terraform/modules/ide/variables.tf +++ b/terraform/modules/ide/variables.tf @@ -11,23 +11,23 @@ variable "subnet_id" { } variable "environment_name" { - type = string - default = "test" + type = string + default = "test" } variable "disk_size" { - type = number - default = 60 + type = number + default = 60 } variable "bootstrap_script" { - type = string - default = "echo 'No extension bootstrap'" + type = string + default = "echo 'No extension bootstrap'" } variable "additional_cloud9_policies" { - type = list - default = [] + type = list(any) + default = [] } variable "cloud9_user_arns" {