Skip to content

Conversation

almeida-matheus
Copy link

Summary

Fix error when using the module to deploy cloudformation stacks in multiple AWS accounts

The default timeout to deploy cloudformation stack is 30 minutes, in my environment this is enough time to deploy to approximately 30 AWS accounts, the problem is that my organization has more than 30 AWS accounts

Issue

Error example:

╷
│ Error: creating CloudFormation StackSet (lacework-aws-org-configuration) Instance: waiting for completion: timeout while waiting for state to become 'SUCCEEDED' (last state: 'QUEUED', timeout: 30m0s)
│ 
│   with module.aws_org_configuration[0].aws_cloudformation_stack_set_instance.lacework_stackset_instances,
│   on .terraform/modules/aws_org_configuration/main.tf line 410, in resource "aws_cloudformation_stack_set_instance" "lacework_stackset_instances":
│  410: resource "aws_cloudformation_stack_set_instance" "lacework_stackset_instances" {
│ 
╵

Reference documentation:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudformation_stack_set_instance#timeouts
https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts

@ipcrm
Copy link

ipcrm commented Feb 28, 2024

👋 @almeida-matheus thank you for submitting this!

I'm curious the behavior you were seeing; given this default https://github.com/lacework/terraform-aws-org-configuration/blob/main/variables.tf#L101 I would have expected up to 50 accounts to run in parallel. Were you seeing each account run serially?

@almeida-matheus
Copy link
Author

Hi @ipcrm, thank you

To be honest I didn't realize if the execution was completely in parallel, apparently there is a part in series since the execution time of the terraform code always lasts 32m30s.

However, there is a variation in the number of accounts deployed here. Because I tried 3 times and every time I got the same error, but in the last attempt the deployment was successful in 36 AWS accounts instead of 30

In the next attempt I will carefully observe the behavior in each AWS account during execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants