aws / aws-sdk-go-v2

AWS SDK for the Go programming language.
https://aws.github.io/aws-sdk-go-v2/docs/
Apache License 2.0
2.68k stars 651 forks source link

MIGRATION ISSUE: `imagebuilder.LaunchTemplateConfiguration.SetDefaultVersion` not sending `false` value #2734

Closed ewbankkit closed 1 month ago

ewbankkit commented 3 months ago

Pre-Migration Checklist

Go Version Used

go1.22.5

Describe the Migration Issue

If the bool SetDefaultVersion field of the imagebuilder.LaunchTemplateConfiguration structure is set to false, that value is not being serialized and sent to the AWS service. The means that it is impossible to update the value from true to false via v2 of the Go SDK.

Code Comparison

v1

    apiObject := &imagebuilder.LaunchTemplateConfiguration{}

    if v, ok := tfMap["launch_template_id"].(string); ok && v != "" {
        apiObject.LaunchTemplateId = aws.String(v)
    }

    if v, ok := tfMap["default"].(bool); ok {
        apiObject.SetDefaultVersion = aws.Bool(v)
    }

v2

    apiObject := &awstypes.LaunchTemplateConfiguration{}

    if v, ok := tfMap["launch_template_id"].(string); ok && v != "" {
        apiObject.LaunchTemplateId = aws.String(v)
    }

    if v, ok := tfMap["default"].(bool); ok {
        apiObject.SetDefaultVersion = v
    }

Observed Differences/Errors

v1

{"distributionConfigurationArn":"arn:aws:imagebuilder:us-west-2:...:distribution-configuration/ewbankkit-test-001","distributions":[{"launchTemplateConfigurations":[{"accountId":"...","launchTemplateId":"lt-00c9b21fbf4907bdb","setDefaultVersion":false}],"region":"us-west-2"}]}

v2

{"distributionConfigurationArn":"arn:aws:imagebuilder:us-west-2:...:distribution-configuration/ewbankkit-test-001","distributions":[{"launchTemplateConfigurations":[{"accountId":"...","launchTemplateId":"lt-00c9b21fbf4907bdb"}],"region":"us-west-2"}]}

Additional Context

No response

ewbankkit commented 3 months ago

Relates https://github.com/aws/aws-sdk/issues/736. Relates https://github.com/aws/aws-sdk-go-v2/issues/2162.

RanVaknin commented 3 months ago

Hi @ewbankkit ,

Thanks for raising this once again. I will re-raise this issue internally to see how we should go about fixing this.

Ran~

RanVaknin commented 3 months ago

We have an internal ticket with the ec2 service team.

V1479153907

Thanks, Ran~

codymaust commented 1 month ago

@RanVaknin has there been any recent update on this? thanks!

lucix-aws commented 1 month ago

I'm not waiting for the service team to deliberate. Will patch this locally as we did for #2250.

github-actions[bot] commented 1 month ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.