Enum AuthorizationType

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-11T03:45:50.016Z") @Stability(Stable) public enum AuthorizationType extends Enum<AuthorizationType>
enum with all possible values for AppSync authorization type.

Example:

 import software.amazon.awscdk.services.iam.*;
 import software.amazon.awscdk.services.appsync.*;
 IGraphqlApi api = GraphqlApi.fromGraphqlApiAttributes(this, "ImportedAPI", GraphqlApiAttributes.builder()
         .graphqlApiId("<api-id>")
         .graphqlApiArn("<api-arn>")
         .graphQLEndpointArn("<api-endpoint-arn>")
         .visibility(Visibility.GLOBAL)
         .modes(List.of(AuthorizationType.IAM))
         .build());
 Rule rule = Rule.Builder.create(this, "Rule").schedule(Schedule.rate(Duration.minutes(1))).build();
 Role role = Role.Builder.create(this, "Role").assumedBy(new ServicePrincipal("events.amazonaws.com")).build();
 // allow EventBridge to use the `publish` mutation
 api.grantMutation(role, "publish");
 rule.addTarget(AppSync.Builder.create(api)
         .graphQLOperation("mutation Publish($message: String!){ publish(message: $message) { message } }")
         .variables(RuleTargetInput.fromObject(Map.of(
                 "message", "hello world")))
         .eventRole(role)
         .build());
 
  • Enum Constant Details

    • API_KEY

      @Stability(Stable) public static final AuthorizationType API_KEY
      API Key authorization type.
    • IAM

      @Stability(Stable) public static final AuthorizationType IAM
      AWS IAM authorization type.

      Can be used with Cognito Identity Pool federated credentials

    • USER_POOL

      @Stability(Stable) public static final AuthorizationType USER_POOL
      Cognito User Pool authorization type.
    • OIDC

      @Stability(Stable) public static final AuthorizationType OIDC
      OpenID Connect authorization type.
    • LAMBDA

      @Stability(Stable) public static final AuthorizationType LAMBDA
      Lambda authorization type.
  • Method Details

    • values

      public static AuthorizationType[] 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 AuthorizationType 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