Directive

class aws_cdk.aws_appsync.Directive(*args, **kwargs)

Bases: object

(experimental) Directives for types.

i.e. @aws_iam or @aws_subscribe

Stability

experimental

Methods

to_string()

(experimental) Generate the directive statement.

Stability

experimental

Return type

str

Attributes

mode

(experimental) The authorization type of this directive.

Default
  • not an authorization directive

Stability

experimental

Return type

Optional[AuthorizationType]

mutation_fields

(experimental) Mutation fields for a subscription directive.

Default
  • not a subscription directive

Stability

experimental

Return type

Optional[List[str]]

Static Methods

classmethod api_key()

(experimental) Add the @aws_api_key directive.

Stability

experimental

Return type

Directive

classmethod cognito(*groups)

(experimental) Add the @aws_auth or @aws_cognito_user_pools directive.

Parameters

groups (str) – the groups to allow access to.

Stability

experimental

Return type

Directive

classmethod custom(statement)

(experimental) Add a custom directive.

Parameters

statement (str) –

  • the directive statement to append.

Stability

experimental

Return type

Directive

classmethod iam()

(experimental) Add the @aws_iam directive.

Stability

experimental

Return type

Directive

classmethod oidc()

(experimental) Add the @aws_oidc directive.

Stability

experimental

Return type

Directive

classmethod subscribe(*mutations)

(experimental) Add the @aws_subscribe directive.

Only use for top level Subscription type.

Parameters

mutations (str) – the mutation fields to link to.

Stability

experimental

Return type

Directive