-
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
New resource: aws_iot_thing_principal_attachment #5868
New resource: aws_iot_thing_principal_attachment #5868
Conversation
hi @bflad, is there anything missing for this PR to be merged? |
Since this PR looks like it would receive some of the same feedback as #5864, I'll let you update this one as well before review. 👍 |
…add destruction check in tests
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, @spirius, with one documentation fix which I can take care of post-merge. Thanks! 🚀
--- PASS: TestAccAWSIotThingPrincipalAttachment_basic (17.32s)
@@ -1408,6 +1408,11 @@ | |||
<li<%= sidebar_current("docs-aws-resource-iot-thing") %>> | |||
<a href="/docs/providers/aws/r/iot_thing.html">aws_iot_thing</a> | |||
</li> | |||
|
|||
<li<%= sidebar_current("docs-aws-resource-iot-thing-principal-attachment") %>> | |||
<a href="/docs/providers/aws/r/iot_thing.html">aws_iot_thing_principal_attachment</a> |
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.
Missing _principal_attachment
😄
}) | ||
if isAWSErr(err, iot.ErrCodeResourceNotFoundException, "") { | ||
return false, nil | ||
} else if err != 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.
Nit: Since the previous conditional return
s, the else
is extraneous. 👍
found := false | ||
for _, name := range out.Principals { | ||
if principal == aws.StringValue(name) { | ||
found = true |
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: Since this is only intended to trigger an immediate return
, the found
logic can be removed and instead this can return true, nil
here while below the loop does return false, nil
This has been released in version 1.42.0 of the AWS provider. 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! |
Added aws_iot_thing_principal_attachment resource.
Test results: