Skip to content

Commit 6b1161a

Browse files
readme updated, BC compliance check fixed (#26)
* readme updated, BC compliance check fixed * BC checks fixed * Auto Format * tags added where possible * tests fixed Co-authored-by: cloudpossebot <[email protected]>
1 parent b78b73d commit 6b1161a

File tree

12 files changed

+52
-29
lines changed

12 files changed

+52
-29
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
*.tfstate
33
*.tfstate.backup
44
.terraform.tfstate.lock.info
5+
**/.terraform.lock.hcl
6+
**/test.log
57

68
# Module directory
79
.terraform/

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,7 @@ Available targets:
408408
|------|---------|
409409
| terraform | >= 0.12.26 |
410410
| aws | >= 2.0 |
411-
| local | >= 1.3 |
412-
| null | >= 2.0 |
413411
| random | >= 2.0 |
414-
| template | >= 2.0 |
415412

416413
## Providers
417414

docs/terraform.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
|------|---------|
66
| terraform | >= 0.12.26 |
77
| aws | >= 2.0 |
8-
| local | >= 1.3 |
9-
| null | >= 2.0 |
108
| random | >= 2.0 |
11-
| template | >= 2.0 |
129

1310
## Providers
1411

examples/complete/main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module "subnets" {
2525

2626
module "alb" {
2727
source = "cloudposse/alb/aws"
28-
version = "0.24.0"
28+
version = "0.27.0"
2929
vpc_id = module.vpc.vpc_id
3030
security_group_ids = [module.vpc.vpc_default_security_group_id]
3131
subnet_ids = module.subnets.public_subnet_ids
@@ -43,9 +43,14 @@ module "alb" {
4343
resource "aws_ecs_cluster" "default" {
4444
name = module.this.id
4545
tags = module.this.tags
46+
setting {
47+
name = "containerInsights"
48+
value = "enabled"
49+
}
4650
}
4751

4852
resource "aws_sns_topic" "sns_topic" {
53+
#bridgecrew:skip=BC_AWS_GENERAL_15:Skipping `Encrypt SNS Topic Data` in example/test modules
4954
name = module.this.id
5055
display_name = "Test terraform-aws-ecs-atlantis"
5156
tags = module.this.tags

examples/with_cognito_authentication/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ module "alb" {
5050
# ECS Cluster (needed even if using FARGATE launch type)
5151
resource "aws_ecs_cluster" "default" {
5252
name = module.this.id
53+
tags = module.this.tags
54+
setting {
55+
name = "containerInsights"
56+
value = "enabled"
57+
}
5358
}
5459

5560
module "atlantis" {

examples/with_google_oidc_authentication/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ module "alb" {
4949
# ECS Cluster (needed even if using FARGATE launch type)
5050
resource "aws_ecs_cluster" "default" {
5151
name = module.this.id
52+
tags = module.this.tags
53+
setting {
54+
name = "containerInsights"
55+
value = "enabled"
56+
}
5257
}
5358

5459
module "atlantis" {

examples/without_authentication/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ module "alb" {
4949
# ECS Cluster (needed even if using FARGATE launch type)
5050
resource "aws_ecs_cluster" "default" {
5151
name = module.this.id
52+
tags = module.this.tags
53+
setting {
54+
name = "containerInsights"
55+
value = "enabled"
56+
}
5257
}
5358

5459
module "atlantis" {

main.tf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module "github_webhooks" {
6767

6868
module "ecs_web_app" {
6969
source = "cloudposse/ecs-web-app/aws"
70-
version = "0.46.0"
70+
version = "0.48.1"
7171

7272
region = var.region
7373
vpc_id = var.vpc_id
@@ -201,6 +201,7 @@ resource "aws_ssm_parameter" "atlantis_port" {
201201
overwrite = var.overwrite_ssm_parameter
202202
type = "String"
203203
value = var.atlantis_port
204+
tags = module.this.tags
204205
}
205206

206207
resource "aws_ssm_parameter" "atlantis_atlantis_url" {
@@ -210,6 +211,7 @@ resource "aws_ssm_parameter" "atlantis_atlantis_url" {
210211
overwrite = var.overwrite_ssm_parameter
211212
type = "String"
212213
value = local.atlantis_url
214+
tags = module.this.tags
213215
}
214216

215217
resource "aws_ssm_parameter" "atlantis_gh_user" {
@@ -219,6 +221,7 @@ resource "aws_ssm_parameter" "atlantis_gh_user" {
219221
overwrite = var.overwrite_ssm_parameter
220222
type = "String"
221223
value = var.atlantis_gh_user
224+
tags = module.this.tags
222225
}
223226

224227
resource "aws_ssm_parameter" "atlantis_gh_team_whitelist" {
@@ -228,6 +231,7 @@ resource "aws_ssm_parameter" "atlantis_gh_team_whitelist" {
228231
overwrite = var.overwrite_ssm_parameter
229232
type = "String"
230233
value = var.atlantis_gh_team_whitelist
234+
tags = module.this.tags
231235
}
232236

233237
resource "aws_ssm_parameter" "atlantis_gh_webhook_secret" {
@@ -238,6 +242,7 @@ resource "aws_ssm_parameter" "atlantis_gh_webhook_secret" {
238242
overwrite = var.overwrite_ssm_parameter
239243
type = "SecureString"
240244
value = local.atlantis_gh_webhook_secret
245+
tags = module.this.tags
241246
}
242247

243248
resource "aws_ssm_parameter" "atlantis_iam_role_arn" {
@@ -247,6 +252,7 @@ resource "aws_ssm_parameter" "atlantis_iam_role_arn" {
247252
overwrite = var.overwrite_ssm_parameter
248253
type = "String"
249254
value = module.ecs_web_app.ecs_task_role_arn
255+
tags = module.this.tags
250256
}
251257

252258
resource "aws_ssm_parameter" "atlantis_log_level" {
@@ -256,6 +262,7 @@ resource "aws_ssm_parameter" "atlantis_log_level" {
256262
overwrite = var.overwrite_ssm_parameter
257263
type = "String"
258264
value = var.atlantis_log_level
265+
tags = module.this.tags
259266
}
260267

261268
resource "aws_ssm_parameter" "atlantis_repo_config" {
@@ -265,6 +272,7 @@ resource "aws_ssm_parameter" "atlantis_repo_config" {
265272
overwrite = var.overwrite_ssm_parameter
266273
type = "String"
267274
value = var.atlantis_repo_config
275+
tags = module.this.tags
268276
}
269277

270278
resource "aws_ssm_parameter" "atlantis_repo_whitelist" {
@@ -274,6 +282,7 @@ resource "aws_ssm_parameter" "atlantis_repo_whitelist" {
274282
overwrite = var.overwrite_ssm_parameter
275283
type = "String"
276284
value = join(",", var.atlantis_repo_whitelist)
285+
tags = module.this.tags
277286
}
278287

279288
resource "aws_ssm_parameter" "atlantis_wake_word" {
@@ -283,6 +292,7 @@ resource "aws_ssm_parameter" "atlantis_wake_word" {
283292
overwrite = var.overwrite_ssm_parameter
284293
type = "String"
285294
value = var.atlantis_wake_word
295+
tags = module.this.tags
286296
}
287297

288298
resource "aws_ssm_parameter" "atlantis_gh_token" {
@@ -293,6 +303,7 @@ resource "aws_ssm_parameter" "atlantis_gh_token" {
293303
overwrite = var.overwrite_ssm_parameter
294304
type = "SecureString"
295305
value = local.github_oauth_token
306+
tags = module.this.tags
296307
}
297308

298309
resource "aws_ssm_parameter" "github_webhooks_token" {
@@ -303,6 +314,7 @@ resource "aws_ssm_parameter" "github_webhooks_token" {
303314
overwrite = var.overwrite_ssm_parameter
304315
type = "SecureString"
305316
value = local.github_webhooks_token
317+
tags = module.this.tags
306318
}
307319

308320
resource "aws_security_group_rule" "egress_http" {
@@ -430,6 +442,7 @@ resource "aws_ssm_parameter" "atlantis_cognito_user_pool_arn" {
430442
key_id = local.kms_key_id
431443
name = local.authentication_cognito_user_pool_arn_ssm_name
432444
value = local.authentication_cognito_user_pool_arn
445+
tags = module.this.tags
433446
}
434447

435448
resource "aws_ssm_parameter" "atlantis_cognito_user_pool_client_id" {
@@ -440,6 +453,7 @@ resource "aws_ssm_parameter" "atlantis_cognito_user_pool_client_id" {
440453
key_id = local.kms_key_id
441454
name = local.authentication_cognito_user_pool_client_id_ssm_name
442455
value = local.authentication_cognito_user_pool_client_id
456+
tags = module.this.tags
443457
}
444458

445459
resource "aws_ssm_parameter" "atlantis_cognito_user_pool_domain" {
@@ -450,6 +464,7 @@ resource "aws_ssm_parameter" "atlantis_cognito_user_pool_domain" {
450464
key_id = local.kms_key_id
451465
name = local.authentication_cognito_user_pool_domain_ssm_name
452466
value = local.authentication_cognito_user_pool_domain
467+
tags = module.this.tags
453468
}
454469

455470
resource "aws_ssm_parameter" "atlantis_oidc_client_id" {
@@ -460,6 +475,7 @@ resource "aws_ssm_parameter" "atlantis_oidc_client_id" {
460475
key_id = local.kms_key_id
461476
name = local.authentication_oidc_client_id_ssm_name
462477
value = local.authentication_oidc_client_id
478+
tags = module.this.tags
463479
}
464480

465481
resource "aws_ssm_parameter" "atlantis_oidc_client_secret" {
@@ -470,4 +486,5 @@ resource "aws_ssm_parameter" "atlantis_oidc_client_secret" {
470486
key_id = local.kms_key_id
471487
name = local.authentication_oidc_client_secret_ssm_name
472488
value = local.authentication_oidc_client_secret
489+
tags = module.this.tags
473490
}

test/src/examples_complete_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,25 +113,25 @@ func TestExamplesComplete(t *testing.T) {
113113
// Run `terraform output` to get the value of an output variable
114114
codebuildCacheBucketName := terraform.Output(t, terraformOptions, "codebuild_cache_bucket_name")
115115
// Verify we're getting back the outputs we expect
116-
expectedCodebuildCacheBucketName := "eg-test-ecs-atlantis-" + attributes[0] + "-build"
116+
expectedCodebuildCacheBucketName := "eg-test-ecs-atlantis-build-" + attributes[0]
117117
assert.Contains(t, codebuildCacheBucketName, expectedCodebuildCacheBucketName)
118118

119119
// Run `terraform output` to get the value of an output variable
120120
codebuildProjectName := terraform.Output(t, terraformOptions, "codebuild_project_name")
121121
// Verify we're getting back the outputs we expect
122-
expectedCodebuildProjectName := "eg-test-ecs-atlantis-" + attributes[0] + "-build"
122+
expectedCodebuildProjectName := "eg-test-ecs-atlantis-build-" + attributes[0]
123123
assert.Equal(t, expectedCodebuildProjectName, codebuildProjectName)
124124

125125
// Run `terraform output` to get the value of an output variable
126126
codebuildRoleId := terraform.Output(t, terraformOptions, "codebuild_role_id")
127127
// Verify we're getting back the outputs we expect
128-
expectedCodebuildRoleId := "eg-test-ecs-atlantis-" + attributes[0] + "-build"
128+
expectedCodebuildRoleId := "eg-test-ecs-atlantis-build-" + attributes[0]
129129
assert.Equal(t, expectedCodebuildRoleId, codebuildRoleId)
130130

131131
// Run `terraform output` to get the value of an output variable
132132
codepipelineId := terraform.Output(t, terraformOptions, "codepipeline_id")
133133
// Verify we're getting back the outputs we expect
134-
expectedCodepipelineId := "eg-test-ecs-atlantis-codepipeline-" + attributes[0]
134+
expectedCodepipelineId := "eg-test-ecs-atlantis-" + attributes[0] + "-codepipeline"
135135
assert.Equal(t, expectedCodepipelineId, codepipelineId)
136136

137137
// Run `terraform output` to get the value of an output variable
@@ -143,13 +143,13 @@ func TestExamplesComplete(t *testing.T) {
143143
// Run `terraform output` to get the value of an output variable
144144
ecsTaskRoleName := terraform.Output(t, terraformOptions, "ecs_task_role_name")
145145
// Verify we're getting back the outputs we expect
146-
expectedEcsTaskRoleName := "eg-test-ecs-atlantis-task-" + attributes[0]
146+
expectedEcsTaskRoleName := "eg-test-ecs-atlantis-" + attributes[0] + "-task"
147147
assert.Equal(t, expectedEcsTaskRoleName, ecsTaskRoleName)
148148

149149
// Run `terraform output` to get the value of an output variable
150150
ecsTaskExecRoleName := terraform.Output(t, terraformOptions, "ecs_task_exec_role_name")
151151
// Verify we're getting back the outputs we expect
152-
expectedEcsTaskExecRoleName := "eg-test-ecs-atlantis-exec-" + attributes[0]
152+
expectedEcsTaskExecRoleName := "eg-test-ecs-atlantis-" + attributes[0] + "-exec"
153153
assert.Equal(t, expectedEcsTaskExecRoleName, ecsTaskExecRoleName)
154154

155155
// Run `terraform output` to get the value of an output variable
@@ -161,7 +161,7 @@ func TestExamplesComplete(t *testing.T) {
161161
// Run `terraform output` to get the value of an output variable
162162
ecsExecRolePolicyName := terraform.Output(t, terraformOptions, "ecs_exec_role_policy_name")
163163
// Verify we're getting back the outputs we expect
164-
expectedEcsExecRolePolicyName := "eg-test-ecs-atlantis-exec-" + attributes[0]
164+
expectedEcsExecRolePolicyName := "eg-test-ecs-atlantis-" + attributes[0] + "-exec"
165165
assert.Equal(t, expectedEcsExecRolePolicyName, ecsExecRolePolicyName)
166166

167167
// Run `terraform output` to get the value of an output variable

test/src/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module github.com/cloudposse/terraform-aws-ecs-atlantis
33
go 1.14
44

55
require (
6-
github.com/gruntwork-io/terratest v0.30.23
6+
github.com/gruntwork-io/terratest v0.31.4
77
github.com/stretchr/testify v1.6.1
88
)

0 commit comments

Comments
 (0)