Interface CustomizeRolesOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CustomizeRolesOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:08.138Z") @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());
 
  • 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`

      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

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