Show / Hide Table of Contents

Interface IAuthorizationMode

Interface to specify default or additional authorization(s).

Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAuthorizationMode
Syntax (vb)
Public Interface IAuthorizationMode
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.AppSync;


            var api = new GraphqlApi(this, "api", new GraphqlApiProps {
                Name = "api",
                Definition = Definition.FromFile("schema.graphql"),
                AuthorizationConfig = new AuthorizationConfig {
                    DefaultAuthorization = new AuthorizationMode { AuthorizationType = AuthorizationType.IAM }
                }
            });

            var rule = new Rule(this, "Rule", new RuleProps {
                Schedule = Schedule.Rate(Duration.Hours(1))
            });

            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" }
                })
            }));

Synopsis

Properties

ApiKeyConfig

If authorizationType is AuthorizationType.API_KEY, this option can be configured.

AuthorizationType

One of possible four values AppSync supports.

LambdaAuthorizerConfig

If authorizationType is AuthorizationType.LAMBDA, this option is required.

OpenIdConnectConfig

If authorizationType is AuthorizationType.OIDC, this option is required.

UserPoolConfig

If authorizationType is AuthorizationType.USER_POOL, this option is required.

Properties

ApiKeyConfig

If authorizationType is AuthorizationType.API_KEY, this option can be configured.

IApiKeyConfig? ApiKeyConfig { get; }
Property Value

IApiKeyConfig

Remarks

Default: - name: 'DefaultAPIKey' | description: 'Default API Key created by CDK'

AuthorizationType

One of possible four values AppSync supports.

AuthorizationType AuthorizationType { get; }
Property Value

AuthorizationType

Remarks

Default: - AuthorizationType.API_KEY

See: https://docs.aws.amazon.com/appsync/latest/devguide/security.html

LambdaAuthorizerConfig

If authorizationType is AuthorizationType.LAMBDA, this option is required.

ILambdaAuthorizerConfig? LambdaAuthorizerConfig { get; }
Property Value

ILambdaAuthorizerConfig

Remarks

Default: - none

OpenIdConnectConfig

If authorizationType is AuthorizationType.OIDC, this option is required.

IOpenIdConnectConfig? OpenIdConnectConfig { get; }
Property Value

IOpenIdConnectConfig

Remarks

Default: - none

UserPoolConfig

If authorizationType is AuthorizationType.USER_POOL, this option is required.

IUserPoolConfig? UserPoolConfig { get; }
Property Value

IUserPoolConfig

Remarks

Default: - none

Back to top Generated by DocFX