Interface AuthorizationMode

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-27T16:50:53.145Z") @Stability(Stable) public interface AuthorizationMode extends software.amazon.jsii.JsiiSerializable
Interface to specify default or additional authorization(s).

Example:

 import software.amazon.awscdk.services.appsync.*;
 GraphqlApi api = GraphqlApi.Builder.create(this, "api")
         .name("api")
         .definition(Definition.fromFile("schema.graphql"))
         .authorizationConfig(AuthorizationConfig.builder()
                 .defaultAuthorization(AuthorizationMode.builder().authorizationType(AuthorizationType.IAM).build())
                 .build())
         .build();
 Rule rule = Rule.Builder.create(this, "Rule")
         .schedule(Schedule.rate(Duration.hours(1)))
         .build();
 rule.addTarget(AppSync.Builder.create(api)
         .graphQLOperation("mutation Publish($message: String!){ publish(message: $message) { message } }")
         .variables(RuleTargetInput.fromObject(Map.of(
                 "message", "hello world")))
         .build());
 
  • Method Details

    • getAuthorizationType

      @Stability(Stable) @NotNull AuthorizationType getAuthorizationType()
      One of possible four values AppSync supports.

      Default: - `AuthorizationType.API_KEY`

      See Also:
    • getApiKeyConfig

      @Stability(Stable) @Nullable default ApiKeyConfig getApiKeyConfig()
      If authorizationType is AuthorizationType.API_KEY, this option can be configured.

      Default: - name: 'DefaultAPIKey' | description: 'Default API Key created by CDK'

    • getLambdaAuthorizerConfig

      @Stability(Stable) @Nullable default LambdaAuthorizerConfig getLambdaAuthorizerConfig()
      If authorizationType is AuthorizationType.LAMBDA, this option is required.

      Default: - none

    • getOpenIdConnectConfig

      @Stability(Stable) @Nullable default OpenIdConnectConfig getOpenIdConnectConfig()
      If authorizationType is AuthorizationType.OIDC, this option is required.

      Default: - none

    • getUserPoolConfig

      @Stability(Stable) @Nullable default UserPoolConfig getUserPoolConfig()
      If authorizationType is AuthorizationType.USER_POOL, this option is required.

      Default: - none

    • builder

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