You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "CfnInstance" Construct documentation[1] does not define how to specify 'MetaData' for the instance. And the "addMetadata(key, value)" construct can have only key-pair values while the instance metadata has to be quite large.
The solution that worked is using "addOverride" function:
As per Link[2] you can make use of "addOverride" function to add metadata to a 'CfnInstance' construct. An example[3] is as follows:
Kindly add a method in CDK "CfnInstance" construct to be able to add large metadata. this is apart from "addMetadata" method.
If the "addOverride" should be the only method then kindly update the documentation[1] and mention this as this is not properly documented and is a common usecase.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the issue
The "CfnInstance" Construct documentation[1] does not define how to specify 'MetaData' for the instance. And the "addMetadata(key, value)" construct can have only key-pair values while the instance metadata has to be quite large.
The solution that worked is using "addOverride" function:
As per Link[2] you can make use of "addOverride" function to add metadata to a 'CfnInstance' construct. An example[3] is as follows:
asgLaunchConfig.addOverride("Metadata", {
"AWS::CloudFormation::Init": {
"FOO": "BAR",
}
});
However ask from Service team:
[1] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnInstance.html
[2] https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnInstance.html#addwbrmetadatakey-value
[3] #5087
[4] #777
Links
NA
The text was updated successfully, but these errors were encountered: