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

Ignore/Fix and Enable awsproviderlint AWSAT005 Hardcoded partition in ARN #15662

Closed
69 tasks done
YakDriver opened this issue Oct 15, 2020 · 3 comments · Fixed by #15751
Closed
69 tasks done

Ignore/Fix and Enable awsproviderlint AWSAT005 Hardcoded partition in ARN #15662

YakDriver opened this issue Oct 15, 2020 · 3 comments · Fixed by #15751
Assignees
Labels
linter Pertains to changes to or issues with the various linters. partition/aws-us-gov Pertains to the aws-us-gov partition. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@YakDriver
Copy link
Member

YakDriver commented Oct 15, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The AWSAT005 analyzer reports hardcoded AWS partitions in ARNs. For tests to work across AWS partitions, the partitions should not be hardcoded.

Run the linter locally:

% go install github.com/terraform-providers/terraform-provider-aws/awsproviderlint
go: finding module for package github.com/terraform-providers/terraform-provider-aws/awsproviderlint
go: downloading github.com/terraform-providers/terraform-provider-aws/awsproviderlint v0.0.0-20201014223354-b485d38053e4
go: found github.com/terraform-providers/terraform-provider-aws/awsproviderlint in github.com/terraform-providers/terraform-provider-aws/awsproviderlint v0.0.0-20201014223354-b485d38053e4
% awsproviderlint -AWSAT005 ./aws
/Volumes/develop/go/src/github.com/terraform-providers/terraform-provider-aws/aws/validators_test.go:2562:14: AWSAT005: avoid hardcoded ARN AWS partitions, use aws_partition data source
/Volumes/develop/go/src/github.com/terraform-providers/terraform-provider-aws/aws/validators_test.go:2570:14: AWSAT005: avoid hardcoded ARN AWS partitions, use aws_partition data source
...

Existing Reports

Definition of Done

  • Preferably fix or otherwise ignore existing reports
  • AWSAT005 check added to Makefile awsproviderlint target and CI passes

References

@YakDriver YakDriver added enhancement Requests to existing resources that expand the functionality or scope. partition/aws-us-gov Pertains to the aws-us-gov partition. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. help wanted and removed enhancement Requests to existing resources that expand the functionality or scope. labels Oct 15, 2020
@piotrzarycki
Copy link

i am interested :)

@YakDriver
Copy link
Member Author

@piotrzarycki Thanks! There are lots to do. Check the existing PRs for a pattern of how to fix these. If you want, give resource_aws_shield_protection_test.go a try. I'm not sure of your experience - if you're new to this, check out this article for help getting started.

This was referenced Oct 20, 2020
@breathingdust breathingdust added the linter Pertains to changes to or issues with the various linters. label Oct 27, 2020
@ghost
Copy link

ghost commented Nov 28, 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 as resolved and limited conversation to collaborators Nov 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. partition/aws-us-gov Pertains to the aws-us-gov partition. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants