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

provider/aws: Migrate aws_dms_* resources away from AWS waiters #13291

Merged
merged 1 commit into from
Apr 5, 2017

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Apr 3, 2017

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

@stack72 stack72 changed the title provider/aws: Migrate aws_dms_* resources away from AWS waiters [WIP] provider/aws: Migrate aws_dms_* resources away from AWS waiters Apr 3, 2017
@stack72 stack72 force-pushed the b-aws-dms-away-from-waiter branch from 2bd7dcb to 6be45dd Compare April 4, 2017 10:24
@stack72 stack72 force-pushed the b-aws-dms-away-from-waiter branch 2 times, most recently from 6c8bafd to 84a2dcd Compare April 4, 2017 12:32
@stack72 stack72 changed the title [WIP] provider/aws: Migrate aws_dms_* resources away from AWS waiters provider/aws: Migrate aws_dms_* resources away from AWS waiters Apr 4, 2017
Copy link
Contributor

@catsby catsby left a 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
}

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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
//}
Copy link
Contributor

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))
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Caught above :)

Copy link
Contributor

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),
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yessir!

Copy link
Contributor

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("")
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

Copy link
Contributor

@catsby catsby Apr 4, 2017

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)

@stack72 stack72 force-pushed the b-aws-dms-away-from-waiter branch from 84a2dcd to d1affbd Compare April 4, 2017 15:32
@stack72
Copy link
Contributor Author

stack72 commented Apr 4, 2017

@catsby changes made as requested :)

Copy link
Contributor

@catsby catsby left a 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("")
Copy link
Contributor

@catsby catsby Apr 4, 2017

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
@stack72 stack72 force-pushed the b-aws-dms-away-from-waiter branch from d1affbd to 7448e6d Compare April 5, 2017 05:42
@stack72
Copy link
Contributor Author

stack72 commented Apr 5, 2017

Last log line added, @catsby - will merge on green :)

@stack72 stack72 merged commit 5cad27b into master Apr 5, 2017
@stack72 stack72 deleted the b-aws-dms-away-from-waiter branch April 5, 2017 05:48
@ghost
Copy link

ghost commented Apr 14, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants