-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(CfnInstance) #25884
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
documentation
This is a problem with documentation.
Comments
sonaliks
added
documentation
This is a problem with documentation.
needs-triage
This issue or PR still needs to be triaged.
labels
Jun 7, 2023
github-actions
bot
added
the
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
label
Jun 7, 2023
dup #25885 |
|
This was referenced Jul 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
documentation
This is a problem with documentation.
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: