-
Notifications
You must be signed in to change notification settings - Fork 4k
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-dynamodb] when setting PhysicalName.GENERATE_IF_NEEDED to tableName, throwing error Invalid physical name passed to CloudFormation. Use "this.physicalName" instead
#9374
Comments
Hey @flyingImer , thanks for opening the issue. Would you mind showing a particular snippet that causes this? It's hard to find it in an entire GutHub project. That will help us diagnose immensely. Thanks! |
@flyingImer thanks! I confirm I can reproduce it on a minimal example like this: new ddb.Table(this, 'SomeTable', {
partitionKey: {
name: 'someKey',
type: ddb.AttributeType.STRING
},
tableName: cdk.PhysicalName.GENERATE_IF_NEEDED // even without cross-env reference, this line still throws the error
}); Thanks for reporting - this definitely looks like a bug, either in the DynamoDB library, or in the core physical name resolution. |
Yep, I think it's in the DynamoDB library. I should have a fix out soon. |
This seems to still be an issue, except for API Gateway: api = apigateway.LambdaRestApi(self, 'TransactionServicesAPIs',
deploy_options=apigateway.StageOptions(
stage_name='test',
),
handler=fn,
proxy=False,
rest_api_name=PhysicalName.GENERATE_IF_NEEDED,
)
|
Confirmed I was able to reproduce the issue @ChristianTrummer99 (in TypeScript, the language doesn't actually matters here as it turns out). Working on a fix. |
… in LambdaRestApi Fixes aws#9374
Fix: #19638. |
… in LambdaRestApi (#19638) Fixes #9374 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
… in LambdaRestApi (aws#19638) Fixes aws#9374 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hello,
results in:
|
@isaiahvita are you 100% sure the problem is with this code? Not somewhere else? |
I'm seeing this error for SecretsManager keys
seems like this was a similar issue closed to inactivity: #16167 I did get things to work for s3 buckets and dynamodb tables, so it's just Secrets which still have this issue as far as I know. |
@renschler can you show how are you using |
I'm also seeing this when referencing edit: import { Arn, ArnFormat } from 'aws-cdk-lib'
const { resourceName } = Arn.split(secret.secretArn, ArnFormat.COLON_RESOURCE_NAME) |
Hi team, I'm trying to do a cross-env reference on a ddb table. After I specify the tableName to PhysicalName.GENERATE_IF_NEEDED, synthesizing process breaks.
The error message says:
I suspect this is a bug, as my experiment on a cross-env referenced IAM role works just fine with PhysicalName.GENERATE_IF_NEEDED (not included in the example below)
And I think this error message is confusing. I have no idea what to do with this message. Any context how should I interpret it?
Reproduction Steps
here is an example I used: https://github.com/flyingImer/cdk-mkii
cdk synth
breaks even withoutSomeStack
referencing to the ddb table defined inCdkMkiiStack
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: