-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
resource/aws_elastic_beanstalk_application: Retry DescribeApplication after creation #3064
Conversation
return err | ||
} | ||
_, err = beanstalkConn.DeleteApplication(&elasticbeanstalk.DeleteApplicationInput{ | ||
_, err := beanstalkConn.DeleteApplication(&elasticbeanstalk.DeleteApplicationInput{ | ||
ApplicationName: aws.String(d.Id()), | ||
}) | ||
if err != nil { | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future note: we should add if isAWSErr(err, "InvalidBeanstalkAppID.NotFound", "") {
here if necessary to immediately return nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can add that 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this error will never be returned from that method, per docs and my own experiments. You get 200 OK
if you try to delete an application which doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retry logic looks good, left 2 comments, which probably should be addressed now while we're in here, but not complete blockers.
|
||
if app == nil { | ||
if d.IsNewResource() { | ||
return resource.RetryableError(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: err
will be nil
for both of these app == nil
error messages. Maybe should return something like fmt.Errorf("Reading Elastic Beanstalk application %s not found.", d.Id())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. 👍
521bba0
to
4c03876
Compare
This has been released in terraform-provider-aws version 1.7.1. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
This is to address the following test failure:
Snippet from related debug log:
Test results