terraform-aws-ecs-web-app icon indicating copy to clipboard operation
terraform-aws-ecs-web-app copied to clipboard

if exec is enabled, also enable init process

Open kevcube opened this issue 2 years ago • 2 comments

Seems PR template is ignored if I create PR from GitHub.dev

what

why

  • it will remove zombie processes in containers after exec is run
  • because AWS recommended it

kevcube avatar Mar 29 '22 07:03 kevcube

Tough to implement because both results of a conditional must be the same type, but container_definition module expects either the defined object as input variable, or null

Will be easier when defaults are released.

kevcube avatar Mar 29 '22 08:03 kevcube

Would this work now?

mihaiplesa avatar Oct 07 '22 09:10 mihaiplesa

@kevcube any movement on this one? Worth continuing or should we close it out?

Gowiem avatar Nov 20 '22 22:11 Gowiem

@Gowiem this is ready for review

I based the optional/required state of parameters on this page https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html

This also raises minimum terraform version to 1.3.0, not sure if we're ok with this (cc @nitrocode)

kevcube avatar Dec 03 '22 14:12 kevcube

@nitrocode now that a decision has been made regarding updating terraform, can this be merged?

kevcube avatar Apr 18 '23 22:04 kevcube

@kevcube can you run make init && make github/init locally, commit, and push? That'll fix the auto-format failure.

Gowiem avatar Apr 19 '23 02:04 Gowiem

/test all

Gowiem avatar Apr 19 '23 02:04 Gowiem

/test all

Gowiem avatar Apr 19 '23 02:04 Gowiem

@kevcube there is a map() function call somewhere in the code. Mind hunting around for it so we can do the upgrade to 1.0?

Gowiem avatar Apr 19 '23 02:04 Gowiem

/test all

Gowiem avatar Apr 19 '23 05:04 Gowiem

@kevcube test failure 😔

TestExamplesComplete 2023-04-19T05:05:31Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; ╷
│ Error: error creating S3 bucket ACL for eg-test-ecs-web-app-complete-333-alb-access-logs: AccessControlListNotSupported: The bucket does not allow ACLs
│ 	status code: 400, request id: 4KT6HD601B48BXYT, host id: 2z9g185BrZVK7LO2iQ4mkSgHyjXk2PCt3WxotqB5pX1f6qXdMGjpSA6bzZ+dFGZXaYvYfP0CKM8=
│ 
│   with module.alb.module.access_logs.module.s3_bucket.module.aws_s3_bucket.aws_s3_bucket_acl.default[0],
│   on .terraform/modules/alb.access_logs.s3_bucket.aws_s3_bucket/main.tf line 148, in resource "aws_s3_bucket_acl" "default":
│  148: resource "aws_s3_bucket_acl" "default" {
│ 
╵}
    apply.go:15: 
        	Error Trace:	apply.go:15
        	            				examples_complete_test.go:40
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: error while running command: exit status 1; ╷

Gowiem avatar Apr 19 '23 10:04 Gowiem

@Gowiem yeah... I had this same error locally but it went away on second apply. It might be a race condition that requires a sleep, but it's deep in the module.alb.module.access_logs... might be due to amazon's recent global changes to S3 permissions

kevcube avatar Apr 19 '23 13:04 kevcube

/test terratest

aknysh avatar Apr 19 '23 16:04 aknysh

Seems breakage can be traced to here https://github.com/cloudposse/terraform-aws-s3-bucket/issues/174

After that is fixed, we will need to update terraform-aws-lb-s3-bucket, terraform-aws-alb, then finally update the test.

kevcube avatar Apr 26 '23 17:04 kevcube