fix(ssm): AWS::EC2::Image::Id parameter type#4161
Conversation
|
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
The types are only used by and inside CloudFormation, right? And they would not apply if you specify a What kind of behavior does the type cause? What are the advantages of specifying it? |
|
I frankly have no idea, sorry 😄 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
| const SECURE_STRING_PARAM_TYPE = 'SecureString'; | ||
| const STRINGLIST_PARAM_TYPE = 'StringList'; | ||
| export enum ParameterType { | ||
| STRING = 'String', |
There was a problem hiding this comment.
add documentation to each one (paste from AWS docs)
There was a problem hiding this comment.
I couldn't find a proper documentation page describing the types, but I pieced something together
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request is now being automatically merged. |
* fix(ssm): AWS::EC2::Image::Id parameter type * fix: additional test fixes * fix: EcsOptimizedImage type * chore: refactor ParameterType * chore: ParameterType documentation * chore: fix new test
|
Sorry to complain about this, but I would like to get back to the following exchange:
Why are we doing this change then? |
|
I looked around when I made the PR for explicit documentation about this use-case, but couldn't find it. What I got is:
If anyone has a better idea, feel free to share. |
…ype (#16884) Fixes #16806. Now, setting `type: ssm.ParameterType.AWS_EC2_IMAGE_ID` throws an error and instead, you can set `dataType: 'aws:ec2:image'`. Specifically, the `ssm.ParameterType.AWS_EC2_IMAGE_ID` value is used internally (original [PR](#4161)) in a few places and really shouldn't be exposed to the customer. But I'm not sure what else we can do, especially since this is a stable module. Original code using `CfnParameter`: ```ts const parameter = ssm.CfnParameter(this, "ImageBuilderAMI", { type: "String", dataType: "aws:ec2:image", name: "/ec2-imagebuilder/latest", description: "Latest AMI Image", value: self.node.try_get_context(env_context)["LinuxAmi"] }); ``` Can now use `StringParameter`: ```ts const parameter = ssm.StringParameter(this, 'ImageBuilderAMI', { dataType: 'aws:ec2:image', parameterName: '/ec2-imagebuilder/latest', description: "Latest AMI Image", stringValue: self.node.try_get_context(env_context)["LinuxAmi"] }); ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…ype (aws#16884) Fixes aws#16806. Now, setting `type: ssm.ParameterType.AWS_EC2_IMAGE_ID` throws an error and instead, you can set `dataType: 'aws:ec2:image'`. Specifically, the `ssm.ParameterType.AWS_EC2_IMAGE_ID` value is used internally (original [PR](aws#4161)) in a few places and really shouldn't be exposed to the customer. But I'm not sure what else we can do, especially since this is a stable module. Original code using `CfnParameter`: ```ts const parameter = ssm.CfnParameter(this, "ImageBuilderAMI", { type: "String", dataType: "aws:ec2:image", name: "/ec2-imagebuilder/latest", description: "Latest AMI Image", value: self.node.try_get_context(env_context)["LinuxAmi"] }); ``` Can now use `StringParameter`: ```ts const parameter = ssm.StringParameter(this, 'ImageBuilderAMI', { dataType: 'aws:ec2:image', parameterName: '/ec2-imagebuilder/latest', description: "Latest AMI Image", stringValue: self.node.try_get_context(env_context)["LinuxAmi"] }); ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
AWS::EC2::Image::IdSSM type for AMI resolved imagesvalueForTypedStringParametermethod to allow this overrideFixes #4013
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license