Skip to content

Commit 8ac7389

Browse files
Jimmy Gaussenmergify[bot]
authored andcommitted
fix(cli): support aws:// prefix for bootstrap command (#3599)
* fix(cli): support aws:// prefix for bootstrap command * Update error messages to use the `aws://` format * Update environments.ts
1 parent 60ecc1c commit 8ac7389

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/aws-cdk/lib/api/cxapp/environments.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ async function parseEnvironment(sdk: ISDK, env: cxapi.Environment): Promise<cxap
4545
*/
4646
export function environmentsFromDescriptors(envSpecs: string[]): cxapi.Environment[] {
4747
if (envSpecs.length === 0) {
48-
throw new Error(`Either specify an app with '--app', or specify an environment name like '123456789012/us-east-1'`);
48+
throw new Error(`Either specify an app with '--app', or specify an environment name like 'aws://123456789012/us-east-1'`);
4949
}
5050

5151
const ret = new Array<cxapi.Environment>();
52+
5253
for (const spec of envSpecs) {
53-
const parts = spec.split('/');
54+
const parts = spec.replace(/^aws:\/\//, '').split('/');
5455
if (parts.length !== 2) {
55-
throw new Error(`Expected environment name in format '<account>/<region>', got: ${spec}`);
56+
throw new Error(`Expected environment name in format 'aws://<account>/<region>', got: ${spec}`);
5657
}
5758

5859
ret.push({

0 commit comments

Comments
 (0)