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

Using Ref for INT values #304

Open
jomast opened this issue Sep 14, 2020 · 1 comment
Open

Using Ref for INT values #304

jomast opened this issue Sep 14, 2020 · 1 comment

Comments

@jomast
Copy link

jomast commented Sep 14, 2020

As shown in the example below, ec2.Instance_BlockDeviceMapping.VolumeSize calls for an int value, but cloudformation.Ref returns a string. (in the example below, Ec2InstanceRootVolumeSize is the name of a parameter)

resources["Server"] = &ec2.Instance{
	BlockDeviceMappings: []ec2.Instance_BlockDeviceMapping{
		{
			DeviceName: "/dev/xvda",
			Ebs:        &ec2.Instance_Ebs{
			VolumeSize: cloudformation.Ref("Ec2InstanceRootVolumeSize"), // cannot assign string as int
			},
		},
	},
}

What is the recommended way to deal with this situation?

We make heavy use of parameters and I see this kind of situation coming up often.

@mheffner
Copy link
Contributor

Has there been any update or work around discovered for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants