CfnGraphQLApi

class aws_cdk.aws_appsync.CfnGraphQLApi(scope, id, *, authentication_type, name, additional_authentication_providers=None, api_type=None, enhanced_metrics_config=None, environment_variables=None, introspection_config=None, lambda_authorizer_config=None, log_config=None, merged_api_execution_role_arn=None, open_id_connect_config=None, owner_contact=None, query_depth_limit=None, resolver_count_limit=None, tags=None, user_pool_config=None, visibility=None, xray_enabled=None)

Bases: CfnResource

The AWS::AppSync::GraphQLApi resource creates a new AWS AppSync GraphQL API.

This is the top-level construct for your application. For more information, see Quick Start in the AWS AppSync Developer Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html

CloudformationResource:

AWS::AppSync::GraphQLApi

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

# environment_variables: Any

cfn_graph_qLApi = appsync.CfnGraphQLApi(self, "MyCfnGraphQLApi",
    authentication_type="authenticationType",
    name="name",

    # the properties below are optional
    additional_authentication_providers=[appsync.CfnGraphQLApi.AdditionalAuthenticationProviderProperty(
        authentication_type="authenticationType",

        # the properties below are optional
        lambda_authorizer_config=appsync.CfnGraphQLApi.LambdaAuthorizerConfigProperty(
            authorizer_result_ttl_in_seconds=123,
            authorizer_uri="authorizerUri",
            identity_validation_expression="identityValidationExpression"
        ),
        open_id_connect_config=appsync.CfnGraphQLApi.OpenIDConnectConfigProperty(
            auth_ttl=123,
            client_id="clientId",
            iat_ttl=123,
            issuer="issuer"
        ),
        user_pool_config=appsync.CfnGraphQLApi.CognitoUserPoolConfigProperty(
            app_id_client_regex="appIdClientRegex",
            aws_region="awsRegion",
            user_pool_id="userPoolId"
        )
    )],
    api_type="apiType",
    enhanced_metrics_config=appsync.CfnGraphQLApi.EnhancedMetricsConfigProperty(
        data_source_level_metrics_behavior="dataSourceLevelMetricsBehavior",
        operation_level_metrics_config="operationLevelMetricsConfig",
        resolver_level_metrics_behavior="resolverLevelMetricsBehavior"
    ),
    environment_variables=environment_variables,
    introspection_config="introspectionConfig",
    lambda_authorizer_config=appsync.CfnGraphQLApi.LambdaAuthorizerConfigProperty(
        authorizer_result_ttl_in_seconds=123,
        authorizer_uri="authorizerUri",
        identity_validation_expression="identityValidationExpression"
    ),
    log_config=appsync.CfnGraphQLApi.LogConfigProperty(
        cloud_watch_logs_role_arn="cloudWatchLogsRoleArn",
        exclude_verbose_content=False,
        field_log_level="fieldLogLevel"
    ),
    merged_api_execution_role_arn="mergedApiExecutionRoleArn",
    open_id_connect_config=appsync.CfnGraphQLApi.OpenIDConnectConfigProperty(
        auth_ttl=123,
        client_id="clientId",
        iat_ttl=123,
        issuer="issuer"
    ),
    owner_contact="ownerContact",
    query_depth_limit=123,
    resolver_count_limit=123,
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    user_pool_config=appsync.CfnGraphQLApi.UserPoolConfigProperty(
        app_id_client_regex="appIdClientRegex",
        aws_region="awsRegion",
        default_action="defaultAction",
        user_pool_id="userPoolId"
    ),
    visibility="visibility",
    xray_enabled=False
)
Parameters:
  • scope (Construct) – Scope in which this resource is defined.

  • id (str) – Construct identifier for this resource (unique in its scope).

  • authentication_type (str) – Security configuration for your GraphQL API. For allowed values (such as API_KEY , AWS_IAM , AMAZON_COGNITO_USER_POOLS , OPENID_CONNECT , or AWS_LAMBDA ), see Security in the AWS AppSync Developer Guide .

  • name (str) – The API name.

  • additional_authentication_providers (Union[IResolvable, Sequence[Union[IResolvable, AdditionalAuthenticationProviderProperty, Dict[str, Any]]], None]) – A list of additional authentication providers for the GraphqlApi API.

  • api_type (Optional[str]) – The value that indicates whether the GraphQL API is a standard API ( GRAPHQL ) or merged API ( MERGED ). WARNING : If the ApiType has not been defined, explicitly setting it to GRAPHQL in a template/stack update will result in an API replacement and new DNS values. The following values are valid: GRAPHQL | MERGED

  • enhanced_metrics_config (Union[IResolvable, EnhancedMetricsConfigProperty, Dict[str, Any], None]) – Enables and controls the enhanced metrics feature. Enhanced metrics emit granular data on API usage and performance such as AppSync request and error counts, latency, and cache hits/misses. All enhanced metric data is sent to your CloudWatch account, and you can configure the types of data that will be sent. Enhanced metrics can be configured at the resolver, data source, and operation levels. For more information, see Monitoring and logging in the AWS AppSync User Guide .

  • environment_variables (Optional[Any]) – A map containing the list of resources with their properties and environment variables. For more information, see Environmental variables . Pattern : ^[A-Za-z]+\\w*$\\ Minimum : 2 Maximum : 64

  • introspection_config (Optional[str]) – Sets the value of the GraphQL API to enable ( ENABLED ) or disable ( DISABLED ) introspection. If no value is provided, the introspection configuration will be set to ENABLED by default. This field will produce an error if the operation attempts to use the introspection feature while this field is disabled. For more information about introspection, see GraphQL introspection .

  • lambda_authorizer_config (Union[IResolvable, LambdaAuthorizerConfigProperty, Dict[str, Any], None]) – A LambdaAuthorizerConfig holds configuration on how to authorize AWS AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AWS AppSync API may have only one Lambda authorizer configured at a time.

  • log_config (Union[IResolvable, LogConfigProperty, Dict[str, Any], None]) – The Amazon CloudWatch Logs configuration.

  • merged_api_execution_role_arn (Optional[str]) – The AWS Identity and Access Management service role ARN for a merged API. The AppSync service assumes this role on behalf of the Merged API to validate access to source APIs at runtime and to prompt the AUTO_MERGE to update the merged API endpoint with the source API changes automatically.

  • open_id_connect_config (Union[IResolvable, OpenIDConnectConfigProperty, Dict[str, Any], None]) – The OpenID Connect configuration.

  • owner_contact (Optional[str]) – The owner contact information for an API resource. This field accepts any string input with a length of 0 - 256 characters.

  • query_depth_limit (Union[int, float, None]) – The maximum depth a query can have in a single request. Depth refers to the amount of nested levels allowed in the body of query. The default value is 0 (or unspecified), which indicates there’s no depth limit. If you set a limit, it can be between 1 and 75 nested levels. This field will produce a limit error if the operation falls out of bounds. Note that fields can still be set to nullable or non-nullable. If a non-nullable field produces an error, the error will be thrown upwards to the first nullable field available.

  • resolver_count_limit (Union[int, float, None]) – The maximum number of resolvers that can be invoked in a single request. The default value is 0 (or unspecified), which will set the limit to 10000 . When specified, the limit value can be between 1 and 10000 . This field will produce a limit error if the operation falls out of bounds.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An arbitrary set of tags (key-value pairs) for this GraphQL API.

  • user_pool_config (Union[IResolvable, UserPoolConfigProperty, Dict[str, Any], None]) – Optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint.

  • visibility (Optional[str]) – Sets the scope of the GraphQL API to public ( GLOBAL ) or private ( PRIVATE ). By default, the scope is set to Global if no value is provided. WARNING : If Visibility has not been defined, explicitly setting it to GLOBAL in a template/stack update will result in an API replacement and new DNS values.

  • xray_enabled (Union[bool, IResolvable, None]) – A flag indicating whether to use AWS X-Ray tracing for this GraphqlApi .

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters:

path (str) – The path of the value to delete.

Return type:

None

add_dependency(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

add_depends_on(target)

(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

Parameters:

target (CfnResource) –

Deprecated:

use addDependency

Stability:

deprecated

Return type:

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters:
  • key (str) –

  • value (Any) –

See:

Return type:

None

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters:
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type:

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters:

property_path (str) – The path to the property.

Return type:

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters:
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type:

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

Parameters:
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options

Return type:

None

get_att(attribute_name, type_hint=None)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters:
  • attribute_name (str) – The name of the attribute.

  • type_hint (Optional[ResolutionTypeHint]) –

Return type:

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters:

key (str) –

See:

Return type:

Any

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters:

inspector (TreeInspector) – tree inspector to collect and process attributes.

Return type:

None

obtain_dependencies()

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.

Return type:

List[Union[Stack, CfnResource]]

obtain_resource_dependencies()

Get a shallow copy of dependencies between this resource and other resources in the same stack.

Return type:

List[CfnResource]

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters:

new_logical_id (str) – The new logical ID to use for this stack element.

Return type:

None

remove_dependency(target)

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

Parameters:

target (CfnResource) –

Return type:

None

replace_dependency(target, new_target)

Replaces one dependency with another.

Parameters:
Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Returns:

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::AppSync::GraphQLApi'
additional_authentication_providers

A list of additional authentication providers for the GraphqlApi API.

api_type

The value that indicates whether the GraphQL API is a standard API ( GRAPHQL ) or merged API ( MERGED ).

attr_api_id

Unique AWS AppSync GraphQL API identifier.

CloudformationAttribute:

ApiId

attr_arn

The Amazon Resource Name (ARN) of the API key, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid .

CloudformationAttribute:

Arn

attr_graph_ql_dns

The fully qualified domain name (FQDN) of the endpoint URL of your GraphQL API.

CloudformationAttribute:

GraphQLDns

attr_graph_ql_endpoint_arn

The GraphQL endpoint ARN.

CloudformationAttribute:

GraphQLEndpointArn

attr_graph_ql_url

The Endpoint URL of your GraphQL API.

CloudformationAttribute:

GraphQLUrl

attr_id

The ID value.

CloudformationAttribute:

Id

attr_realtime_dns

The fully qualified domain name (FQDN) of the real-time endpoint URL of your GraphQL API.

CloudformationAttribute:

RealtimeDns

attr_realtime_url

The GraphQL API real-time endpoint URL.

For more information, see Discovering the real-time endpoint from the GraphQL endpoint .

CloudformationAttribute:

RealtimeUrl

authentication_type

Security configuration for your GraphQL API.

cfn_options

Options for this resource, such as condition, update policy etc.

cfn_resource_type

AWS resource type.

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

enhanced_metrics_config

Enables and controls the enhanced metrics feature.

environment_variables

A map containing the list of resources with their properties and environment variables.

introspection_config

Sets the value of the GraphQL API to enable ( ENABLED ) or disable ( DISABLED ) introspection.

lambda_authorizer_config

A LambdaAuthorizerConfig holds configuration on how to authorize AWS AppSync API access when using the AWS_LAMBDA authorizer mode.

log_config

The Amazon CloudWatch Logs configuration.

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Returns:

the logical ID as a stringified token. This value will only get resolved during synthesis.

merged_api_execution_role_arn

The AWS Identity and Access Management service role ARN for a merged API.

name

The API name.

node

The tree node.

open_id_connect_config

The OpenID Connect configuration.

owner_contact

The owner contact information for an API resource.

query_depth_limit

The maximum depth a query can have in a single request.

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

resolver_count_limit

The maximum number of resolvers that can be invoked in a single request.

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

tags

Tag Manager which manages the tags for this resource.

tags_raw

An arbitrary set of tags (key-value pairs) for this GraphQL API.

user_pool_config

Optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint.

visibility

Sets the scope of the GraphQL API to public ( GLOBAL ) or private ( PRIVATE ).

xray_enabled

A flag indicating whether to use AWS X-Ray tracing for this GraphqlApi .

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters:

x (Any) –

Return type:

bool

Returns:

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(x)

Check whether the given object is a CfnResource.

Parameters:

x (Any) –

Return type:

bool

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

AdditionalAuthenticationProviderProperty

class CfnGraphQLApi.AdditionalAuthenticationProviderProperty(*, authentication_type, lambda_authorizer_config=None, open_id_connect_config=None, user_pool_config=None)

Bases: object

Describes an additional authentication provider.

Parameters:
  • authentication_type (str) – The authentication type for API key, AWS Identity and Access Management , OIDC, Amazon Cognito user pools , or AWS Lambda . Valid Values: API_KEY | AWS_IAM | OPENID_CONNECT | AMAZON_COGNITO_USER_POOLS | AWS_LAMBDA

  • lambda_authorizer_config (Union[IResolvable, LambdaAuthorizerConfigProperty, Dict[str, Any], None]) – Configuration for AWS Lambda function authorization.

  • open_id_connect_config (Union[IResolvable, OpenIDConnectConfigProperty, Dict[str, Any], None]) – The OIDC configuration.

  • user_pool_config (Union[IResolvable, CognitoUserPoolConfigProperty, Dict[str, Any], None]) – The Amazon Cognito user pool configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

additional_authentication_provider_property = appsync.CfnGraphQLApi.AdditionalAuthenticationProviderProperty(
    authentication_type="authenticationType",

    # the properties below are optional
    lambda_authorizer_config=appsync.CfnGraphQLApi.LambdaAuthorizerConfigProperty(
        authorizer_result_ttl_in_seconds=123,
        authorizer_uri="authorizerUri",
        identity_validation_expression="identityValidationExpression"
    ),
    open_id_connect_config=appsync.CfnGraphQLApi.OpenIDConnectConfigProperty(
        auth_ttl=123,
        client_id="clientId",
        iat_ttl=123,
        issuer="issuer"
    ),
    user_pool_config=appsync.CfnGraphQLApi.CognitoUserPoolConfigProperty(
        app_id_client_regex="appIdClientRegex",
        aws_region="awsRegion",
        user_pool_id="userPoolId"
    )
)

Attributes

authentication_type

The authentication type for API key, AWS Identity and Access Management , OIDC, Amazon Cognito user pools , or AWS Lambda .

Valid Values: API_KEY | AWS_IAM | OPENID_CONNECT | AMAZON_COGNITO_USER_POOLS | AWS_LAMBDA

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-authenticationtype

lambda_authorizer_config

Configuration for AWS Lambda function authorization.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-lambdaauthorizerconfig

open_id_connect_config

The OIDC configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-openidconnectconfig

user_pool_config

The Amazon Cognito user pool configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-userpoolconfig

CognitoUserPoolConfigProperty

class CfnGraphQLApi.CognitoUserPoolConfigProperty(*, app_id_client_regex=None, aws_region=None, user_pool_id=None)

Bases: object

Describes an Amazon Cognito user pool configuration.

Parameters:
  • app_id_client_regex (Optional[str]) – A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn’t set, no filtering is applied.

  • aws_region (Optional[str]) – The AWS Region in which the user pool was created.

  • user_pool_id (Optional[str]) – The user pool ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-cognitouserpoolconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

cognito_user_pool_config_property = appsync.CfnGraphQLApi.CognitoUserPoolConfigProperty(
    app_id_client_regex="appIdClientRegex",
    aws_region="awsRegion",
    user_pool_id="userPoolId"
)

Attributes

app_id_client_regex

A regular expression for validating the incoming Amazon Cognito user pool app client ID.

If this value isn’t set, no filtering is applied.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-cognitouserpoolconfig.html#cfn-appsync-graphqlapi-cognitouserpoolconfig-appidclientregex

aws_region

The AWS Region in which the user pool was created.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-cognitouserpoolconfig.html#cfn-appsync-graphqlapi-cognitouserpoolconfig-awsregion

user_pool_id

The user pool ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-cognitouserpoolconfig.html#cfn-appsync-graphqlapi-cognitouserpoolconfig-userpoolid

EnhancedMetricsConfigProperty

class CfnGraphQLApi.EnhancedMetricsConfigProperty(*, data_source_level_metrics_behavior, operation_level_metrics_config, resolver_level_metrics_behavior)

Bases: object

Describes an enhanced metrics configuration.

Parameters:
  • data_source_level_metrics_behavior (str) – Controls how data source metrics will be emitted to CloudWatch. Data source metrics include:. - Requests : The number of invocations that occured during a request. - Latency : The time to complete a data source invocation. - Errors : The number of errors that occurred during a data source invocation. These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time: - FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request. - PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the MetricsConfig value set to ENABLED .

  • operation_level_metrics_config (str) – Controls how operation metrics will be emitted to CloudWatch. Operation metrics include:. - Requests : The number of times a specified GraphQL operation was called. - GraphQL errors : The number of GraphQL errors that occurred during a specified GraphQL operation. Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .

  • resolver_level_metrics_behavior (str) – Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include:. - GraphQL errors : The number of GraphQL errors that occurred. - Requests : The number of invocations that occurred during a request. - Latency : The time to complete a resolver invocation. - Cache hits : The number of cache hits during a request. - Cache misses : The number of cache misses during a request. These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time: - FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request. - PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the MetricsConfig value set to ENABLED .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-enhancedmetricsconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

enhanced_metrics_config_property = appsync.CfnGraphQLApi.EnhancedMetricsConfigProperty(
    data_source_level_metrics_behavior="dataSourceLevelMetricsBehavior",
    operation_level_metrics_config="operationLevelMetricsConfig",
    resolver_level_metrics_behavior="resolverLevelMetricsBehavior"
)

Attributes

data_source_level_metrics_behavior

.

  • Requests : The number of invocations that occured during a request.

  • Latency : The time to complete a data source invocation.

  • Errors : The number of errors that occurred during a data source invocation.

These metrics can be emitted to CloudWatch per data source or for all data sources in the request. Metrics will be recorded by API ID and data source name. dataSourceLevelMetricsBehavior accepts one of these values at a time:

  • FULL_REQUEST_DATA_SOURCE_METRICS : Records and emits metric data for all data sources in the request.

  • PER_DATA_SOURCE_METRICS : Records and emits metric data for data sources that have the MetricsConfig value set to ENABLED .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-enhancedmetricsconfig.html#cfn-appsync-graphqlapi-enhancedmetricsconfig-datasourcelevelmetricsbehavior

Type:

Controls how data source metrics will be emitted to CloudWatch. Data source metrics include

operation_level_metrics_config

.

  • Requests : The number of times a specified GraphQL operation was called.

  • GraphQL errors : The number of GraphQL errors that occurred during a specified GraphQL operation.

Metrics will be recorded by API ID and operation name. You can set the value to ENABLED or DISABLED .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-enhancedmetricsconfig.html#cfn-appsync-graphqlapi-enhancedmetricsconfig-operationlevelmetricsconfig

Type:

Controls how operation metrics will be emitted to CloudWatch. Operation metrics include

resolver_level_metrics_behavior

.

  • GraphQL errors : The number of GraphQL errors that occurred.

  • Requests : The number of invocations that occurred during a request.

  • Latency : The time to complete a resolver invocation.

  • Cache hits : The number of cache hits during a request.

  • Cache misses : The number of cache misses during a request.

These metrics can be emitted to CloudWatch per resolver or for all resolvers in the request. Metrics will be recorded by API ID and resolver name. resolverLevelMetricsBehavior accepts one of these values at a time:

  • FULL_REQUEST_RESOLVER_METRICS : Records and emits metric data for all resolvers in the request.

  • PER_RESOLVER_METRICS : Records and emits metric data for resolvers that have the MetricsConfig value set to ENABLED .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-enhancedmetricsconfig.html#cfn-appsync-graphqlapi-enhancedmetricsconfig-resolverlevelmetricsbehavior

Type:

Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include

LambdaAuthorizerConfigProperty

class CfnGraphQLApi.LambdaAuthorizerConfigProperty(*, authorizer_result_ttl_in_seconds=None, authorizer_uri=None, identity_validation_expression=None)

Bases: object

Configuration for AWS Lambda function authorization.

Parameters:
  • authorizer_result_ttl_in_seconds (Union[int, float, None]) – The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don’t specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

  • authorizer_uri (Optional[str]) – The ARN of the Lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN ( .../v3 ) or alias ARN. Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To do so with the AWS CLI , run the following: aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

  • identity_validation_expression (Optional[str]) – A regular expression for validation of tokens before the Lambda function is called.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

lambda_authorizer_config_property = appsync.CfnGraphQLApi.LambdaAuthorizerConfigProperty(
    authorizer_result_ttl_in_seconds=123,
    authorizer_uri="authorizerUri",
    identity_validation_expression="identityValidationExpression"
)

Attributes

authorizer_result_ttl_in_seconds

The number of seconds a response should be cached for.

The default is 0 seconds, which disables caching. If you don’t specify a value for authorizerResultTtlInSeconds , the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig-authorizerresultttlinseconds

authorizer_uri

The ARN of the Lambda function to be called for authorization.

This may be a standard Lambda ARN, a version ARN ( .../v3 ) or alias ARN.

Note : This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the console, this is done for you. To do so with the AWS CLI , run the following:

aws lambda add-permission --function-name "arn:aws:lambda:us-east-2:111122223333:function:my-function" --statement-id "appsync" --principal appsync.amazonaws.com --action lambda:InvokeFunction

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig-authorizeruri

identity_validation_expression

A regular expression for validation of tokens before the Lambda function is called.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig-identityvalidationexpression

LogConfigProperty

class CfnGraphQLApi.LogConfigProperty(*, cloud_watch_logs_role_arn=None, exclude_verbose_content=None, field_log_level=None)

Bases: object

The LogConfig property type specifies the logging configuration when writing GraphQL operations and tracing to Amazon CloudWatch for an AWS AppSync GraphQL API.

LogConfig is a property of the AWS::AppSync::GraphQLApi property type.

Parameters:
  • cloud_watch_logs_role_arn (Optional[str]) – The service role that AWS AppSync will assume to publish to Amazon CloudWatch Logs in your account.

  • exclude_verbose_content (Union[bool, IResolvable, None]) – Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

  • field_log_level (Optional[str]) – The field logging level. Values can be NONE, ERROR, or ALL. - NONE : No field-level logs are captured. - ERROR : Logs the following information only for the fields that are in error: - The error section in the server response. - Field-level errors. - The generated request/response functions that got resolved for error fields. - ALL : The following information is logged for all fields in the query: - Field-level tracing information. - The generated request/response functions that got resolved for each field.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

log_config_property = appsync.CfnGraphQLApi.LogConfigProperty(
    cloud_watch_logs_role_arn="cloudWatchLogsRoleArn",
    exclude_verbose_content=False,
    field_log_level="fieldLogLevel"
)

Attributes

cloud_watch_logs_role_arn

The service role that AWS AppSync will assume to publish to Amazon CloudWatch Logs in your account.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html#cfn-appsync-graphqlapi-logconfig-cloudwatchlogsrolearn

exclude_verbose_content

Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html#cfn-appsync-graphqlapi-logconfig-excludeverbosecontent

field_log_level

The field logging level. Values can be NONE, ERROR, or ALL.

  • NONE : No field-level logs are captured.

  • ERROR : Logs the following information only for the fields that are in error:

  • The error section in the server response.

  • Field-level errors.

  • The generated request/response functions that got resolved for error fields.

  • ALL : The following information is logged for all fields in the query:

  • Field-level tracing information.

  • The generated request/response functions that got resolved for each field.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-logconfig.html#cfn-appsync-graphqlapi-logconfig-fieldloglevel

OpenIDConnectConfigProperty

class CfnGraphQLApi.OpenIDConnectConfigProperty(*, auth_ttl=None, client_id=None, iat_ttl=None, issuer=None)

Bases: object

The OpenIDConnectConfig property type specifies the optional authorization configuration for using an OpenID Connect compliant service with your GraphQL endpoint for an AWS AppSync GraphQL API.

OpenIDConnectConfig is a property of the AWS::AppSync::GraphQLApi property type.

Parameters:
  • auth_ttl (Union[int, float, None]) – The number of milliseconds that a token is valid after being authenticated.

  • client_id (Optional[str]) – The client identifier of the Relying party at the OpenID identity provider. This identifier is typically obtained when the Relying party is registered with the OpenID identity provider. You can specify a regular expression so that AWS AppSync can validate against multiple client identifiers at a time.

  • iat_ttl (Union[int, float, None]) – The number of milliseconds that a token is valid after it’s issued to a user.

  • issuer (Optional[str]) – The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

open_iDConnect_config_property = appsync.CfnGraphQLApi.OpenIDConnectConfigProperty(
    auth_ttl=123,
    client_id="clientId",
    iat_ttl=123,
    issuer="issuer"
)

Attributes

auth_ttl

The number of milliseconds that a token is valid after being authenticated.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html#cfn-appsync-graphqlapi-openidconnectconfig-authttl

client_id

The client identifier of the Relying party at the OpenID identity provider.

This identifier is typically obtained when the Relying party is registered with the OpenID identity provider. You can specify a regular expression so that AWS AppSync can validate against multiple client identifiers at a time.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html#cfn-appsync-graphqlapi-openidconnectconfig-clientid

iat_ttl

The number of milliseconds that a token is valid after it’s issued to a user.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html#cfn-appsync-graphqlapi-openidconnectconfig-iatttl

issuer

The issuer for the OIDC configuration.

The issuer returned by discovery must exactly match the value of iss in the ID token.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html#cfn-appsync-graphqlapi-openidconnectconfig-issuer

UserPoolConfigProperty

class CfnGraphQLApi.UserPoolConfigProperty(*, app_id_client_regex=None, aws_region=None, default_action=None, user_pool_id=None)

Bases: object

The UserPoolConfig property type specifies the optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint for an AWS AppSync GraphQL API.

Parameters:
  • app_id_client_regex (Optional[str]) – A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn’t set, no filtering is applied.

  • aws_region (Optional[str]) – The AWS Region in which the user pool was created.

  • default_action (Optional[str]) – The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn’t match the Amazon Cognito user pool configuration. When specifying Amazon Cognito user pools as the default authentication, you must set the value for DefaultAction to ALLOW if specifying AdditionalAuthenticationProviders .

  • user_pool_id (Optional[str]) – The user pool ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

user_pool_config_property = appsync.CfnGraphQLApi.UserPoolConfigProperty(
    app_id_client_regex="appIdClientRegex",
    aws_region="awsRegion",
    default_action="defaultAction",
    user_pool_id="userPoolId"
)

Attributes

app_id_client_regex

A regular expression for validating the incoming Amazon Cognito user pool app client ID.

If this value isn’t set, no filtering is applied.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html#cfn-appsync-graphqlapi-userpoolconfig-appidclientregex

aws_region

The AWS Region in which the user pool was created.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html#cfn-appsync-graphqlapi-userpoolconfig-awsregion

default_action

The action that you want your GraphQL API to take when a request that uses Amazon Cognito user pool authentication doesn’t match the Amazon Cognito user pool configuration.

When specifying Amazon Cognito user pools as the default authentication, you must set the value for DefaultAction to ALLOW if specifying AdditionalAuthenticationProviders .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html#cfn-appsync-graphqlapi-userpoolconfig-defaultaction

user_pool_id

The user pool ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html#cfn-appsync-graphqlapi-userpoolconfig-userpoolid