diff --git a/aws/resource_aws_appautoscaling_policy.go b/aws/resource_aws_appautoscaling_policy.go index 9a3e495450cc..9c62f10bdfb9 100644 --- a/aws/resource_aws_appautoscaling_policy.go +++ b/aws/resource_aws_appautoscaling_policy.go @@ -277,6 +277,9 @@ func resourceAwsAppautoscalingPolicyCreate(d *schema.ResourceData, meta interfac } return nil }) + if isResourceTimeoutError(err) { + resp, err = conn.PutScalingPolicy(¶ms) + } if err != nil { return fmt.Errorf("Failed to create scaling policy: %s", err) } @@ -302,6 +305,9 @@ func resourceAwsAppautoscalingPolicyRead(d *schema.ResourceData, meta interface{ } return nil }) + if isResourceTimeoutError(err) { + p, err = getAwsAppautoscalingPolicy(d, meta) + } if err != nil { return fmt.Errorf("Failed to read scaling policy: %s", err) } @@ -353,6 +359,9 @@ func resourceAwsAppautoscalingPolicyUpdate(d *schema.ResourceData, meta interfac } return nil }) + if isResourceTimeoutError(err) { + _, err = conn.PutScalingPolicy(¶ms) + } if err != nil { return fmt.Errorf("Failed to update scaling policy: %s", err) } diff --git a/aws/resource_aws_appautoscaling_scheduled_action.go b/aws/resource_aws_appautoscaling_scheduled_action.go index 03ac1156b928..33a7cd4aa113 100644 --- a/aws/resource_aws_appautoscaling_scheduled_action.go +++ b/aws/resource_aws_appautoscaling_scheduled_action.go @@ -133,9 +133,12 @@ func resourceAwsAppautoscalingScheduledActionPut(d *schema.ResourceData, meta in } return nil }) + if isResourceTimeoutError(err) { + _, err = conn.PutScheduledAction(input) + } if err != nil { - return err + return fmt.Errorf("Error putting scheduled action: %s", err) } d.SetId(d.Get("name").(string) + "-" + d.Get("service_namespace").(string) + "-" + d.Get("resource_id").(string))