@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-25T18:29:12.480Z")
public interface AuthorizationMode
Example:
GraphqlApi api = GraphqlApi.Builder.create(this, "Api") .name("demo") .schema(Schema.fromAsset(join(__dirname, "schema.graphql"))) .authorizationConfig(AuthorizationConfig.builder() .defaultAuthorization(AuthorizationMode.builder() .authorizationType(AuthorizationType.IAM) .build()) .build()) .xrayEnabled(true) .build(); Table demoTable = Table.Builder.create(this, "DemoTable") .partitionKey(Attribute.builder() .name("id") .type(AttributeType.STRING) .build()) .build(); DynamoDbDataSource demoDS = api.addDynamoDbDataSource("demoDataSource", demoTable); // Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list. demoDS.createResolver(BaseResolverProps.builder() .typeName("Query") .fieldName("getDemos") .requestMappingTemplate(MappingTemplate.dynamoDbScanTable()) .responseMappingTemplate(MappingTemplate.dynamoDbResultList()) .build()); // Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table. demoDS.createResolver(BaseResolverProps.builder() .typeName("Mutation") .fieldName("addDemo") .requestMappingTemplate(MappingTemplate.dynamoDbPutItem(PrimaryKey.partition("id").auto(), Values.projecting("input"))) .responseMappingTemplate(MappingTemplate.dynamoDbResultItem()) .build());
Modifier and Type | Interface and Description |
---|---|
static class |
AuthorizationMode.Builder
A builder for
AuthorizationMode |
static class |
AuthorizationMode.Jsii$Proxy
An implementation for
AuthorizationMode |
Modifier and Type | Method and Description |
---|---|
static AuthorizationMode.Builder |
builder() |
default ApiKeyConfig |
getApiKeyConfig()
(experimental) If authorizationType is `AuthorizationType.API_KEY`, this option can be configured.
|
AuthorizationType |
getAuthorizationType()
(experimental) One of possible four values AppSync supports.
|
default LambdaAuthorizerConfig |
getLambdaAuthorizerConfig()
(experimental) If authorizationType is `AuthorizationType.LAMBDA`, this option is required.
|
default OpenIdConnectConfig |
getOpenIdConnectConfig()
(experimental) If authorizationType is `AuthorizationType.OIDC`, this option is required.
|
default UserPoolConfig |
getUserPoolConfig()
(experimental) If authorizationType is `AuthorizationType.USER_POOL`, this option is required.
|
AuthorizationType getAuthorizationType()
Default: - `AuthorizationType.API_KEY`
default ApiKeyConfig getApiKeyConfig()
Default: - name: 'DefaultAPIKey' | description: 'Default API Key created by CDK'
default LambdaAuthorizerConfig getLambdaAuthorizerConfig()
Default: - none
default OpenIdConnectConfig getOpenIdConnectConfig()
Default: - none
default UserPoolConfig getUserPoolConfig()
Default: - none
static AuthorizationMode.Builder builder()
AuthorizationMode.Builder
of AuthorizationMode