Enum AuthorizationType
enum with all possible values for AppSync authorization type.
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum AuthorizationType
Syntax (vb)
Public Enum AuthorizationType
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.AppSync;
var api = GraphqlApi.FromGraphqlApiAttributes(this, "ImportedAPI", new GraphqlApiAttributes {
GraphqlApiId = "<api-id>",
GraphqlApiArn = "<api-arn>",
GraphQLEndpointArn = "<api-endpoint-arn>",
Visibility = Visibility.GLOBAL,
Modes = new [] { AuthorizationType.IAM }
});
var rule = new Rule(this, "Rule", new RuleProps { Schedule = Schedule.Rate(Duration.Minutes(1)) });
var role = new Role(this, "Role", new RoleProps { AssumedBy = new ServicePrincipal("events.amazonaws.com") });
// allow EventBridge to use the `publish` mutation
api.GrantMutation(role, "publish");
rule.AddTarget(new AppSync(api, new AppSyncGraphQLApiProps {
GraphQLOperation = "mutation Publish($message: String!){ publish(message: $message) { message } }",
Variables = RuleTargetInput.FromObject(new Dictionary<string, string> {
{ "message", "hello world" }
}),
EventRole = role
}));
Synopsis
Fields
| API_KEY | API Key authorization type. |
| IAM | AWS IAM authorization type. |
| LAMBDA | Lambda authorization type. |
| OIDC | OpenID Connect authorization type. |
| USER_POOL | Cognito User Pool authorization type. |
Fields
| Name | Description |
|---|---|
| API_KEY | API Key authorization type. |
| IAM | AWS IAM authorization type. |
| LAMBDA | Lambda authorization type. |
| OIDC | OpenID Connect authorization type. |
| USER_POOL | Cognito User Pool authorization type. |