awsdocs / aws-cdk-guide

User guide for the AWS Cloud Development Kit (CDK).
Other
335 stars 222 forks source link

bootstrapping guide example is not Typescript friendly #419

Closed rantoniuk closed 2 years ago

rantoniuk commented 2 years ago

The bootstrapping.md guide shows examples like this for TS:

new DefaultStackSynthesizer({
  // Name of the S3 bucket for file assets
  fileAssetsBucketName: 'cdk-${Qualifier}-assets-${AWS::AccountId}-${AWS::Region}',
  bucketPrefix: '',

This is however not Typescript friendly and it (imho) should be expressed using backticks and Aws static class references:

new DefaultStackSynthesizer({
  // Name of the S3 bucket for file assets
  fileAssetsBucketName: `cdk-${DefaultStackSynthesizer.DEFAULT_QUALIFIER}-assets-${Aws.ACCOUNT_ID}-${Aws.REGION}`,

Happy to make a PR if you agree on the approach.

ghost commented 2 years ago

The CDK Toolkit resolves those references, it's not something your app is responsible for. You could do it in TypeScript, as you show, but letting the CDK Toolkit do it works the same in all languages. I don't believe there's any reason to change this. Sorry!