Open doublecompile opened 2 weeks ago
The proposed solution should generate CloudFormation template parameters like this working example:
Parameters:
ImageIdParam:
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
Default: arn:aws:ssm:us-east-1:123456789012:parameter/name/of/my/param
related to https://github.com/aws/aws-cdk/pull/30646
Is this something you want?
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
@pahud Yes, the pull request you linked will cover my use case. Thanks!
Describe the feature
As it stands today, the
StringParameter
class assumes parameter names given tofromStringParameterAttributes
are in the same account as the containing stack.Please introduce support for providing a pre-existing SSM Parameter Store parameter ARN to create an instance of
StringParameter
.Another acceptable implementation might be to add an
account
property to theStringParameterAttributes
interface and alter the logic insidefromStringParameterAttributes
to use the full ARN for theCfnParameter
default value.Use Case
SSM Parameter Store introduced cross-account sharing in February 2024. The linked post has the following excerpt:
This is my exact use case. I have a String Parameter whose data type is
aws:ec2:image
in account A. The parameter is shared with account B. I have a CloudFormation stack with a Launch Template in account B where I'd like to reference the parameter in account A.Proposed Solution
Add a new static method named
fromStringParameterArn
(or something similar) on theStringParameter
class. This new method should allow me to provide a full ARN for an SSM Parameter Store parameter that can be used in a CloudFormation stack in a different account.Other Information
No response
Acknowledgements
CDK version used
2.148.0
Environment details (OS name and version, etc.)
N/A