-
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
Final retries for kinesis applications #8984
Conversation
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.
LGTM with one non-blocking nit for the future. 🚀
--- PASS: TestAccAWSKinesisAnalyticsApplication_basic (13.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_update (18.79s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSource (19.22s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_tags (28.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_referenceDataSourceUpdate (28.74s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_addCloudwatchLoggingOptions (30.01s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Create (32.68s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_updateCloudwatchLoggingOptions (41.59s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_Outputs_Lambda_Add (43.23s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsMultiple (93.26s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisStream (94.60s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsAdd (105.27s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsKinesisStream (106.37s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsAdd (112.53s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsKinesisFirehose (112.67s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_inputsUpdateKinesisStream (170.12s)
--- PASS: TestAccAWSKinesisAnalyticsApplication_outputsUpdateKinesisStream (170.05s)
@@ -614,6 +614,13 @@ func resourceAwsKinesisAnalyticsApplicationCreate(d *schema.ResourceData, meta i | |||
d.SetId(aws.StringValue(output.ApplicationSummary.ApplicationARN)) | |||
return nil | |||
}) | |||
|
|||
if isResourceTimeoutError(err) { | |||
var output *kinesisanalytics.CreateApplicationOutput |
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.
Nit: The updated code could simplify this handling by having this variable declaration before the original resource.Retry()
and calling d.SetId()
after all errors have been checked, e.g.
var output *kinesisanalytics.CreateApplicationOutput
err := resource.Retry(1*time.Minute, func() *resource.RetryError {
var err error
output, err = conn.CreateApplication(createOpts)
if err != nil {
/* ... existing error handling ... */
}
return nil
}
if isResourceTimeoutError(err) {
output, err = conn.CreateApplication(createOpts)
}
if err != nil {
return fmt.Errorf("error creating Kinesis Analytics Application: %s", err)
}
d.SetId(aws.StringValue(output.ApplicationSummary.ApplicationARN))
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.
Gotcha! Will keep an eye out for this in future files!
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! |
Community Note
References #7873
Release note for CHANGELOG:
Output from acceptance testing: