CfnGraphQLApiPropsMixin
- class aws_cdk.mixins_preview.aws_appsync.mixins.CfnGraphQLApiPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::AppSync::GraphQLApiresource 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
- Mixin:
true
- 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.mixins_preview import mixins from aws_cdk.mixins_preview.aws_appsync import mixins as appsync_mixins cfn_graph_qLApi_props_mixin = appsync_mixins.CfnGraphQLApiPropsMixin(appsync_mixins.CfnGraphQLApiMixinProps( additional_authentication_providers=[appsync_mixins.CfnGraphQLApiPropsMixin.AdditionalAuthenticationProviderProperty( authentication_type="authenticationType", lambda_authorizer_config=appsync_mixins.CfnGraphQLApiPropsMixin.LambdaAuthorizerConfigProperty( authorizer_result_ttl_in_seconds=123, authorizer_uri="authorizerUri", identity_validation_expression="identityValidationExpression" ), open_id_connect_config=appsync_mixins.CfnGraphQLApiPropsMixin.OpenIDConnectConfigProperty( auth_ttl=123, client_id="clientId", iat_ttl=123, issuer="issuer" ), user_pool_config=appsync_mixins.CfnGraphQLApiPropsMixin.CognitoUserPoolConfigProperty( app_id_client_regex="appIdClientRegex", aws_region="awsRegion", user_pool_id="userPoolId" ) )], api_type="apiType", authentication_type="authenticationType", enhanced_metrics_config=appsync_mixins.CfnGraphQLApiPropsMixin.EnhancedMetricsConfigProperty( data_source_level_metrics_behavior="dataSourceLevelMetricsBehavior", operation_level_metrics_config="operationLevelMetricsConfig", resolver_level_metrics_behavior="resolverLevelMetricsBehavior" ), environment_variables={ "environment_variables_key": "environmentVariables" }, introspection_config="introspectionConfig", lambda_authorizer_config=appsync_mixins.CfnGraphQLApiPropsMixin.LambdaAuthorizerConfigProperty( authorizer_result_ttl_in_seconds=123, authorizer_uri="authorizerUri", identity_validation_expression="identityValidationExpression" ), log_config=appsync_mixins.CfnGraphQLApiPropsMixin.LogConfigProperty( cloud_watch_logs_role_arn="cloudWatchLogsRoleArn", exclude_verbose_content=False, field_log_level="fieldLogLevel" ), merged_api_execution_role_arn="mergedApiExecutionRoleArn", name="name", open_id_connect_config=appsync_mixins.CfnGraphQLApiPropsMixin.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_mixins.CfnGraphQLApiPropsMixin.UserPoolConfigProperty( app_id_client_regex="appIdClientRegex", aws_region="awsRegion", default_action="defaultAction", user_pool_id="userPoolId" ), visibility="visibility", xray_enabled=False ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::AppSync::GraphQLApi.- Parameters:
props (
Union[CfnGraphQLApiMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['additionalAuthenticationProviders', 'apiType', 'authenticationType', 'enhancedMetricsConfig', 'environmentVariables', 'introspectionConfig', 'lambdaAuthorizerConfig', 'logConfig', 'mergedApiExecutionRoleArn', 'name', 'openIdConnectConfig', 'ownerContact', 'queryDepthLimit', 'resolverCountLimit', 'tags', 'userPoolConfig', 'visibility', 'xrayEnabled']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AdditionalAuthenticationProviderProperty
- class CfnGraphQLApiPropsMixin.AdditionalAuthenticationProviderProperty(*, authentication_type=None, lambda_authorizer_config=None, open_id_connect_config=None, user_pool_config=None)
Bases:
objectDescribes an additional authentication provider.
- Parameters:
authentication_type (
Optional[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_LAMBDAlambda_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:
- 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.mixins_preview.aws_appsync import mixins as appsync_mixins additional_authentication_provider_property = appsync_mixins.CfnGraphQLApiPropsMixin.AdditionalAuthenticationProviderProperty( authentication_type="authenticationType", lambda_authorizer_config=appsync_mixins.CfnGraphQLApiPropsMixin.LambdaAuthorizerConfigProperty( authorizer_result_ttl_in_seconds=123, authorizer_uri="authorizerUri", identity_validation_expression="identityValidationExpression" ), open_id_connect_config=appsync_mixins.CfnGraphQLApiPropsMixin.OpenIDConnectConfigProperty( auth_ttl=123, client_id="clientId", iat_ttl=123, issuer="issuer" ), user_pool_config=appsync_mixins.CfnGraphQLApiPropsMixin.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
- lambda_authorizer_config
Configuration for AWS Lambda function authorization.
- open_id_connect_config
The OIDC configuration.
- user_pool_config
The Amazon Cognito user pool configuration.
CognitoUserPoolConfigProperty
- class CfnGraphQLApiPropsMixin.CognitoUserPoolConfigProperty(*, app_id_client_regex=None, aws_region=None, user_pool_id=None)
Bases:
objectDescribes 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:
- 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.mixins_preview.aws_appsync import mixins as appsync_mixins cognito_user_pool_config_property = appsync_mixins.CfnGraphQLApiPropsMixin.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.
- aws_region
The AWS Region in which the user pool was created.
EnhancedMetricsConfigProperty
- class CfnGraphQLApiPropsMixin.EnhancedMetricsConfigProperty(*, data_source_level_metrics_behavior=None, operation_level_metrics_config=None, resolver_level_metrics_behavior=None)
Bases:
objectDescribes an enhanced metrics configuration.
- Parameters:
data_source_level_metrics_behavior (
Optional[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.dataSourceLevelMetricsBehavioraccepts 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 theMetricsConfigvalue set toENABLED.operation_level_metrics_config (
Optional[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 toENABLEDorDISABLED.resolver_level_metrics_behavior (
Optional[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.resolverLevelMetricsBehavioraccepts 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 theMetricsConfigvalue set toENABLED.
- See:
- 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.mixins_preview.aws_appsync import mixins as appsync_mixins enhanced_metrics_config_property = appsync_mixins.CfnGraphQLApiPropsMixin.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.
dataSourceLevelMetricsBehavioraccepts 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 theMetricsConfigvalue set toENABLED.
- See:
- 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
ENABLEDorDISABLED.- See:
- 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.
resolverLevelMetricsBehavioraccepts 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 theMetricsConfigvalue set toENABLED.
- See:
- Type:
Controls how resolver metrics will be emitted to CloudWatch. Resolver metrics include
LogConfigProperty
- class CfnGraphQLApiPropsMixin.LogConfigProperty(*, cloud_watch_logs_role_arn=None, exclude_verbose_content=None, field_log_level=None)
Bases:
objectThe
LogConfigproperty type specifies the logging configuration when writing GraphQL operations and tracing to Amazon CloudWatch for an AWS AppSync GraphQL API.LogConfigis 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, INFO, DEBUG, or ALL. - NONE : No field-level logs are captured. - ERROR : Logs the following information only for the fields that are in the error category: - The error section in the server response. - Field-level errors. - The generated request/response functions that got resolved for error fields. - INFO : Logs the following information only for the fields that are in the info and error categories: - Info-level messages. - The user messages sent through$util.log.infoandconsole.log. - Field-level tracing and mapping logs are not shown. - DEBUG : Logs the following information only for the fields that are in the debug, info, and error categories: - Debug-level messages. - The user messages sent through$util.log.info,$util.log.debug,console.log, andconsole.debug. - Field-level tracing and mapping logs are not shown. - ALL : The following information is logged for all fields in the query: - Field-level tracing information. - The generated request/response functions that were resolved for each field.
- See:
- 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.mixins_preview.aws_appsync import mixins as appsync_mixins log_config_property = appsync_mixins.CfnGraphQLApiPropsMixin.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.
- exclude_verbose_content
Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
- field_log_level
The field logging level. Values can be NONE, ERROR, INFO, DEBUG, or ALL.
NONE : No field-level logs are captured.
ERROR : Logs the following information only for the fields that are in the error category:
The error section in the server response.
Field-level errors.
The generated request/response functions that got resolved for error fields.
INFO : Logs the following information only for the fields that are in the info and error categories:
Info-level messages.
The user messages sent through
$util.log.infoandconsole.log.Field-level tracing and mapping logs are not shown.
DEBUG : Logs the following information only for the fields that are in the debug, info, and error categories:
Debug-level messages.
The user messages sent through
$util.log.info,$util.log.debug,console.log, andconsole.debug.Field-level tracing and mapping logs are not shown.
ALL : The following information is logged for all fields in the query:
Field-level tracing information.
The generated request/response functions that were resolved for each field.
OpenIDConnectConfigProperty
- class CfnGraphQLApiPropsMixin.OpenIDConnectConfigProperty(*, auth_ttl=None, client_id=None, iat_ttl=None, issuer=None)
Bases:
objectThe
OpenIDConnectConfigproperty type specifies the optional authorization configuration for using an OpenID Connect compliant service with your GraphQL endpoint for an AWS AppSync GraphQL API.OpenIDConnectConfigis 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 ofissin the ID token.
- See:
- 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.mixins_preview.aws_appsync import mixins as appsync_mixins open_iDConnect_config_property = appsync_mixins.CfnGraphQLApiPropsMixin.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.
- 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.
- iat_ttl
The number of milliseconds that a token is valid after it’s issued to a user.
- issuer
The issuer for the OIDC configuration.
The issuer returned by discovery must exactly match the value of
issin the ID token.
UserPoolConfigProperty
- class CfnGraphQLApiPropsMixin.UserPoolConfigProperty(*, app_id_client_regex=None, aws_region=None, default_action=None, user_pool_id=None)
Bases:
objectThe
UserPoolConfigproperty 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 forDefaultActiontoALLOWif specifyingAdditionalAuthenticationProviders.user_pool_id (
Optional[str]) – The user pool ID.
- See:
- 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.mixins_preview.aws_appsync import mixins as appsync_mixins user_pool_config_property = appsync_mixins.CfnGraphQLApiPropsMixin.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.
- aws_region
The AWS Region in which the user pool was created.
- 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
DefaultActiontoALLOWif specifyingAdditionalAuthenticationProviders.