enum AuthorizationType
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppSync.AuthorizationType |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#AuthorizationType |
![]() | software.amazon.awscdk.services.appsync.AuthorizationType |
![]() | aws_cdk.aws_appsync.AuthorizationType |
![]() | aws-cdk-lib » aws_appsync » AuthorizationType |
enum with all possible values for AppSync authorization type.
Example
import * as iam from 'aws-cdk-lib/aws-iam';
import * as appsync from 'aws-cdk-lib/aws-appsync';
const api = appsync.GraphqlApi.fromGraphqlApiAttributes(this, 'ImportedAPI', {
graphqlApiId: '<api-id>',
graphqlApiArn: '<api-arn>',
graphQLEndpointArn: '<api-endpoint-arn>',
visibility: appsync.Visibility.GLOBAL,
modes: [appsync.AuthorizationType.IAM],
});
const rule = new events.Rule(this, 'Rule', { schedule: events.Schedule.rate(cdk.Duration.minutes(1)), });
const role = new iam.Role(this, 'Role', { assumedBy: new iam.ServicePrincipal('events.amazonaws.com') });
// allow EventBridge to use the `publish` mutation
api.grantMutation(role, 'publish');
rule.addTarget(new targets.AppSync(api, {
graphQLOperation: 'mutation Publish($message: String!){ publish(message: $message) { message } }',
variables: events.RuleTargetInput.fromObject({
message: 'hello world',
}),
eventRole: role
}));
Members
Name | Description |
---|---|
API_KEY | API Key authorization type. |
IAM | AWS IAM authorization type. |
USER_POOL | Cognito User Pool authorization type. |
OIDC | OpenID Connect authorization type. |
LAMBDA | Lambda authorization type. |
API_KEY
API Key authorization type.
IAM
AWS IAM authorization type.
Can be used with Cognito Identity Pool federated credentials
USER_POOL
Cognito User Pool authorization type.
OIDC
OpenID Connect authorization type.
LAMBDA
Lambda authorization type.