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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for policy name existance for new resource #7978

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

teraken0509
Copy link
Contributor

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #7939

Changes proposed in this pull request:

  • Add check policy name duplication when create new resource

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSIAMRolePolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSIAMRolePolicy_ -timeout 120m
=== RUN   TestAccAWSIAMRolePolicy_importBasic
=== PAUSE TestAccAWSIAMRolePolicy_importBasic
=== RUN   TestAccAWSIAMRolePolicy_basic
=== PAUSE TestAccAWSIAMRolePolicy_basic
=== RUN   TestAccAWSIAMRolePolicy_disappears
=== PAUSE TestAccAWSIAMRolePolicy_disappears
=== RUN   TestAccAWSIAMRolePolicy_namePrefix
=== PAUSE TestAccAWSIAMRolePolicy_namePrefix
=== RUN   TestAccAWSIAMRolePolicy_generatedName
=== PAUSE TestAccAWSIAMRolePolicy_generatedName
=== RUN   TestAccAWSIAMRolePolicy_duplicatePolicyName
=== PAUSE TestAccAWSIAMRolePolicy_duplicatePolicyName
=== RUN   TestAccAWSIAMRolePolicy_invalidJSON
=== PAUSE TestAccAWSIAMRolePolicy_invalidJSON
=== CONT  TestAccAWSIAMRolePolicy_importBasic
=== CONT  TestAccAWSIAMRolePolicy_generatedName
=== CONT  TestAccAWSIAMRolePolicy_disappears
=== CONT  TestAccAWSIAMRolePolicy_namePrefix
=== CONT  TestAccAWSIAMRolePolicy_basic
=== CONT  TestAccAWSIAMRolePolicy_invalidJSON
=== CONT  TestAccAWSIAMRolePolicy_duplicatePolicyName
--- PASS: TestAccAWSIAMRolePolicy_invalidJSON (8.47s)
--- PASS: TestAccAWSIAMRolePolicy_disappears (41.59s)
--- PASS: TestAccAWSIAMRolePolicy_importBasic (48.03s)
--- PASS: TestAccAWSIAMRolePolicy_duplicatePolicyName (54.76s)
--- PASS: TestAccAWSIAMRolePolicy_namePrefix (68.21s)
--- PASS: TestAccAWSIAMRolePolicy_generatedName (68.88s)
--- PASS: TestAccAWSIAMRolePolicy_basic (69.68s)
PASS
ok  	github.com/terraform-providers/tmp-terraform-provider-aws/aws	69.747s

@ghost ghost added size/M 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 Mar 17, 2019
@aeschright aeschright requested a review from a team June 26, 2019 00:51
@teraken0509 teraken0509 force-pushed the feature/add-validation-attribute-name-for-aws_iam_role_policy branch from b684158 to deede42 Compare January 16, 2020 07:08
@teraken0509
Copy link
Contributor Author

Re-run acctest.

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSIAMRolePolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSIAMRolePolicy_ -timeout 120m
=== RUN   TestAccAWSIAMRolePolicy_basic
=== PAUSE TestAccAWSIAMRolePolicy_basic
=== RUN   TestAccAWSIAMRolePolicy_disappears
=== PAUSE TestAccAWSIAMRolePolicy_disappears
=== RUN   TestAccAWSIAMRolePolicy_namePrefix
=== PAUSE TestAccAWSIAMRolePolicy_namePrefix
=== RUN   TestAccAWSIAMRolePolicy_generatedName
=== PAUSE TestAccAWSIAMRolePolicy_generatedName
=== RUN   TestAccAWSIAMRolePolicy_duplicatePolicyName
=== PAUSE TestAccAWSIAMRolePolicy_duplicatePolicyName
=== RUN   TestAccAWSIAMRolePolicy_invalidJSON
=== PAUSE TestAccAWSIAMRolePolicy_invalidJSON
=== RUN   TestAccAWSIAMRolePolicy_Policy_InvalidResource
=== PAUSE TestAccAWSIAMRolePolicy_Policy_InvalidResource
=== CONT  TestAccAWSIAMRolePolicy_basic
=== CONT  TestAccAWSIAMRolePolicy_duplicatePolicyName
=== CONT  TestAccAWSIAMRolePolicy_Policy_InvalidResource
=== CONT  TestAccAWSIAMRolePolicy_invalidJSON
=== CONT  TestAccAWSIAMRolePolicy_namePrefix
=== CONT  TestAccAWSIAMRolePolicy_generatedName
=== CONT  TestAccAWSIAMRolePolicy_disappears
--- PASS: TestAccAWSIAMRolePolicy_invalidJSON (4.79s)
--- PASS: TestAccAWSIAMRolePolicy_Policy_InvalidResource (24.19s)
--- PASS: TestAccAWSIAMRolePolicy_disappears (37.83s)
--- PASS: TestAccAWSIAMRolePolicy_duplicatePolicyName (51.37s)
--- PASS: TestAccAWSIAMRolePolicy_generatedName (70.16s)
--- PASS: TestAccAWSIAMRolePolicy_namePrefix (71.40s)
--- PASS: TestAccAWSIAMRolePolicy_basic (71.68s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	71.789s

@wkoszek
Copy link

wkoszek commented Nov 11, 2020

馃憤馃徔

Base automatically changed from master to main January 23, 2021 00:55
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:55
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/iam Issues and PRs that pertain to the iam service. size/M 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.

aws_iam_role_policy should validate "attribute name" collisions
3 participants