Interface CustomizeRolesOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CustomizeRolesOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:37.882Z")
@Stability(Stable)
public interface CustomizeRolesOptions
extends software.amazon.jsii.JsiiSerializable
Options for customizing IAM role creation.
Example:
App app;
Stack stack = new Stack(app, "MyStack");
Role.customizeRoles(this, CustomizeRolesOptions.builder()
.usePrecreatedRoles(Map.of(
"MyStack/MyLambda/ServiceRole", "my-role-name"))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCustomizeRolesOptionsstatic final classAn implementation forCustomizeRolesOptions -
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getPreventSynthesis
Whether or not to synthesize the resource into the CFN template.Set this to
falseif you still want to create the resources and you also want to create the policy report.Default: true
-
getUsePrecreatedRoles
A list of precreated IAM roles to substitute for roles that CDK is creating.The constructPath can be either a relative or absolute path from the scope that
customizeRolesis used on to the role being created.Default: - there are no precreated roles. Synthesis will fail if `preventSynthesis=true`
Example:
App app; Stack stack = new Stack(app, "MyStack"); Role.Builder.create(stack, "MyRole") .assumedBy(new AccountPrincipal("1111111111")) .build(); Role.customizeRoles(stack, CustomizeRolesOptions.builder() .usePrecreatedRoles(Map.of( // absolute path "MyStack/MyRole", "my-precreated-role-name", // or relative path from `stack` "MyRole", "my-precreated-role")) .build()); -
builder
- Returns:
- a
CustomizeRolesOptions.BuilderofCustomizeRolesOptions
-