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-cdk/core): Invalid physical name passed to CloudFormation. Use "this.physicalName" instead #16167

Closed
bravogolfgolf opened this issue Aug 22, 2021 · 2 comments
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation @aws-cdk/core Related to core CDK functionality bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p1

Comments

@bravogolfgolf
Copy link

Reproduction Steps

const secret = new secretsmanager.Secret(this, 'secret', {
  secretName: cdk.PhysicalName.GENERATE_IF_NEEDED,
  generateSecretString: {
    secretStringTemplate: JSON.stringify({username: 'username'}),
    generateStringKey: 'password',
  },
});
const secretValue = cdk.SecretValue.secretsManager(secret.secretName, {
  jsonField: 'username'
}).toString();
new ssm.StringParameter(this, 'string-parameter', {stringValue: secretValue});

What did you expect to happen?

I would expect it not to error.

What actually happened?

node_modules/@aws-cdk/core/lib/private/physical-name-generator.ts:91
throw new Error('Invalid physical name passed to CloudFormation. Use "this.physicalName" instead');

Environment

  • CDK CLI Version : 1.118.0
  • Framework Version: 1.119.0
  • Node.js Version: v14.16.0
  • OS: macOS Big Sur 11.5.2 (20G95)
  • Language (Version): TypeScript (3.9.7)

Other

I originally tried literal secretName and received this error:
.../node_modules/@aws-cdk/core/lib/secret-value.ts:19
throw new Error('secret id "${secretId}" is not an ARN but contains ":"');
Issue: #16166


This is 🐛 Bug Report

@bravogolfgolf bravogolfgolf added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 22, 2021
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Aug 22, 2021
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Aug 22, 2021
@rix0rrr rix0rrr added effort/medium Medium work item – several days of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Aug 24, 2021
@rix0rrr rix0rrr removed their assignment Aug 24, 2021
@github-actions
Copy link

This issue has not received any attention in 1 year. 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 closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 24, 2022
@FarrOut
Copy link

FarrOut commented Aug 24, 2023

yea this is still an issue in CDK v2.93.0 with Python 3.11.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation @aws-cdk/core Related to core CDK functionality bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

No branches or pull requests

3 participants