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

Retries for appautoscaling #9039

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions aws/resource_aws_appautoscaling_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ func resourceAwsAppautoscalingPolicyCreate(d *schema.ResourceData, meta interfac
}
return nil
})
if isResourceTimeoutError(err) {
resp, err = conn.PutScalingPolicy(&params)
}
if err != nil {
return fmt.Errorf("Failed to create scaling policy: %s", err)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -353,6 +359,9 @@ func resourceAwsAppautoscalingPolicyUpdate(d *schema.ResourceData, meta interfac
}
return nil
})
if isResourceTimeoutError(err) {
_, err = conn.PutScalingPolicy(&params)
}
if err != nil {
return fmt.Errorf("Failed to update scaling policy: %s", err)
}
Expand Down
5 changes: 4 additions & 1 deletion aws/resource_aws_appautoscaling_scheduled_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

}

d.SetId(d.Get("name").(string) + "-" + d.Get("service_namespace").(string) + "-" + d.Get("resource_id").(string))
Expand Down