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): Using a number token for version number on StringParameter.fromStringParameterAttributes does not resolve properly #11913

Closed
john-kontralto opened this issue Dec 7, 2020 · 1 comment · Fixed by #16048
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@john-kontralto
Copy link

If you provide a number token to StringParameter.fromStringParameterAttributes, you end up with a random literal in the template instead of a Ref

Reproduction Steps

const paramVersion = new CfnParameter(this, `VersionParameter`, {
  type: 'Number',
}).valueAsNumber;

StringParameter.fromStringParameterAttributes(this, `SsmParamId`, {
  parameterName: 'something',
  version: paramVersion,
}).stringValue;

What did you expect to happen?

The parameter version would resolve properly as a Ref in the template

What actually happened?

You get a literal value in the template like "-1.888154589708849e+289"

Environment

  • CDK CLI Version : 1.75.0 (build 7708242)
  • Framework Version: 1.75.0
  • Node.js Version: v12.16.2
  • OS : OS X 10.14.6
  • Language (Version): TypeScript 3.9.7

Other

Related to #11813


This is 🐛 Bug Report

@john-kontralto john-kontralto added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 7, 2020
@github-actions github-actions bot added the @aws-cdk/aws-ssm Related to AWS Systems Manager label Dec 7, 2020
@MrArnoldPalmer MrArnoldPalmer added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Feb 22, 2021
@MrArnoldPalmer MrArnoldPalmer removed their assignment Jun 21, 2021
@mergify mergify bot closed this as completed in #16048 Aug 24, 2021
mergify bot pushed a commit that referenced this issue Aug 24, 2021
… version as a numeric Token (#16048)

In `StringParameter.fromStringParameterAttributes()` and `StringParameter.fromSecureStringParameterAttributes()` the version of a parameter can be specified using data type number.
If a token value (e.g. CloudFormation Parameter) was used here, the token was not resolved correctly.

The conversion of property `version` was corrected by using method `Tokenization.stringifyNumber()`.

Fixes #11913.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️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.

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
… version as a numeric Token (aws#16048)

In `StringParameter.fromStringParameterAttributes()` and `StringParameter.fromSecureStringParameterAttributes()` the version of a parameter can be specified using data type number.
If a token value (e.g. CloudFormation Parameter) was used here, the token was not resolved correctly.

The conversion of property `version` was corrected by using method `Tokenization.stringifyNumber()`.

Fixes aws#11913.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Sep 6, 2021
… version as a numeric Token (aws#16048)

In `StringParameter.fromStringParameterAttributes()` and `StringParameter.fromSecureStringParameterAttributes()` the version of a parameter can be specified using data type number.
If a token value (e.g. CloudFormation Parameter) was used here, the token was not resolved correctly.

The conversion of property `version` was corrected by using method `Tokenization.stringifyNumber()`.

Fixes aws#11913.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
david-doyle-as24 pushed a commit to david-doyle-as24/aws-cdk that referenced this issue Sep 7, 2021
… version as a numeric Token (aws#16048)

In `StringParameter.fromStringParameterAttributes()` and `StringParameter.fromSecureStringParameterAttributes()` the version of a parameter can be specified using data type number.
If a token value (e.g. CloudFormation Parameter) was used here, the token was not resolved correctly.

The conversion of property `version` was corrected by using method `Tokenization.stringifyNumber()`.

Fixes aws#11913.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
2 participants