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

service/sns: Fix schema error #13437

Merged
merged 3 commits into from
May 28, 2020
Merged

service/sns: Fix schema error #13437

merged 3 commits into from
May 28, 2020

Conversation

appilon
Copy link
Contributor

@appilon appilon commented May 20, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #13312

Release note for CHANGELOG:

* resource/aws_sns_topic: Attributes of type `schema.TypeInt` are now correctly set.

Output from acceptance testing:

❯ make testacc TEST=./aws TESTARGS='-run=TestAccAWSSNSTopic_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSSNSTopic_ -timeout 120m
=== RUN   TestAccAWSSNSTopic_basic
=== PAUSE TestAccAWSSNSTopic_basic
=== RUN   TestAccAWSSNSTopic_name
=== PAUSE TestAccAWSSNSTopic_name
=== RUN   TestAccAWSSNSTopic_namePrefix
=== PAUSE TestAccAWSSNSTopic_namePrefix
=== RUN   TestAccAWSSNSTopic_policy
=== PAUSE TestAccAWSSNSTopic_policy
=== RUN   TestAccAWSSNSTopic_withIAMRole
=== PAUSE TestAccAWSSNSTopic_withIAMRole
=== RUN   TestAccAWSSNSTopic_withFakeIAMRole
=== PAUSE TestAccAWSSNSTopic_withFakeIAMRole
=== RUN   TestAccAWSSNSTopic_withDeliveryPolicy
=== PAUSE TestAccAWSSNSTopic_withDeliveryPolicy
=== RUN   TestAccAWSSNSTopic_deliveryStatus
=== PAUSE TestAccAWSSNSTopic_deliveryStatus
=== RUN   TestAccAWSSNSTopic_encryption
=== PAUSE TestAccAWSSNSTopic_encryption
=== RUN   TestAccAWSSNSTopic_tags
=== PAUSE TestAccAWSSNSTopic_tags
=== CONT  TestAccAWSSNSTopic_basic
=== CONT  TestAccAWSSNSTopic_withDeliveryPolicy
=== CONT  TestAccAWSSNSTopic_encryption
=== CONT  TestAccAWSSNSTopic_tags
=== CONT  TestAccAWSSNSTopic_policy
=== CONT  TestAccAWSSNSTopic_withFakeIAMRole
=== CONT  TestAccAWSSNSTopic_withIAMRole
=== CONT  TestAccAWSSNSTopic_namePrefix
=== CONT  TestAccAWSSNSTopic_name
=== CONT  TestAccAWSSNSTopic_deliveryStatus
--- PASS: TestAccAWSSNSTopic_name (22.79s)
--- PASS: TestAccAWSSNSTopic_namePrefix (23.10s)
--- PASS: TestAccAWSSNSTopic_basic (23.38s)
--- PASS: TestAccAWSSNSTopic_policy (24.50s)
--- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (24.50s)
--- PASS: TestAccAWSSNSTopic_withIAMRole (33.89s)
--- PASS: TestAccAWSSNSTopic_encryption (37.90s)
--- PASS: TestAccAWSSNSTopic_deliveryStatus (39.78s)
--- PASS: TestAccAWSSNSTopic_tags (50.92s)
--- PASS: TestAccAWSSNSTopic_withFakeIAMRole (135.16s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	136.958s

@appilon appilon requested a review from a team May 20, 2020 19:20
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/sns Issues and PRs that pertain to the sns service. labels May 20, 2020
@bflad bflad self-assigned this May 21, 2020
@bflad
Copy link
Contributor

bflad commented May 21, 2020

Oi! This resource was actually the impetus for the tfproviderlint R001 check (#9951 to enable in this repository) since this looping behavior makes for less readable code and schema setting bugs like these. Would be interested in converting this one to properly do each d.Set() individually instead?

@appilon
Copy link
Contributor Author

appilon commented May 21, 2020

@bflad sure!

@bflad
Copy link
Contributor

bflad commented May 21, 2020

@appilon you da best.

@appilon appilon added this to the v2.64.0 milestone May 27, 2020
@appilon appilon force-pushed the b-sns-schema-panic branch from a926670 to 61c6bc6 Compare May 27, 2020 20:02
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels May 27, 2020
@appilon appilon requested a review from bflad May 27, 2020 20:03
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

I wouldn't worry about the nits for now, LGTM 🚀

Output from acceptance testing:

--- PASS: TestAccAWSSNSTopic_basic (11.02s)
--- PASS: TestAccAWSSNSTopic_deliveryStatus (30.59s)
--- PASS: TestAccAWSSNSTopic_encryption (16.90s)
--- PASS: TestAccAWSSNSTopic_name (13.06s)
--- PASS: TestAccAWSSNSTopic_namePrefix (12.43s)
--- PASS: TestAccAWSSNSTopic_policy (12.35s)
--- PASS: TestAccAWSSNSTopic_tags (23.13s)
--- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (12.63s)
--- PASS: TestAccAWSSNSTopic_withFakeIAMRole (127.66s)
--- PASS: TestAccAWSSNSTopic_withIAMRole (28.00s)

}
// update mutable attributes
if d.HasChange("application_failure_feedback_role_arn") {
_, v := d.GetChange("application_failure_feedback_role_arn")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: These will be fixed later on with #12085, but only using the second value of d.GetChange() can be replaced with d.Get(). This is no different than before so it is fine to leave for now. 👍

return err
}
}
if d.HasChange("arn") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: arn is not actually configurable, but presumably it was included in the previous mapping so it would get picked up for read. This is no different than before so it is fine to leave for now. 👍

@appilon appilon merged commit 39158b4 into master May 28, 2020
@appilon appilon deleted the b-sns-schema-panic branch May 28, 2020 00:07
@ghost
Copy link

ghost commented May 29, 2020

This has been released in version 2.64.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jun 27, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/sns Issues and PRs that pertain to the sns service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants