@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-11T19:24:27.301Z") @Stability(value=Experimental) public enum RoleMappingMatchType extends Enum<RoleMappingMatchType>
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 and Description |
|---|
CONTAINS
(experimental) The Claim from the token must contain the given value in order for a match.
|
EQUALS
(experimental) The Claim from the token must equal the given value in order for a match.
|
NOTEQUAL
(experimental) The Claim from the token must not equal the given value in order for a match.
|
STARTS_WITH
(experimental) The Claim from the token must start with the given value in order for a match.
|
| Modifier and Type | Method and Description |
|---|---|
static RoleMappingMatchType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RoleMappingMatchType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Experimental) public static final RoleMappingMatchType EQUALS
@Stability(value=Experimental) public static final RoleMappingMatchType CONTAINS
@Stability(value=Experimental) public static final RoleMappingMatchType STARTS_WITH
@Stability(value=Experimental) public static final RoleMappingMatchType NOTEQUAL
public static RoleMappingMatchType[] values()
for (RoleMappingMatchType c : RoleMappingMatchType.values()) System.out.println(c);
public static RoleMappingMatchType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.