You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The name to be given to the CDK Bootstrap bucket.
*
* @default - a name is generated by CloudFormation.
*/
readonlybucketName?: string;
If bucketName is passed in, bootstrap will attempt to create the bucket. If the bucket already exists, the bootstrap operation will fail.
When bootstrapping multiple environments, it is possible to pass in bucketName. However, this will cause at least one environment to fail bootstrapping. Assuming the bucket name is not already taken, the first environment that is bootstrapped will use that bucket name and succeed. All other environments will fail to bootstrap, since the bucket name is already taken.
BootstrapEnvironmentOptions is bootstrap-action-scoped (i.e. account-scoped), but it is passed into bootstrapEnvironment, an environment-scoped (i.e. region-scoped) function.
Consider something like the following as a param for bootstrap:
interface EnvironmentBootstrapConfig {
readonly environment: string; // The environment descriptor (e.g. 'aws://123456789012/us-east-1')
readonly parameters?: BootstrappingParameters;
// Other environment-specific options that were previously in BootstrapOptions
}
The text was updated successfully, but these errors were encountered:
Bootstrap fails when multiple environments are being bootstrapped with a custom bucketName
Description
Users can pass in
BootstrappingParameters
to modify how resources are created during bootstrap:aws-cdk-cli/packages/aws-cdk/lib/api/bootstrap/bootstrap-props.ts
Lines 66 to 72 in 7517ecc
If
bucketName
is passed in, bootstrap will attempt to create the bucket. If the bucket already exists, the bootstrap operation will fail.When bootstrapping multiple environments, it is possible to pass in
bucketName
. However, this will cause at least one environment to fail bootstrapping. Assuming the bucket name is not already taken, the first environment that is bootstrapped will use that bucket name and succeed. All other environments will fail to bootstrap, since the bucket name is already taken.Reproduction
Command-line:
Result:
Only one environment is bootstrapped successfully.
Proposed fix
BootstrappingParameters
should be passed in per-environment. It should remain optional. The current CLI implementation is as follows:aws-cdk-cli/packages/aws-cdk/lib/cli/cdk-toolkit.ts
Lines 963 to 989 in 7517ecc
BootstrapEnvironmentOptions
is bootstrap-action-scoped (i.e. account-scoped), but it is passed intobootstrapEnvironment
, an environment-scoped (i.e. region-scoped) function.Consider something like the following as a param for bootstrap:
The text was updated successfully, but these errors were encountered: