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

Fix error handling of aws_iam_policy resouce #7072

Conversation

teraken0509
Copy link
Contributor

Fixes #35

Changes proposed in this pull request:

  • Fix Error handling at delete
  • Add test function

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSIAMPolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSIAMPolicy_ -timeout 120m
=== RUN   TestAccAWSIAMPolicy_basic
=== PAUSE TestAccAWSIAMPolicy_basic
=== RUN   TestAccAWSIAMPolicy_description
=== PAUSE TestAccAWSIAMPolicy_description
=== RUN   TestAccAWSIAMPolicy_disappears
=== PAUSE TestAccAWSIAMPolicy_disappears
=== RUN   TestAccAWSIAMPolicy_namePrefix
=== PAUSE TestAccAWSIAMPolicy_namePrefix
=== RUN   TestAccAWSIAMPolicy_path
=== PAUSE TestAccAWSIAMPolicy_path
=== RUN   TestAccAWSIAMPolicy_policy
=== PAUSE TestAccAWSIAMPolicy_policy
=== CONT  TestAccAWSIAMPolicy_basic
=== CONT  TestAccAWSIAMPolicy_path
=== CONT  TestAccAWSIAMPolicy_disappears
=== CONT  TestAccAWSIAMPolicy_namePrefix
=== CONT  TestAccAWSIAMPolicy_policy
=== CONT  TestAccAWSIAMPolicy_description
--- PASS: TestAccAWSIAMPolicy_disappears (21.67s)
--- PASS: TestAccAWSIAMPolicy_path (32.46s)
--- PASS: TestAccAWSIAMPolicy_namePrefix (32.50s)
--- PASS: TestAccAWSIAMPolicy_basic (32.52s)
--- PASS: TestAccAWSIAMPolicy_description (32.51s)
--- PASS: TestAccAWSIAMPolicy_policy (51.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	51.572s

@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/iam Issues and PRs that pertain to the iam service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 9, 2019
@bflad
Copy link
Contributor

bflad commented Jan 9, 2019

@kterada0509 can you explain what was fixed with this?

Fix Error handling at delete

The resource logic appears to be the same. As an aside, we'd prefer the original left aligned style over the nested style inside the conditional.

The additional test is definitely appreciated though. 👍

@bflad
Copy link
Contributor

bflad commented Jan 9, 2019

Ahh. Looking at #35 and the commit a few years ago that actually should've closed the original hashicorp/terraform issue: 38e096a

Its the %#v to %s formatting change for err. 💯 Assuming tests pass we'll get this in.

@bflad bflad added this to the v1.55.0 milestone Jan 9, 2019
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.

LGTM, thanks @kterada0509! 🚀

--- PASS: TestAccAWSIAMPolicy_disappears (5.39s)
--- PASS: TestAccAWSIAMPolicy_path (8.80s)
--- PASS: TestAccAWSIAMPolicy_description (8.86s)
--- PASS: TestAccAWSIAMPolicy_namePrefix (8.96s)
--- PASS: TestAccAWSIAMPolicy_basic (8.96s)
--- PASS: TestAccAWSIAMPolicy_policy (14.56s)

@bflad bflad merged commit e908e5d into hashicorp:master Jan 9, 2019
bflad added a commit that referenced this pull request Jan 9, 2019
@bflad
Copy link
Contributor

bflad commented Jan 10, 2019

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

@teraken0509 teraken0509 deleted the feature/fix-iam-policy-resource-error-handling branch March 5, 2020 14:06
@ghost
Copy link

ghost commented Mar 5, 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 Mar 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/iam Issues and PRs that pertain to the iam service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better logging on 403 of aws_iam_policy delete
2 participants