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

d/aws_cloudfront_response_headers_policy: Add missing items level in custom_headers_config block #21838

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Nov 18, 2021

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

Closes #21832.

Output from acceptance testing:

% make testacc PKG_NAME=internal/service/cloudfront TESTARGS='-run=TestAccCloudFrontResponseHeadersPolicyDataSource_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudfront/... -v -count 1 -parallel 20 -run=TestAccCloudFrontResponseHeadersPolicyDataSource_ -timeout 180m
=== RUN   TestAccCloudFrontResponseHeadersPolicyDataSource_basic
=== PAUSE TestAccCloudFrontResponseHeadersPolicyDataSource_basic
=== CONT  TestAccCloudFrontResponseHeadersPolicyDataSource_basic
--- PASS: TestAccCloudFrontResponseHeadersPolicyDataSource_basic (13.23s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront	16.788s

Previously:

% make testacc PKG_NAME=internal/service/cloudfront TESTARGS='-run=TestAccCloudFrontResponseHeadersPolicyDataSource_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudfront/... -v -count 1 -parallel 20 -run=TestAccCloudFrontResponseHeadersPolicyDataSource_ -timeout 180m
=== RUN   TestAccCloudFrontResponseHeadersPolicyDataSource_basic
=== PAUSE TestAccCloudFrontResponseHeadersPolicyDataSource_basic
=== CONT  TestAccCloudFrontResponseHeadersPolicyDataSource_basic
panic: Invalid address to set: []string{"custom_headers_config", "0", "items"}

goroutine 337 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc00203d500, 0x9d596e1, 0x15, 0x7d50120, 0xc00176bd58, 0x0, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/gdavison/terraform-plugin-sdk/v2@v2.7.1-0.20210913224932-c7c2dbd9e010/helper/schema/resource_data.go:230 +0x371
github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront.dataSourceResponseHeadersPolicyRead(0xc00203d500, 0x8a83960, 0xc0002a3600, 0xf5f2440, 0xf5c25e0)
	/Users/ewbankkit/altsrc/github.com/terraform-providers/terraform-provider-aws/internal/service/cloudfront/response_headers_policy_data_source.go:303 +0x475
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc00033f500, 0xac4a428, 0xc000710940, 0xc00203d500, 0x8a83960, 0xc0002a3600, 0x0, 0x0, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/gdavison/terraform-plugin-sdk/v2@v2.7.1-0.20210913224932-c7c2dbd9e010/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc00033f500, 0xac4a428, 0xc000710940, 0xc00145b040, 0x8a83960, 0xc0002a3600, 0xc0002a3600, 0xc00145b040, 0x0, 0x0)
	/Users/ewbankkit/go/pkg/mod/github.com/gdavison/terraform-plugin-sdk/v2@v2.7.1-0.20210913224932-c7c2dbd9e010/helper/schema/resource.go:558 +0xfd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc00286e168, 0xac4a428, 0xc000710940, 0xc00145ada0, 0xc000710940, 0x100d725, 0x969ffc0)
	/Users/ewbankkit/go/pkg/mod/github.com/gdavison/terraform-plugin-sdk/v2@v2.7.1-0.20210913224932-c7c2dbd9e010/helper/schema/grpc_provider.go:1105 +0x4d6
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadDataSource(0xc000476140, 0xac4a4d0, 0xc000710940, 0xc001784a00, 0xc000476140, 0xc0019d6000, 0xc002016ba0)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.3.0/tfprotov5/server/server.go:247 +0xe5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0x9a644c0, 0xc000476140, 0xac4a4d0, 0xc0019d6000, 0xc002790240, 0x0, 0xac4a4d0, 0xc0019d6000, 0xc00140e580, 0xad)
	/Users/ewbankkit/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.3.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00082c540, 0xac761b8, 0xc0022c8900, 0xc00003ac00, 0xc002870720, 0xf5af530, 0x0, 0x0, 0x0)
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc00082c540, 0xac761b8, 0xc0022c8900, 0xc00003ac00, 0x0)
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc001708e40, 0xc00082c540, 0xac761b8, 0xc0022c8900, 0xc00003ac00)
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/Users/ewbankkit/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront	8.702s
FAIL
make: *** [testacc] Error 1

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. service/cloudfront Issues and PRs that pertain to the cloudfront service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 18, 2021
@zhelding
Copy link
Contributor

LGTM! 🚀

@ewbankkit ewbankkit merged commit 162aa32 into main Nov 18, 2021
@ewbankkit ewbankkit deleted the b-aws_cloudfront_response_headers_policy-data-source.custom_headers_config branch November 18, 2021 22:04
@github-actions github-actions bot added this to the v3.66.0 milestone Nov 18, 2021
@github-actions
Copy link

This functionality has been released in v3.66.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!

@github-actions
Copy link

github-actions bot commented Jun 9, 2022

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/cloudfront Issues and PRs that pertain to the cloudfront 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.

Cannot get aws_cloudfront_response_headers_policy data source with custom headers
2 participants