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
feat(cli): diff now uses the lookup Role for new-style synthesis (#18277)
This PR exposes information on the bootstrap lookup role on the
CloudFormation stack artifact. This enables the CLI to assume the lookup
role during cli operations in order to lookup information in the stack
account.
Along with the ARN of the lookup role, this also exposes a
`requiresBootstrapStackVersion` property which is set to `8` (the
version the lookup role was given ReadOnlyAccess), and the
`bootstrapStackVersionSsmParameter` which is needed to lookup the
bootstrap version if a user has renamed the bootstrap stack.
This allows us to first check whether the lookupRole exists and has the
correct permissions prior to using it.
This also updates the `diff` capability in the CLI (run as part of `cdk diff` or `cdk deploy`)
to use this new functionality. It now will try to assume the lookupRole and if it doesn't exist or
if the bootstrap stack version is not valid, then it will fallback to using the deployRole (what it uses
currently).
This PR also updates the `forEnvironment` function to return whether or not it is returning the
default credentials. This allows the calling function to decide whether or not it actually wants
to use the default credentials.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/@aws-cdk/cloud-assembly-schema/schema/cloud-assembly.schema.json
+30-1
Original file line number
Diff line number
Diff line change
@@ -307,6 +307,10 @@
307
307
"description": "The role that is passed to CloudFormation to execute the change set (Default - No role is passed (currently assumed role/credentials are used))",
308
308
"type": "string"
309
309
},
310
+
"lookupRole": {
311
+
"description": "The role to use to look up values from the target AWS account (Default - No role is assumed (current credentials are used))",
312
+
"$ref": "#/definitions/BootstrapRole"
313
+
},
310
314
"stackTemplateAssetObjectUrl": {
311
315
"description": "If the stack template has already been included in the asset manifest, its asset URL (Default - Not uploaded yet, upload just before deploying)",
312
316
"type": "string"
@@ -328,6 +332,31 @@
328
332
"templateFile"
329
333
]
330
334
},
335
+
"BootstrapRole": {
336
+
"description": "Information needed to access an IAM role created\nas part of the bootstrap process",
337
+
"type": "object",
338
+
"properties": {
339
+
"arn": {
340
+
"description": "The ARN of the IAM role created as part of bootrapping\ne.g. lookupRoleArn",
341
+
"type": "string"
342
+
},
343
+
"assumeRoleExternalId": {
344
+
"description": "External ID to use when assuming the bootstrap role (Default - No external ID)",
345
+
"type": "string"
346
+
},
347
+
"requiresBootstrapStackVersion": {
348
+
"description": "Version of bootstrap stack required to use this role (Default - No bootstrap stack required)",
349
+
"type": "number"
350
+
},
351
+
"bootstrapStackVersionSsmParameter": {
352
+
"description": "Name of SSM parameter with bootstrap stack version (Default - Discover SSM parameter by reading stack)",
353
+
"type": "string"
354
+
}
355
+
},
356
+
"required": [
357
+
"arn"
358
+
]
359
+
},
331
360
"AssetManifestProperties": {
332
361
"description": "Artifact properties for the Asset Manifest",
333
362
"type": "object",
@@ -598,7 +627,7 @@
598
627
}
599
628
},
600
629
"returnAsymmetricSubnets": {
601
-
"description": "Whether to populate the subnetGroups field of the {@link VpcContextResponse},\nwhich contains potentially asymmetric subnet groups.",
630
+
"description": "Whether to populate the subnetGroups field of the{@linkVpcContextResponse},\nwhich contains potentially asymmetric subnet groups.",
warning(`${fmtObtainedCredentials(baseCreds)} could not be used to assume '${options.assumeRoleArn}', but are for the right account. Proceeding anyway.`);
0 commit comments