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

aws-ssm: Allow creating parameters from a full ARN #30790

Closed
2 tasks
doublecompile opened this issue Jul 8, 2024 · 6 comments
Closed
2 tasks

aws-ssm: Allow creating parameters from a full ARN #30790

doublecompile opened this issue Jul 8, 2024 · 6 comments
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager feature-request A feature should be added or improved. p2

Comments

@doublecompile
Copy link

doublecompile commented Jul 8, 2024

Describe the feature

As it stands today, the StringParameter class assumes parameter names given to fromStringParameterAttributes 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 the StringParameterAttributes interface and alter the logic inside fromStringParameterAttributes to use the full ARN for the CfnParameter default value.

Use Case

SSM Parameter Store introduced cross-account sharing in February 2024. The linked post has the following excerpt:

You can use central AWS accounts to share parameters for many cross-account scenarios, such as referencing centrally managed “golden” AMI IDs in EC2 Launch Templates for autoscaling

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 the StringParameter 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

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.148.0

Environment details (OS name and version, etc.)

N/A

@doublecompile doublecompile added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 8, 2024
@doublecompile doublecompile changed the title (aws-ssm): Allow creating parameters from a full ARN aws-ssm: Allow creating parameters from a full ARN Jul 8, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ssm Related to AWS Systems Manager label Jul 8, 2024
@doublecompile
Copy link
Author

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

@pahud
Copy link
Contributor

pahud commented Jul 12, 2024

related to #30646

Is this something you want?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jul 12, 2024
Copy link

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.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jul 14, 2024
@doublecompile
Copy link
Author

@pahud Yes, the pull request you linked will cover my use case. Thanks!

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jul 15, 2024
@doublecompile
Copy link
Author

Closing; this has been resolved thanks to #30646 being merged in.

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants