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

r/aws_launch_template: Crash in TestAccEC2LaunchTemplate_licenseSpecification #24575

Closed
ewbankkit opened this issue May 5, 2022 · 3 comments · Fixed by #24579
Closed

r/aws_launch_template: Crash in TestAccEC2LaunchTemplate_licenseSpecification #24575

ewbankkit opened this issue May 5, 2022 · 3 comments · Fixed by #24579
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@ewbankkit
Copy link
Contributor

ewbankkit commented May 5, 2022

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

In nightly CI:

=== RUN   TestAccEC2LaunchTemplate_licenseSpecification
=== PAUSE TestAccEC2LaunchTemplate_licenseSpecification
=== CONT  TestAccEC2LaunchTemplate_licenseSpecification
------- Stderr: -------
panic: interface conversion: interface {} is *schema.Set, not []interface {}
goroutine 397 [running]:
github.com/hashicorp/terraform-provider-aws/internal/service/ec2.expandRequestLaunchTemplateData(0x96cfcde)
  /opt/teamcity-agent/work/87cd0779df5e20c9/internal/service/ec2/ec2_launch_template.go:983 +0x1c54
github.com/hashicorp/terraform-provider-aws/internal/service/ec2.resourceLaunchTemplateCreate(0x0, {0x82327a0, 0xc0005fca80})
  /opt/teamcity-agent/work/87cd0779df5e20c9/internal/service/ec2/ec2_launch_template.go:714 +0x1e7
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xa88abe0, {0xa88abe0, 0xc002154180}, 0xd, {0x82327a0, 0xc0005fca80})
  /var/lib/teamcity/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000b9ec40, {0xa88abe0, 0xc002154180}, 0xc001bbaa90, 0xc002170180, {0x82327a0, 0xc0005fca80})
  /var/lib/teamcity/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xc29
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00697c558, {0xa88ab38, 0xc0069e2980}, 0xc00213c5a0)
  /var/lib/teamcity/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc002e3e1e0, {0xa88abe0, 0xc00213fc50}, 0xc00208bea0)
  /var/lib/teamcity/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:812 +0x56b
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x9443e60, 0xc002e3e1e0}, {0xa88abe0, 0xc00213fc50}, 0xc002144300, 0x0)
  /var/lib/teamcity/go/pkg/mod/github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00195a700, {0xa99ae78, 0xc000eca1a0}, 0xc002150000, 0xc002b099b0, 0x10726a60, 0x0)
  /var/lib/teamcity/go/pkg/mod/google.golang.org/[email protected]/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc00195a700, {0xa99ae78, 0xc000eca1a0}, 0xc002150000, 0x0)
  /var/lib/teamcity/go/pkg/mod/google.golang.org/[email protected]/server.go:1619 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
  /var/lib/teamcity/go/pkg/mod/google.golang.org/[email protected]/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
  /var/lib/teamcity/go/pkg/mod/google.golang.org/[email protected]/server.go:919 +0x294

if v, ok := d.GetOk("license_specification"); ok && len(v.([]interface{})) > 0 {
apiObject.LicenseSpecifications = expandLaunchTemplateLicenseConfigurationRequests(v.([]interface{}))
}

@github-actions github-actions bot added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels May 5, 2022
@ewbankkit ewbankkit added the service/ec2 Issues and PRs that pertain to the ec2 service. label May 5, 2022
@ewbankkit
Copy link
Contributor Author

Prior to v4.6.0 (#23365) was:

if v, ok := d.GetOk("license_specification"); ok {
var licenseSpecifications []*ec2.LaunchTemplateLicenseConfigurationRequest
lsList := v.(*schema.Set).List()
for _, ls := range lsList {
if ls == nil {
continue
}
licenseSpecifications = append(licenseSpecifications, readLicenseSpecificationFromConfig(ls.(map[string]interface{})))
}
opts.LicenseSpecifications = licenseSpecifications
}

@github-actions
Copy link

github-actions bot commented May 5, 2022

This functionality has been released in v4.13.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 5, 2022

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 have found a problem that seems similar to this, 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 5, 2022
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. crash Results from or addresses a Terraform crash or kernel panic. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
1 participant