AuthorizationType Enum
enum with all possible values for AppSync authorization type.
Example
ts
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
| Member | 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. |
Referenced by
AuthorizationMode.authorizationTypeauthorization_typeauthorizationTypeAuthorizationTypeAuthorizationTypeGraphqlApi.modesmodesmodesModesModesGraphqlApiAttributes.modesmodesmodesModesModesGraphqlApiBase.modesmodesmodesModesModesIGraphqlApi.modesmodesmodesModesModes