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

[Bug]: aws_imagebuilder_image_recipe data source cannot set block_device_mapping.0.ebs.0.delete_on_termination value #39927

Closed
omerakcasbp opened this issue Oct 29, 2024 · 5 comments · Fixed by #39928
Assignees
Labels
bug Addresses a defect in current functionality. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Milestone

Comments

@omerakcasbp
Copy link

Terraform Core Version

1.6.2

AWS Provider Version

5.73.0

Affected Resource(s)

aws_imagebuilder_image_recipe data source

Expected Behavior

Image recipe data source select ebs delete_on_termination correctly.

Actual Behavior

Data source cannot set block_device_mapping.0.ebs.0.delete_on_termination value on state with error

block_device_mapping.0.ebs.0.delete_on_termination: '' expected type 'bool', got unconvertible type 'string', value: 'true'

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

data "aws_imagebuilder_image_recipes" "recipes" {
owner = "Self"
}

data "aws_imagebuilder_image_recipe" "recipes" {
for_each = data.aws_imagebuilder_image_recipes.recipes.arns
arn = each.value
}

Steps to Reproduce

  1. Create multiple image recipes
  2. Get them with aws_imagebuilder_image_recipes resource
  3. Foreach gathered arns from step 2 for resource aws_imagebuilder_image_recipe
  4. Run a plan

Debug Output

2024-10-29T14:23:49.935Z [DEBUG] provider.terraform-provider-aws_v5.73.0_x5: HTTP Response Received: @module=aws http.response.header.access_control_allow_origin="*" http.status_code=200 tf_aws.sdk=aws-sdk-go-v2 tf_rpc=ReadDataSource http.response.header.date="Tue, 29 Oct 2024 14:23:49 GMT" tf_data_source_type=aws_imagebuilder_image_recipe tf_req_id=be8f0d5d-a605-a7c6-d1c9-13a6ed109215 http.response.header.access_control_allow_methods=GET http.response.header.x_amzn_trace_id=Root=1-6720eff5-0508cb33ae1bf61a3735f079;Parent=00102dc722112f02;Sampled=0;Lineage=1:72baff13:0 tf_mux_provider="*schema.GRPCProviderServer" http.response.header.content_type=application/json http.response_content_length=1467 http.response.header.x_amz_apigw_id=XXXXX rpc.system=aws-api http.response.header.x_amzn_requestid=XXXXX rpc.method=GetImageRecipe rpc.service=imagebuilder tf_provider_addr=registry.terraform.io/hashicorp/aws http.response.header.access_control_allow_headers="Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-Content-Sha256,X-Amz-User-Agent,amz-sdk-invocation-id,amz-sdk-request" tf_aws.signing_region="" @caller=github.com/hashicorp/aws-sdk-go-base/[email protected]/logging/tf_logger.go:45 http.duration=145
http.response.body=
| {
|   "imageRecipe" : {
|     "arn" : "arn:aws:imagebuilder:XXX-1:XXXXX",
|     "name" : "XXXX",
|     "platform" : "Windows",
|     "owner" : "XXXXX",
|     "version" : "1.0.2",
|     "components" : [ {
|       "componentArn" : "arn:aws:imagebuilder:XXXXXXXX:component/XXXXX/1.0.2/1"
|     }, {
|       "componentArn" : "arn:aws:imagebuilder:XXXXX:aws:component/XXXX/x.x.x"
|     }, {
|       "componentArn" : "arn:aws:imagebuilder:XXXX:XXXXX:component/XXXX/1.0.0/1"
|     } ],
|     "parentImage" : "arn:aws:imagebuilder:XXX",
|     "blockDeviceMappings" : [ {
|       "deviceName" : "/dev/sda1",
|       "ebs" : {
|         "encrypted" : true,
|         "deleteOnTermination" : true,
|         "kmsKeyId" : "XXXXX",
|         "volumeSize" : 30,
|         "volumeType" : "gp3"
|       }
|     } ],
|     "workingDirectory" : "/var/tmp"
|   },
|   "requestId" : "3a17aa5b-ba2c-41da-836f-41a9cc140253"
| }
timestamp=2024-10-29T14:23:49.934Z
2024-10-29T14:23:49.935Z [ERROR] provider.terraform-provider-aws_v5.73.0_x5: [ERROR] setting state: block_device_mapping.0.ebs.0.delete_on_termination: '' expected type 'bool', got unconvertible type 'string', value: 'true'
2024-10-29T14:23:49.935Z [ERROR] provider.terraform-provider-aws_v5.73.0_x5: Response contains error diagnostic: tf_proto_version=5.6 diagnostic_severity=ERROR tf_req_id=be8f0d5d-a605-a7c6-d1c9-13a6ed109215 diagnostic_detail="" tf_data_source_type=aws_imagebuilder_image_recipe tf_provider_addr=registry.terraform.io/hashicorp/aws @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_summary="setting block_device_mapping: block_device_mapping.0.ebs.0.delete_on_termination: '' expected type 'bool', got unconvertible type 'string', value: 'true'" tf_rpc=ReadDataSource @module=sdk.proto timestamp=2024-10-29T14:23:49.935Z
2024-10-29T14:23:49.935Z [ERROR] vertex "data.aws_imagebuilder_image_recipe.recipes[\"arn:aws:imagebuilder:XXXX:XXXXX:image-recipe/XXXXX/1.0.2\"]" error: setting block_device_mapping: block_device_mapping.0.ebs.0.delete_on_termination: '' expected type 'bool', got unconvertible type 'string', value: 'true'

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@omerakcasbp omerakcasbp added the bug Addresses a defect in current functionality. label Oct 29, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/imagebuilder Issues and PRs that pertain to the imagebuilder service. needs-triage Waiting for first response or review from a maintainer. labels Oct 29, 2024
@omerakcasbp omerakcasbp changed the title [Bug]: [Bug]: aws_imagebuilder_image_recipe cannot set block_device_mapping.0.ebs.0.delete_on_termination value Oct 29, 2024
@omerakcasbp omerakcasbp changed the title [Bug]: aws_imagebuilder_image_recipe cannot set block_device_mapping.0.ebs.0.delete_on_termination value [Bug]: aws_imagebuilder_image_recipe data source cannot set block_device_mapping.0.ebs.0.delete_on_termination value Oct 29, 2024
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Oct 29, 2024
@ewbankkit ewbankkit self-assigned this Oct 29, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 29, 2024
@ewbankkit
Copy link
Contributor

Resource

"ebs": {
Type: schema.TypeList,
Optional: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
names.AttrDeleteOnTermination: {
Type: nullable.TypeNullableBool,
Optional: true,
ForceNew: true,
DiffSuppressFunc: nullable.DiffSuppressNullableBool,
ValidateFunc: nullable.ValidateTypeStringNullableBool,
},

Data source

"ebs": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
names.AttrDeleteOnTermination: {
Type: schema.TypeBool,
Computed: true,
},

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.74.0 milestone Oct 29, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 31, 2024
Copy link

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

Copy link

github-actions bot commented Dec 2, 2024

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 Dec 2, 2024
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. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Projects
None yet
2 participants