interface AuthorizationMode
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppSync.AuthorizationMode |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#AuthorizationMode |
![]() | software.amazon.awscdk.services.appsync.AuthorizationMode |
![]() | aws_cdk.aws_appsync.AuthorizationMode |
![]() | aws-cdk-lib » aws_appsync » AuthorizationMode |
Interface to specify default or additional authorization(s).
Example
import * as appsync from 'aws-cdk-lib/aws-appsync';
const api = new appsync.GraphqlApi(this, 'api', {
name: 'api',
definition: appsync.Definition.fromFile('schema.graphql'),
authorizationConfig: {
defaultAuthorization: { authorizationType: appsync.AuthorizationType.IAM }
},
});
const rule = new events.Rule(this, 'Rule', {
schedule: events.Schedule.rate(cdk.Duration.hours(1)),
});
rule.addTarget(new targets.AppSync(api, {
graphQLOperation: 'mutation Publish($message: String!){ publish(message: $message) { message } }',
variables: events.RuleTargetInput.fromObject({
message: 'hello world',
}),
}));
Properties
Name | Type | Description |
---|---|---|
authorization | Authorization | One of possible four values AppSync supports. |
api | Api | If authorizationType is AuthorizationType.API_KEY , this option can be configured. |
lambda | Lambda | If authorizationType is AuthorizationType.LAMBDA , this option is required. |
open | Open | If authorizationType is AuthorizationType.OIDC , this option is required. |
user | User | If authorizationType is AuthorizationType.USER_POOL , this option is required. |
authorizationType
Type:
Authorization
One of possible four values AppSync supports.
See also: https://docs.aws.amazon.com/appsync/latest/devguide/security.html
apiKeyConfig?
Type:
Api
(optional, default: name: 'DefaultAPIKey' | description: 'Default API Key created by CDK')
If authorizationType is AuthorizationType.API_KEY
, this option can be configured.
lambdaAuthorizerConfig?
Type:
Lambda
(optional, default: none)
If authorizationType is AuthorizationType.LAMBDA
, this option is required.
openIdConnectConfig?
Type:
Open
(optional, default: none)
If authorizationType is AuthorizationType.OIDC
, this option is required.
userPoolConfig?
Type:
User
(optional, default: none)
If authorizationType is AuthorizationType.USER_POOL
, this option is required.