-
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: Support tags for AWS redshift cluster #5356
Conversation
} | ||
|
||
_, err := conn.DeleteTags(&redshift.DeleteTagsInput{ | ||
ResourceName: aws.String(arn), |
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.
Would this API call fail if you passed name instead of ARN?
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.
Not sure actually TBH - looking now
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.
Yes, it will fail. We need to pass the ARN here
Like we discussed in another issue, I'm not a big fan of making more resources dependent on I'm personally inclined to hold off on merging this before #5030 is in place and then we can leverage that logic to get account ID reliably across multiple environments (EC2 instance, IAM User, federated IAM Role). |
With regards to So if we change this, we should change those at the same time |
#5030 is merged and account ID is available via #6503 is fixing the discussed issue for existing resources. Keep in mind that getting the account ID may fail and your function here should expect |
79ba676
to
6b58f4e
Compare
@radeksimko this has been updated with the new way of building the ARN - please let me know if you are happy with this so I can merge :) Ideally, I'd like to get this into 0.6.16! P. |
6b58f4e
to
44d9a93
Compare
|
||
arn, tagErr := buildRedshiftARN(d.Id(), meta.(*AWSClient).accountid, meta.(*AWSClient).region) | ||
if tagErr != nil { | ||
log.Printf("[DEBUG] Error building ARN for Redshift Cluster, not updating Tags for cluster %s", 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.
Are you sure this is a good idea? Just silently ignore tags update? I think we should rather return this as an error to the user, so they're aware that tags have not been updated and they also know why.
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 is how it is currently done in db_instance as well
I just used the same layout here
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.
Good spot!
87907e2#diff-0b21e21c91dc560c837c95806e2ba913R341
^ @catsby was there any specific intention in making tags update fail silently?
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'm in favor of returning an error for a failed tag update, but would be happy to let it slide so long as there's a tracking ticket to come back to it.
I left you some comments there. I can run related acceptance tests for Redshift tomorrow morning. Looking at the retry timeouts scares me away, but I'm happy to verify that before merging for you. 😉 |
44d9a93
to
c9dd12c
Compare
This is looking ok except the two last things:
|
@radeksimko if we are under pressure for 0.6.16 can this be a follow up request for these things are they already exist in db_instance and will need to be fixed there too? |
c9dd12c
to
0782836
Compare
0782836
to
d4fd9f4
Compare
Made the changes as per the review:
The tags unit test is the same test used everywhere. We can make any changes to these later :) |
👍 LGTM |
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. |
Needed to implement a model of marking that a redshift cluster needed modifying. Without this
requestUpdate
variable being set, I was getting the following error:The test results are as follows: