Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a timeouts block to aws_cloudformation_stack resource #961

Closed
micahhausler opened this issue Jun 23, 2017 · 3 comments · Fixed by #994
Closed

Add a timeouts block to aws_cloudformation_stack resource #961

micahhausler opened this issue Jun 23, 2017 · 3 comments · Fixed by #994
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@micahhausler
Copy link
Contributor

micahhausler commented Jun 23, 2017

aws_cloudformation_stack resources currently have the timeout of 30 minutes, but if you have an auto-scale group manged by CF with an update policy with a PauseTime of 10minutes, you'll go over the Terraform timeout if you have 3 nodes.

...
    "UpdatePolicy": {
       "AutoScalingRollingUpdate": {
           "MaxBatchSize": 1,
            "MinInstancesInService": 2,
            "PauseTime": "PT10M",
            "WaitOnResourceSignals": "false"
        }
    }
...

This is the message you'll get.

* aws_cloudformation_stack.etcd_stack: timeout while waiting for state to become 'CREATE_COMPLETE, UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, UPDATE_ROLLBACK_FAILED' (last state: 'UPDATE_IN_PROGRESS', timeout: 30m0s)

It'd be great to have aws_cloudformation_stacks with configurable timeouts

timeouts {
    update = "45m"
}

Terraform Version

Terraform v0.9.8
@radeksimko
Copy link
Member

Hi @micahhausler
we already allow you to specify custom timeout via timeout_in_minutes. This is API-level timeout passed to the CF API and we also use it when gathering the stack events and looking for failures, we just add 5 more minutes on top of that custom timeout internally as there may be some operations before/after stack creation which we may need to catch (e.g. if CF reaches the timeout and we have to catch that error message caused by that).

I agree that timeouts stanza would be more conventional, now that we have it supported in the schema, so I'm labelling this as enhancement, but the functionality is there, IMO.

Let me know if I missed something.

@radeksimko radeksimko added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 25, 2017
@micahhausler
Copy link
Contributor Author

Sounds good to me. Thanks!

stack72 added a commit that referenced this issue Jun 28, 2017
Fixes: #961

```
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudFormation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCloudFormation_ -timeout 120m
=== RUN   TestAccAWSCloudFormation_basic
--- PASS: TestAccAWSCloudFormation_basic (84.48s)
=== RUN   TestAccAWSCloudFormation_yaml
--- PASS: TestAccAWSCloudFormation_yaml (84.53s)
=== RUN   TestAccAWSCloudFormation_defaultParams
--- PASS: TestAccAWSCloudFormation_defaultParams (84.81s)
=== RUN   TestAccAWSCloudFormation_allAttributes
--- PASS: TestAccAWSCloudFormation_allAttributes (131.14s)
=== RUN   TestAccAWSCloudFormation_withParams
--- PASS: TestAccAWSCloudFormation_withParams (157.67s)
=== RUN   TestAccAWSCloudFormation_withUrl_withParams
--- PASS: TestAccAWSCloudFormation_withUrl_withParams (228.50s)
=== RUN   TestAccAWSCloudFormation_withUrl_withParams_withYaml
--- PASS: TestAccAWSCloudFormation_withUrl_withParams_withYaml (135.53s)
=== RUN   TestAccAWSCloudFormation_withUrl_withParams_noUpdate
--- PASS: TestAccAWSCloudFormation_withUrl_withParams_noUpdate (186.99s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1093.670s
```
stack72 added a commit that referenced this issue Jun 28, 2017
Fixes: #961

```
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudFormation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCloudFormation_ -timeout 120m
=== RUN   TestAccAWSCloudFormation_basic
--- PASS: TestAccAWSCloudFormation_basic (84.48s)
=== RUN   TestAccAWSCloudFormation_yaml
--- PASS: TestAccAWSCloudFormation_yaml (84.53s)
=== RUN   TestAccAWSCloudFormation_defaultParams
--- PASS: TestAccAWSCloudFormation_defaultParams (84.81s)
=== RUN   TestAccAWSCloudFormation_allAttributes
--- PASS: TestAccAWSCloudFormation_allAttributes (131.14s)
=== RUN   TestAccAWSCloudFormation_withParams
--- PASS: TestAccAWSCloudFormation_withParams (157.67s)
=== RUN   TestAccAWSCloudFormation_withUrl_withParams
--- PASS: TestAccAWSCloudFormation_withUrl_withParams (228.50s)
=== RUN   TestAccAWSCloudFormation_withUrl_withParams_withYaml
--- PASS: TestAccAWSCloudFormation_withUrl_withParams_withYaml (135.53s)
=== RUN   TestAccAWSCloudFormation_withUrl_withParams_noUpdate
--- PASS: TestAccAWSCloudFormation_withUrl_withParams_noUpdate (186.99s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1093.670s
```
@ghost
Copy link

ghost commented Apr 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants