I'm attempting to create an AWS image builder dis...
# aws
s
I'm attempting to create an AWS image builder distribution. In the documentation, the ami distribution configuration name is supposed to have '{{ imagebuilder:buildDate }}' in the string so they can inject build dates into image names. With python I'm wrapping in doubled up braces. The print looks like it should. It is a literal 'stig-2025-{{ imagebuilder:buildDate }}' string. Then to be doubly sure of what the contents look like when assigned to the dictionary that the resource requires, the distribution dictionary is separate, followed by another print from the dictionary value. The second print looks as intended also. But then in aws, it has cut the string to be 'stig-2025-{{' as though something is destroying the string in the provider. Python:
Copy code
ami_output_name = f'stig-2025-{{{{ imagebuilder:buildDate }}}}'
print(ami_output_name)

distribution = {
	"region": "us-gov-west-1",
	"ami_distribution_configuration": {
		"ami_tags": {
			"string": "string"
		},
		"description": "us-gov-west-1",
		#"kms_key_id": "string",
		"launch_permission": {
			"organization_arns": ["arn:aws-us-gov:organizations::012345678901:organization/o-asdfasdf"]
		},
		"name": ami_output_name
	}
}

print(distribution["ami_distribution_configuration"]["name"])

distribution_configuration_resource = aws.imagebuilder.DistributionConfiguration(
	f"{self.name}-ib-distribution",
	distributions=[
		distribution
	],
	description="govcloud stig image",
	name="gov-stig",
	tags={
		"string": "string",
	},
	opts=pulumi.ResourceOptions(provider=self.pulumi_opts.provider)
)
q
Could you check in AWS CloudTrail, what parameters are sent with the
CreateDistributionConfiguration
API call?
s
It is "name": "govcloud-stig1-{{ imagebuilder:buildDate }}" in the cloudtrail log. It must be an AWS ui bug then. Thanks!