Skip to content

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

Closed
@ewbankkit

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugThis issue is a bug.p1This is a high priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions