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_launch_template: Change 'network_interfaces.delete_on_termination' to TypeString, matching associated resource #14599

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Aug 12, 2020

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 #14597.

Release note for CHANGELOG:

data-source/aws_launch_template: Fix error with `delete_on_termination` attribute of `network_interfaces` block

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSLaunchTemplateDataSource_' 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLaunchTemplateDataSource_ -timeout 120m
=== RUN   TestAccAWSLaunchTemplateDataSource_basic
=== PAUSE TestAccAWSLaunchTemplateDataSource_basic
=== RUN   TestAccAWSLaunchTemplateDataSource_filter_basic
=== PAUSE TestAccAWSLaunchTemplateDataSource_filter_basic
=== RUN   TestAccAWSLaunchTemplateDataSource_filter_tags
=== PAUSE TestAccAWSLaunchTemplateDataSource_filter_tags
=== RUN   TestAccAWSLaunchTemplateDataSource_metadataOptions
=== PAUSE TestAccAWSLaunchTemplateDataSource_metadataOptions
=== RUN   TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== PAUSE TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== RUN   TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== PAUSE TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== RUN   TestAccAWSLaunchTemplateDataSource_NonExistent
=== PAUSE TestAccAWSLaunchTemplateDataSource_NonExistent
=== CONT  TestAccAWSLaunchTemplateDataSource_basic
=== CONT  TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== CONT  TestAccAWSLaunchTemplateDataSource_metadataOptions
=== CONT  TestAccAWSLaunchTemplateDataSource_filter_tags
=== CONT  TestAccAWSLaunchTemplateDataSource_filter_basic
=== CONT  TestAccAWSLaunchTemplateDataSource_NonExistent
=== CONT  TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
--- PASS: TestAccAWSLaunchTemplateDataSource_NonExistent (5.71s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_tags (32.77s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_basic (32.93s)
--- PASS: TestAccAWSLaunchTemplateDataSource_basic (33.17s)
--- PASS: TestAccAWSLaunchTemplateDataSource_metadataOptions (33.21s)
--- PASS: TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress (63.82s)
--- PASS: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (64.17s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	64.211s

…kInterfaces_deleteOnTermination'.

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination -timeout 120m
=== RUN   TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== PAUSE TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== CONT  TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
panic: network_interfaces.0.delete_on_termination: '' expected type 'bool', got unconvertible type 'string'

goroutine 240 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc0015c9b80, 0x669fe8d, 0x12, 0x52807e0, 0xc000f72b20, 0x1, 0x0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:188 +0x388
github.com/terraform-providers/terraform-provider-aws/aws.dataSourceAwsLaunchTemplateRead(0xc0015c9b80, 0x5aba8c0, 0xc0005d1900, 0xb0afa40, 0x6a9c0c0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/aws/data_source_aws_launch_template.go:505 +0x1d7b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0002578c0, 0x75c4980, 0xc00123b440, 0xc0015c9b80, 0x5aba8c0, 0xc0005d1900, 0x0, 0x0, 0x0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:281 +0x88
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0002578c0, 0x75c4980, 0xc00123b440, 0xc001277920, 0x5aba8c0, 0xc0005d1900, 0xc0005d1900, 0xc001277920, 0x0, 0x0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:489 +0xff
github.com/hashicorp/terraform-plugin-sdk/v2/internal/helper/plugin.(*GRPCProviderServer).ReadDataSource(0xc000e512c0, 0x75c4980, 0xc00123b440, 0xc00123b3c0, 0xc000e512c0, 0xc000e512d0, 0x6a9c0b0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/helper/plugin/grpc_provider.go:1102 +0x4c5
github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5._Provider_ReadDataSource_Handler.func1(0x75c4980, 0xc00123b440, 0x6402b40, 0xc00123b3c0, 0xc00123b440, 0x5c30d40, 0xc000c35401, 0xc001277420)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5/tfplugin5.pb.go:3348 +0x86
github.com/hashicorp/terraform-plugin-sdk/v2/plugin.Serve.func3.1(0x75c4a40, 0xc001168570, 0x6402b40, 0xc00123b3c0, 0xc001277400, 0xc001277420, 0xc001507ba0, 0x5094d8, 0x62c05e0, 0xc001168570)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/plugin/serve.go:76 +0x87
github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5._Provider_ReadDataSource_Handler(0x6532a80, 0xc000e512c0, 0x75c4a40, 0xc001168570, 0xc000c354a0, 0xc000e51460, 0x75c4a40, 0xc001168570, 0xc00151e900, 0x229)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/tfplugin5/tfplugin5.pb.go:3350 +0x14b
google.golang.org/grpc.(*Server).processUnaryRPC(0xc001264000, 0x75eb5c0, 0xc00104e600, 0xc00137b300, 0xc00181cc90, 0xb05c0b0, 0x0, 0x0, 0x0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:1171 +0x50a
google.golang.org/grpc.(*Server).handleStream(0xc001264000, 0x75eb5c0, 0xc00104e600, 0xc00137b300, 0x0)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:1494 +0xccd
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000f7e300, 0xc001264000, 0x75eb5c0, 0xc00104e600, 0xc00137b300)
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:834 +0xa1
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/home/kit/wrk/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:832 +0x204
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	8.065s
FAIL
GNUmakefile:26: recipe for target 'testacc' failed
make: *** [testacc] Error 1
…on' to TypeString, matching associated resource.

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination -timeout 120m
=== RUN   TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== PAUSE TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== CONT  TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
--- PASS: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (44.91s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	44.948s
@ewbankkit ewbankkit requested a review from a team August 12, 2020 11:59
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Aug 12, 2020
@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. labels Aug 12, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for this fix @ewbankkit!

Output of acceptance tests:

--- PASS: TestAccAWSLaunchTemplateDataSource_NonExistent (4.10s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_basic (16.44s)
--- PASS: TestAccAWSLaunchTemplateDataSource_metadataOptions (16.52s)
--- PASS: TestAccAWSLaunchTemplateDataSource_basic (16.75s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_tags (17.04s)
--- PASS: TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress (42.30s)
--- PASS: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (42.30s)

Noting similar rationale to merge this PR as #12936 (comment)

@anGie44 anGie44 merged commit a720950 into hashicorp:master Aug 12, 2020
@anGie44 anGie44 added this to the v3.2.0 milestone Aug 12, 2020
anGie44 added a commit that referenced this pull request Aug 12, 2020
@ewbankkit ewbankkit deleted the b-aws_launch_template-data-source-mismatched-schema branch August 12, 2020 18:51
@ghost
Copy link

ghost commented Aug 14, 2020

This has been released in version 3.2.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 for triage. Thanks!

@ghost
Copy link

ghost commented Sep 12, 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 Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ec2 Issues and PRs that pertain to the ec2 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.

aws_launch_template data source error setting network_interfaces for version 3.x
3 participants