Interface CustomizeRolesOptions

All Superinterfaces:
All Known Implementing Classes:

@Generated(value="jsii-pacmak/1.92.0 (build db7f27d)", date="2023-12-01T19:06:33.329Z") @Stability(Stable) public interface CustomizeRolesOptions extends
Options for customizing IAM role creation.


 App app;
 Stack stack = new Stack(app, "MyStack");
 Role.customizeRoles(this, CustomizeRolesOptions.builder()
                 "MyStack/MyLambda/ServiceRole", "my-role-name"))
  • Method Details

    • getPreventSynthesis

      @Stability(Stable) @Nullable default Boolean getPreventSynthesis()
      Whether or not to synthesize the resource into the CFN template.

      Set this to false if you still want to create the resources and you also want to create the policy report.

      Default: true

    • getUsePrecreatedRoles

      @Stability(Stable) @Nullable default Map<String,String> 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 customizeRoles is used on to the role being created.

      Default: - there are no precreated roles. Synthesis will fail if `preventSynthesis=true`


       App app;
       Stack stack = new Stack(app, "MyStack");
       Role.Builder.create(stack, "MyRole")
               .assumedBy(new AccountPrincipal("1111111111"))
       Role.customizeRoles(stack, CustomizeRolesOptions.builder()
                       // absolute path
                       "MyStack/MyRole", "my-precreated-role-name",
                       // or relative path from `stack`
                       "MyRole", "my-precreated-role"))
    • builder

      @Stability(Stable) static CustomizeRolesOptions.Builder builder()
      a CustomizeRolesOptions.Builder of CustomizeRolesOptions