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

tags should retry without time bounds on EC2 throttling #3586

Merged
merged 4 commits into from
Nov 14, 2018
Merged
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
56 changes: 52 additions & 4 deletions aws/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,19 @@ func setVolumeTags(conn *ec2.EC2, d *schema.ResourceData) error {
return nil
})
if err != nil {
return err
domdom82 marked this conversation as resolved.
Show resolved Hide resolved
// Retry without time bounds for EC2 throttling
if isResourceTimeoutError(err) {
log.Printf("[DEBUG] Removing volume tags: %#v from %s", remove, d.Id())
_, err := conn.DeleteTags(&ec2.DeleteTagsInput{
Resources: volumeIds,
Tags: remove,
})
if err != nil {
return err
}
} else {
return err
}
}
}
if len(create) > 0 {
Expand All @@ -120,7 +132,19 @@ func setVolumeTags(conn *ec2.EC2, d *schema.ResourceData) error {
return nil
})
if err != nil {
return err
// Retry without time bounds for EC2 throttling
if isResourceTimeoutError(err) {
log.Printf("[DEBUG] Creating vol tags: %s for %s", create, d.Id())
_, err := conn.CreateTags(&ec2.CreateTagsInput{
Resources: volumeIds,
Tags: create,
})
if err != nil {
return err
}
} else {
return err
}
}
}
}
Expand Down Expand Up @@ -155,7 +179,19 @@ func setTags(conn *ec2.EC2, d *schema.ResourceData) error {
return nil
})
if err != nil {
return err
// Retry without time bounds for EC2 throttling
if isResourceTimeoutError(err) {
log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id())
_, err := conn.DeleteTags(&ec2.DeleteTagsInput{
Resources: []*string{aws.String(d.Id())},
Tags: remove,
})
if err != nil {
return err
}
} else {
return err
}
}
}
if len(create) > 0 {
Expand All @@ -175,7 +211,19 @@ func setTags(conn *ec2.EC2, d *schema.ResourceData) error {
return nil
})
if err != nil {
return err
// Retry without time bounds for EC2 throttling
if isResourceTimeoutError(err) {
log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id())
_, err := conn.CreateTags(&ec2.CreateTagsInput{
Resources: []*string{aws.String(d.Id())},
Tags: create,
})
if err != nil {
return err
}
} else {
return err
}
}
}
}
Expand Down