Enum Class 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.110.0 (build 336b265)", date="2025-04-22T23:08:09.650Z") @Stability(Stable) public enum RoleMappingMatchType extends Enum<RoleMappingMatchType>
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(Stable) public static final RoleMappingMatchType EQUALS
      The claim from the token must equal the given value in order for a match.
    • CONTAINS

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

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

      @Stability(Stable) public static final RoleMappingMatchType NOTEQUAL
      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 class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RoleMappingMatchType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null