Class AuthorizationType
(experimental) enum with all possible values for AppSync authorization type.
Inheritance
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public sealed class AuthorizationType : Enum
Syntax (vb)
Public NotInheritable Class AuthorizationType
Inherits
Enum
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
var api = new GraphqlApi(this, "Api", new GraphqlApiProps {
Name = "demo",
Schema = Schema.FromAsset(Join(__dirname, "schema.graphql")),
AuthorizationConfig = new AuthorizationConfig {
DefaultAuthorization = new AuthorizationMode {
AuthorizationType = AuthorizationType.IAM
}
},
XrayEnabled = true
});
var demoTable = new Table(this, "DemoTable", new TableProps {
PartitionKey = new Attribute {
Name = "id",
Type = AttributeType.STRING
}
});
var demoDS = api.AddDynamoDbDataSource("demoDataSource", demoTable);
// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.CreateResolver(new BaseResolverProps {
TypeName = "Query",
FieldName = "getDemos",
RequestMappingTemplate = MappingTemplate.DynamoDbScanTable(),
ResponseMappingTemplate = MappingTemplate.DynamoDbResultList()
});
// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.CreateResolver(new BaseResolverProps {
TypeName = "Mutation",
FieldName = "addDemo",
RequestMappingTemplate = MappingTemplate.DynamoDbPutItem(PrimaryKey.Partition("id").Auto(), Values.Projecting("input")),
ResponseMappingTemplate = MappingTemplate.DynamoDbResultItem()
});
Synopsis
Fields
API_KEY | (experimental) API Key authorization type. |
IAM | (experimental) AWS IAM authorization type. |
LAMBDA | (experimental) Lambda authorization type. |
OIDC | (experimental) OpenID Connect authorization type. |
USER_POOL | (experimental) Cognito User Pool authorization type. |
value__ |
Fields
API_KEY
(experimental) API Key authorization type.
public const AuthorizationType API_KEY
Field Value
Type | Description |
---|---|
AuthorizationType |
Remarks
Stability: Experimental
IAM
(experimental) AWS IAM authorization type.
public const AuthorizationType IAM
Field Value
Type | Description |
---|---|
AuthorizationType |
Remarks
Can be used with Cognito Identity Pool federated credentials
Stability: Experimental
LAMBDA
(experimental) Lambda authorization type.
public const AuthorizationType LAMBDA
Field Value
Type | Description |
---|---|
AuthorizationType |
Remarks
Stability: Experimental
OIDC
(experimental) OpenID Connect authorization type.
public const AuthorizationType OIDC
Field Value
Type | Description |
---|---|
AuthorizationType |
Remarks
Stability: Experimental
USER_POOL
(experimental) Cognito User Pool authorization type.
public const AuthorizationType USER_POOL
Field Value
Type | Description |
---|---|
AuthorizationType |
Remarks
Stability: Experimental
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |