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

(CfnInstance) #25884

Closed
sonaliks opened this issue Jun 7, 2023 · 2 comments
Closed

(CfnInstance) #25884

sonaliks opened this issue Jun 7, 2023 · 2 comments
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud documentation This is a problem with documentation.

Comments

@sonaliks
Copy link

sonaliks commented Jun 7, 2023

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. Kindly add a method in CDK "CfnInstance" construct to be able to add large metadata. this is apart from "addMetadata" method.
  2. 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.

[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

@sonaliks 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 github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jun 7, 2023
@pahud
Copy link
Contributor

pahud commented Jun 7, 2023

dup #25885

@pahud pahud closed this as completed Jun 7, 2023
@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Jun 7, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

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.

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.
Projects
None yet
Development

No branches or pull requests

2 participants