Enum RoleMappingMatchType

java.lang.Object
java.lang.Enum<RoleMappingMatchType>
software.amazon.awscdk.services.cognito.identitypool.RoleMappingMatchType
All Implemented Interfaces:
Serializable, Comparable<RoleMappingMatchType>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:45.477Z") @Stability(Experimental) public enum RoleMappingMatchType extends Enum<RoleMappingMatchType>
(experimental) Types of matches allowed for Role Mapping.

Example:

 import software.amazon.awscdk.services.cognito.identitypool.IdentityPoolProviderUrl;
 import software.amazon.awscdk.services.cognito.identitypool.RoleMappingMatchType;
 Role adminRole;
 Role nonAdminRole;
 IdentityPool.Builder.create(this, "myidentitypool")
         .identityPoolName("myidentitypool")
         // Assign specific roles to users based on whether or not the custom admin claim is passed from the identity provider
         .roleMappings(List.of(IdentityPoolRoleMapping.builder()
                 .providerUrl(IdentityPoolProviderUrl.AMAZON)
                 .rules(List.of(RoleMappingRule.builder()
                         .claim("custom:admin")
                         .claimValue("admin")
                         .mappedRole(adminRole)
                         .build(), RoleMappingRule.builder()
                         .claim("custom:admin")
                         .claimValue("admin")
                         .matchType(RoleMappingMatchType.NOTEQUAL)
                         .mappedRole(nonAdminRole)
                         .build()))
                 .build()))
         .build();
 
  • Enum Constant Details

    • EQUALS

      @Stability(Experimental) public static final RoleMappingMatchType EQUALS
      (experimental) The Claim from the token must equal the given value in order for a match.
    • CONTAINS

      @Stability(Experimental) public static final RoleMappingMatchType CONTAINS
      (experimental) The Claim from the token must contain the given value in order for a match.
    • STARTS_WITH

      @Stability(Experimental) public static final RoleMappingMatchType STARTS_WITH
      (experimental) The Claim from the token must start with the given value in order for a match.
    • NOTEQUAL

      @Stability(Experimental) public static final RoleMappingMatchType NOTEQUAL
      (experimental) The Claim from the token must not equal the given value in order for a match.
  • Method Details

    • values

      public static RoleMappingMatchType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static RoleMappingMatchType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null