diff --git a/aws/resource_aws_cloudformation_stack_set.go b/aws/resource_aws_cloudformation_stack_set.go index 683c2ec2650..eb63a7142ce 100644 --- a/aws/resource_aws_cloudformation_stack_set.go +++ b/aws/resource_aws_cloudformation_stack_set.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "regexp" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" @@ -24,6 +25,10 @@ func resourceAwsCloudFormationStackSet() *schema.Resource { State: schema.ImportStatePassthrough, }, + Timeouts: &schema.ResourceTimeout{ + Update: schema.DefaultTimeout(30 * time.Minute), + }, + Schema: map[string]*schema.Schema{ "administration_role_arn": { Type: schema.TypeString, @@ -228,12 +233,16 @@ func resourceAwsCloudFormationStackSetUpdate(d *schema.ResourceData, meta interf } log.Printf("[DEBUG] Updating CloudFormation Stack Set: %s", input) - _, err := conn.UpdateStackSet(input) + output, err := conn.UpdateStackSet(input) if err != nil { return fmt.Errorf("error updating CloudFormation Stack Set (%s): %s", d.Id(), err) } + if err := waitForCloudFormationStackSetOperation(conn, d.Id(), aws.StringValue(output.OperationId), d.Timeout(schema.TimeoutUpdate)); err != nil { + return fmt.Errorf("error waiting for CloudFormation Stack Set (%s) update: %s", d.Id(), err) + } + return resourceAwsCloudFormationStackSetRead(d, meta) } diff --git a/website/docs/r/cloudformation_stack_set.html.markdown b/website/docs/r/cloudformation_stack_set.html.markdown index 5c9f7d1e22f..86cca2839b7 100644 --- a/website/docs/r/cloudformation_stack_set.html.markdown +++ b/website/docs/r/cloudformation_stack_set.html.markdown @@ -103,6 +103,12 @@ In addition to all arguments above, the following attributes are exported: * `id` - Name of the Stack Set. * `stack_set_id` - Unique identifier of the Stack Set. +## Timeouts + +`aws_cloudformation_stack_set` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +* `update` - (Default `30m`) How long to wait for a Stack Set to be updated. + ## Import CloudFormation Stack Sets can be imported using the `name`, e.g.