-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 Provider Function]: arn_parse
and arn_build
#34952
Conversation
Community NoteVoting for Prioritization
For Submitters
|
The `arn_parse` and `arn_build` provider functions will allow practioners to easily handle ARN (Amazon Resource Name) manipulation with built-in functions. The `arn_parse` function provides similar utility to the `aws_arn` data source, but with the benefit of running earlier in the execution order.
Thank you for your contribution! 🚀 A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored. For additional information refer to the AWS SDK for Go Versions page in the contributor guide. |
This ensures the block is proper HCL and can be evaluated by tooling such as terrafmt.
This fork includes an updated `hashicorp/hcl/v2` dependency to support the provider defined function syntax. Once this update is merged into the upstream repository this commit can be reverted
With Terraform % go test -count=1 -v ./internal/function/...
--- PASS: TestARNParseFunction_invalid (0.88s)
--- PASS: TestARNBuildFunction_known (4.91s)
--- PASS: TestARNParseFunction_known (4.91s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/function 9.017s With Terraform % go test -count=1 -v ./internal/function/...
arn_parse_function_test.go:20: Terraform CLI version 1.7.4 is below minimum version 1.8.0-beta1: skipping test
--- SKIP: TestARNParseFunction_known (0.46s)
=== NAME TestARNBuildFunction_known
arn_build_function_test.go:18: Terraform CLI version 1.7.4 is below minimum version 1.8.0-beta1: skipping test
--- SKIP: TestARNBuildFunction_known (0.47s)
=== NAME TestARNParseFunction_invalid
arn_parse_function_test.go:40: Terraform CLI version 1.7.4 is below minimum version 1.8.0-beta1: skipping test
--- SKIP: TestARNParseFunction_invalid (0.48s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/function 4.578s |
Not a blocker: We need to add 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.
LGTM 🚀.
% go test -count=1 -v ./internal/function/...
=== RUN TestARNBuildFunction_known
=== PAUSE TestARNBuildFunction_known
=== RUN TestARNParseFunction_known
=== PAUSE TestARNParseFunction_known
=== RUN TestARNParseFunction_invalid
=== PAUSE TestARNParseFunction_invalid
=== CONT TestARNBuildFunction_known
=== CONT TestARNParseFunction_known
=== CONT TestARNParseFunction_invalid
arn_parse_function_test.go:40: Terraform CLI version 1.0.11 is below minimum version 1.8.0-beta1: skipping test
=== NAME TestARNBuildFunction_known
arn_build_function_test.go:18: Terraform CLI version 1.0.11 is below minimum version 1.8.0-beta1: skipping test
=== NAME TestARNParseFunction_known
arn_parse_function_test.go:20: Terraform CLI version 1.0.11 is below minimum version 1.8.0-beta1: skipping test
--- SKIP: TestARNParseFunction_invalid (0.50s)
--- SKIP: TestARNBuildFunction_known (0.50s)
--- SKIP: TestARNParseFunction_known (0.50s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/function 7.893s
% go test -count=1 -v ./internal/function/...
=== RUN TestARNBuildFunction_known
=== PAUSE TestARNBuildFunction_known
=== RUN TestARNParseFunction_known
=== PAUSE TestARNParseFunction_known
=== RUN TestARNParseFunction_invalid
=== PAUSE TestARNParseFunction_invalid
=== CONT TestARNBuildFunction_known
=== CONT TestARNParseFunction_invalid
=== CONT TestARNParseFunction_known
--- PASS: TestARNParseFunction_invalid (1.70s)
--- PASS: TestARNBuildFunction_known (8.16s)
--- PASS: TestARNParseFunction_known (8.22s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/function 15.317s
This functionality has been released in v5.40.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. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
The
arn_parse
andarn_build
provider functions will allow practioners to handle ARN (Amazon Resource Name) manipulation with built-in provider functions. Thearn_parse
function provides similar utility to theaws_arn
data source, but with the benefit of running earlier in the execution order.Relations
References
Output from Acceptance Testing