-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Migrate aws_dms_* resources away from AWS waiters #13291
Conversation
2bd7dcb
to
6be45dd
Compare
6c8bafd
to
84a2dcd
Compare
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.
Left some comments / questions
if waitErr != nil { | ||
return waitErr | ||
} | ||
|
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.
Is it OK to no longer wait for deletion here? Waiting for Delete is usually a lesser concern than say waiting for creation, but it's still caused dependency issues in tear-down before
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.
This isn't an issue luckily :) This wasn't necessary luckily
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.
👍
//err = waitForInstanceCreated(conn, d.Get("replication_instance_id").(string), 30, 20) | ||
//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.
dead code, can be removed?
@@ -287,6 +304,23 @@ func resourceAwsDmsReplicationInstanceUpdate(d *schema.ResourceData, meta interf | |||
return err | |||
} | |||
|
|||
d.SetId(d.Get("replication_instance_id").(string)) |
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.
Do we need re-set ID here, or is this just copy/pasta?
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.
Copy/pasta issue :)
Client: client, | ||
Input: input, | ||
Config: config, | ||
return v, *v.ReplicationInstances[0].ReplicationInstanceStatus, 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.
This can panic if v.ReplicationInstances
is nil
, yeah? Not sure how likely that is, but seems worth guarding
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.
Caught above :)
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.
I swear that was !=
above... did you rebase? ;)
Pending: []string{"creating"}, | ||
Target: []string{"available"}, | ||
Refresh: resourceAwsDmsReplicationInstanceStateRefreshFunc(d, meta), | ||
Timeout: d.Timeout(schema.TimeoutCreate), |
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.
schema.TimeoutCreate
isn't defined, are you just leveraging the system level 20 minute default?
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.
Yessir!
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.
👍
@@ -235,12 +255,26 @@ func resourceAwsDmsReplicationTaskDelete(d *schema.ResourceData, meta interface{ | |||
|
|||
_, err := conn.DeleteReplicationTask(request) | |||
if err != nil { | |||
if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { | |||
d.SetId("") |
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.
We should log with [DEBUG]
that the resource d.Id()
wasn't found and is being removed from state, so users can at least see in the debug log what/why this is happening
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.
Done :)
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.
I don't see it (logging that it will be removed)
84a2dcd
to
d1affbd
Compare
@catsby changes made as requested :) |
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.
On missing log
I think, other than that 👍
@@ -235,12 +255,26 @@ func resourceAwsDmsReplicationTaskDelete(d *schema.ResourceData, meta interface{ | |||
|
|||
_, err := conn.DeleteReplicationTask(request) | |||
if err != nil { | |||
if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { | |||
d.SetId("") |
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.
I don't see it (logging that it will be removed)
The AWS waiter package has changed location in the 1.8.0 version of the SDK. DMS will need to mitigate a breaking change because of this Between @radeksimko and myself, we think that we should migrate the DMS resources to using the Terraform state refresh func pattern that is used across the entire of the AWS provider. DMS is the *only* resource that currently uses the AWS waiters, so the LOE to migrate is pretty low
d1affbd
to
7448e6d
Compare
Last log line added, @catsby - will merge on green :) |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The AWS waiter package has changed location in the 1.8.0 version of the
SDK. DMS will need to mitigate a breaking change because of this
Between @radeksimko and myself, we think that we should migrate the DMS
resources to using the Terraform state refresh func pattern that is used
across the entire of the AWS provider. DMS is the only resource that
currently uses the AWS waiters, so the LOE to migrate is pretty low