Show / Hide Table of Contents

Class AuthorizationConfig

Configuration of the API authorization modes.

Inheritance
object
AuthorizationConfig
Implements
IAuthorizationConfig
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AuthorizationConfig : IAuthorizationConfig
Syntax (vb)
Public Class AuthorizationConfig Implements IAuthorizationConfig
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

Constructors

AuthorizationConfig()

Configuration of the API authorization modes.

Properties

AdditionalAuthorizationModes

Additional authorization modes.

DefaultAuthorization

Optional authorization configuration.

Constructors

AuthorizationConfig()

Configuration of the API authorization modes.

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

Properties

AdditionalAuthorizationModes

Additional authorization modes.

public IAuthorizationMode[]? AdditionalAuthorizationModes { get; set; }
Property Value

IAuthorizationMode[]

Remarks

Default: - No other modes

DefaultAuthorization

Optional authorization configuration.

public IAuthorizationMode? DefaultAuthorization { get; set; }
Property Value

IAuthorizationMode

Remarks

Default: - API Key authorization

Implements

IAuthorizationConfig
Back to top Generated by DocFX