CfnApiPropsMixin

class aws_cdk.mixins_preview.aws_sam.mixins.CfnApiPropsMixin(props, *, strategy=None)

Bases: Mixin

https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessapi.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-serverless-api.html

CloudformationResource:

AWS::Serverless::Api

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_sam import mixins as sam_mixins

# authorizers: Any
# definition_body: Any
# gateway_responses: Any
# method_settings: Any
# models: Any

cfn_api_props_mixin = sam_mixins.CfnApiPropsMixin(sam_mixins.CfnApiMixinProps(
    access_log_setting=sam_mixins.CfnApiPropsMixin.AccessLogSettingProperty(
        destination_arn="destinationArn",
        format="format"
    ),
    always_deploy=False,
    auth=sam_mixins.CfnApiPropsMixin.AuthProperty(
        add_default_authorizer_to_cors_preflight=False,
        authorizers=authorizers,
        default_authorizer="defaultAuthorizer"
    ),
    binary_media_types=["binaryMediaTypes"],
    cache_cluster_enabled=False,
    cache_cluster_size="cacheClusterSize",
    canary_setting=sam_mixins.CfnApiPropsMixin.CanarySettingProperty(
        deployment_id="deploymentId",
        percent_traffic=123,
        stage_variable_overrides={
            "stage_variable_overrides_key": "stageVariableOverrides"
        },
        use_stage_cache=False
    ),
    cors="cors",
    definition_body=definition_body,
    definition_uri="definitionUri",
    description="description",
    disable_execute_api_endpoint=False,
    domain=sam_mixins.CfnApiPropsMixin.DomainConfigurationProperty(
        base_path=["basePath"],
        certificate_arn="certificateArn",
        domain_name="domainName",
        endpoint_configuration="endpointConfiguration",
        mutual_tls_authentication=sam_mixins.CfnApiPropsMixin.MutualTlsAuthenticationProperty(
            truststore_uri="truststoreUri",
            truststore_version="truststoreVersion"
        ),
        ownership_verification_certificate_arn="ownershipVerificationCertificateArn",
        route53=sam_mixins.CfnApiPropsMixin.Route53ConfigurationProperty(
            distributed_domain_name="distributedDomainName",
            evaluate_target_health=False,
            hosted_zone_id="hostedZoneId",
            hosted_zone_name="hostedZoneName",
            ip_v6=False
        ),
        security_policy="securityPolicy"
    ),
    endpoint_configuration="endpointConfiguration",
    gateway_responses=gateway_responses,
    method_settings=[method_settings],
    minimum_compression_size=123,
    models=models,
    name="name",
    open_api_version="openApiVersion",
    stage_name="stageName",
    tags={
        "tags_key": "tags"
    },
    tracing_enabled=False,
    variables={
        "variables_key": "variables"
    }
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Serverless::Api.

Parameters:
  • props (Union[CfnApiMixinProps, 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:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['accessLogSetting', 'alwaysDeploy', 'auth', 'binaryMediaTypes', 'cacheClusterEnabled', 'cacheClusterSize', 'canarySetting', 'cors', 'definitionBody', 'definitionUri', 'description', 'disableExecuteApiEndpoint', 'domain', 'endpointConfiguration', 'gatewayResponses', 'methodSettings', 'minimumCompressionSize', 'models', 'name', 'openApiVersion', 'stageName', 'tags', 'tracingEnabled', 'variables']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

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

Stability:

experimental

AccessLogSettingProperty

class CfnApiPropsMixin.AccessLogSettingProperty(*, destination_arn=None, format=None)

Bases: object

Parameters:
  • destination_arn (Optional[str])

  • format (Optional[str])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-accesslogsetting.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.mixins_preview.aws_sam import mixins as sam_mixins

access_log_setting_property = sam_mixins.CfnApiPropsMixin.AccessLogSettingProperty(
    destination_arn="destinationArn",
    format="format"
)

Attributes

destination_arn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-accesslogsetting.html#cfn-serverless-api-accesslogsetting-destinationarn

Type:

see

format

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-accesslogsetting.html#cfn-serverless-api-accesslogsetting-format

Type:

see

AuthProperty

class CfnApiPropsMixin.AuthProperty(*, add_default_authorizer_to_cors_preflight=None, authorizers=None, default_authorizer=None)

Bases: object

Parameters:
  • add_default_authorizer_to_cors_preflight (Union[bool, IResolvable, None])

  • authorizers (Any)

  • default_authorizer (Optional[str])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.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.mixins_preview.aws_sam import mixins as sam_mixins

# authorizers: Any

auth_property = sam_mixins.CfnApiPropsMixin.AuthProperty(
    add_default_authorizer_to_cors_preflight=False,
    authorizers=authorizers,
    default_authorizer="defaultAuthorizer"
)

Attributes

add_default_authorizer_to_cors_preflight

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.html#cfn-serverless-api-auth-adddefaultauthorizertocorspreflight

Type:

see

authorizers

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.html#cfn-serverless-api-auth-authorizers

Type:

see

default_authorizer

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-auth.html#cfn-serverless-api-auth-defaultauthorizer

Type:

see

CanarySettingProperty

class CfnApiPropsMixin.CanarySettingProperty(*, deployment_id=None, percent_traffic=None, stage_variable_overrides=None, use_stage_cache=None)

Bases: object

Parameters:
  • deployment_id (Optional[str])

  • percent_traffic (Union[int, float, None])

  • stage_variable_overrides (Union[Mapping[str, str], IResolvable, None])

  • use_stage_cache (Union[bool, IResolvable, None])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-canarysetting.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.mixins_preview.aws_sam import mixins as sam_mixins

canary_setting_property = sam_mixins.CfnApiPropsMixin.CanarySettingProperty(
    deployment_id="deploymentId",
    percent_traffic=123,
    stage_variable_overrides={
        "stage_variable_overrides_key": "stageVariableOverrides"
    },
    use_stage_cache=False
)

Attributes

deployment_id

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-canarysetting.html#cfn-serverless-api-canarysetting-deploymentid

Type:

see

percent_traffic

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-canarysetting.html#cfn-serverless-api-canarysetting-percenttraffic

Type:

see

stage_variable_overrides

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-canarysetting.html#cfn-serverless-api-canarysetting-stagevariableoverrides

Type:

see

use_stage_cache

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-canarysetting.html#cfn-serverless-api-canarysetting-usestagecache

Type:

see

CorsConfigurationProperty

class CfnApiPropsMixin.CorsConfigurationProperty(*, allow_credentials=None, allow_headers=None, allow_methods=None, allow_origin=None, max_age=None)

Bases: object

Parameters:
  • allow_credentials (Union[bool, IResolvable, None])

  • allow_headers (Optional[str])

  • allow_methods (Optional[str])

  • allow_origin (Optional[str])

  • max_age (Optional[str])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-corsconfiguration.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.mixins_preview.aws_sam import mixins as sam_mixins

cors_configuration_property = sam_mixins.CfnApiPropsMixin.CorsConfigurationProperty(
    allow_credentials=False,
    allow_headers="allowHeaders",
    allow_methods="allowMethods",
    allow_origin="allowOrigin",
    max_age="maxAge"
)

Attributes

allow_credentials

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-corsconfiguration.html#cfn-serverless-api-corsconfiguration-allowcredentials

Type:

see

allow_headers

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-corsconfiguration.html#cfn-serverless-api-corsconfiguration-allowheaders

Type:

see

allow_methods

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-corsconfiguration.html#cfn-serverless-api-corsconfiguration-allowmethods

Type:

see

allow_origin

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-corsconfiguration.html#cfn-serverless-api-corsconfiguration-alloworigin

Type:

see

max_age

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-corsconfiguration.html#cfn-serverless-api-corsconfiguration-maxage

Type:

see

DomainConfigurationProperty

class CfnApiPropsMixin.DomainConfigurationProperty(*, base_path=None, certificate_arn=None, domain_name=None, endpoint_configuration=None, mutual_tls_authentication=None, ownership_verification_certificate_arn=None, route53=None, security_policy=None)

Bases: object

Parameters:
  • base_path (Optional[Sequence[str]])

  • certificate_arn (Optional[str])

  • domain_name (Optional[str])

  • endpoint_configuration (Optional[str])

  • mutual_tls_authentication (Union[IResolvable, MutualTlsAuthenticationProperty, Dict[str, Any], None])

  • ownership_verification_certificate_arn (Optional[str])

  • route53 (Union[IResolvable, Route53ConfigurationProperty, Dict[str, Any], None])

  • security_policy (Optional[str])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.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.mixins_preview.aws_sam import mixins as sam_mixins

domain_configuration_property = sam_mixins.CfnApiPropsMixin.DomainConfigurationProperty(
    base_path=["basePath"],
    certificate_arn="certificateArn",
    domain_name="domainName",
    endpoint_configuration="endpointConfiguration",
    mutual_tls_authentication=sam_mixins.CfnApiPropsMixin.MutualTlsAuthenticationProperty(
        truststore_uri="truststoreUri",
        truststore_version="truststoreVersion"
    ),
    ownership_verification_certificate_arn="ownershipVerificationCertificateArn",
    route53=sam_mixins.CfnApiPropsMixin.Route53ConfigurationProperty(
        distributed_domain_name="distributedDomainName",
        evaluate_target_health=False,
        hosted_zone_id="hostedZoneId",
        hosted_zone_name="hostedZoneName",
        ip_v6=False
    ),
    security_policy="securityPolicy"
)

Attributes

base_path

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-basepath

Type:

see

certificate_arn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-certificatearn

Type:

see

domain_name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-domainname

Type:

see

endpoint_configuration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-endpointconfiguration

Type:

see

mutual_tls_authentication

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-mutualtlsauthentication

Type:

see

ownership_verification_certificate_arn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-ownershipverificationcertificatearn

Type:

see

route53

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-route53

Type:

see

security_policy

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-domainconfiguration.html#cfn-serverless-api-domainconfiguration-securitypolicy

Type:

see

EndpointConfigurationProperty

class CfnApiPropsMixin.EndpointConfigurationProperty(*, type=None, vpc_endpoint_ids=None)

Bases: object

Parameters:
  • type (Optional[str])

  • vpc_endpoint_ids (Optional[Sequence[str]])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-endpointconfiguration.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.mixins_preview.aws_sam import mixins as sam_mixins

endpoint_configuration_property = sam_mixins.CfnApiPropsMixin.EndpointConfigurationProperty(
    type="type",
    vpc_endpoint_ids=["vpcEndpointIds"]
)

Attributes

type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-endpointconfiguration.html#cfn-serverless-api-endpointconfiguration-type

Type:

see

vpc_endpoint_ids

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-endpointconfiguration.html#cfn-serverless-api-endpointconfiguration-vpcendpointids

Type:

see

MutualTlsAuthenticationProperty

class CfnApiPropsMixin.MutualTlsAuthenticationProperty(*, truststore_uri=None, truststore_version=None)

Bases: object

Parameters:
  • truststore_uri (Optional[str])

  • truststore_version (Optional[str])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-mutualtlsauthentication.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.mixins_preview.aws_sam import mixins as sam_mixins

mutual_tls_authentication_property = sam_mixins.CfnApiPropsMixin.MutualTlsAuthenticationProperty(
    truststore_uri="truststoreUri",
    truststore_version="truststoreVersion"
)

Attributes

truststore_uri

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-mutualtlsauthentication.html#cfn-serverless-api-mutualtlsauthentication-truststoreuri

Type:

see

truststore_version

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-mutualtlsauthentication.html#cfn-serverless-api-mutualtlsauthentication-truststoreversion

Type:

see

Route53ConfigurationProperty

class CfnApiPropsMixin.Route53ConfigurationProperty(*, distributed_domain_name=None, evaluate_target_health=None, hosted_zone_id=None, hosted_zone_name=None, ip_v6=None)

Bases: object

Parameters:
  • distributed_domain_name (Optional[str])

  • evaluate_target_health (Union[bool, IResolvable, None])

  • hosted_zone_id (Optional[str])

  • hosted_zone_name (Optional[str])

  • ip_v6 (Union[bool, IResolvable, None])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-route53configuration.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.mixins_preview.aws_sam import mixins as sam_mixins

route53_configuration_property = sam_mixins.CfnApiPropsMixin.Route53ConfigurationProperty(
    distributed_domain_name="distributedDomainName",
    evaluate_target_health=False,
    hosted_zone_id="hostedZoneId",
    hosted_zone_name="hostedZoneName",
    ip_v6=False
)

Attributes

distributed_domain_name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-route53configuration.html#cfn-serverless-api-route53configuration-distributeddomainname

Type:

see

evaluate_target_health

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-route53configuration.html#cfn-serverless-api-route53configuration-evaluatetargethealth

Type:

see

hosted_zone_id

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-route53configuration.html#cfn-serverless-api-route53configuration-hostedzoneid

Type:

see

hosted_zone_name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-route53configuration.html#cfn-serverless-api-route53configuration-hostedzonename

Type:

see

ip_v6

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-route53configuration.html#cfn-serverless-api-route53configuration-ipv6

Type:

see

S3LocationProperty

class CfnApiPropsMixin.S3LocationProperty(*, bucket=None, key=None, version=None)

Bases: object

Parameters:
  • bucket (Optional[str])

  • key (Optional[str])

  • version (Union[int, float, None])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-s3location.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.mixins_preview.aws_sam import mixins as sam_mixins

s3_location_property = sam_mixins.CfnApiPropsMixin.S3LocationProperty(
    bucket="bucket",
    key="key",
    version=123
)

Attributes

bucket

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-s3location.html#cfn-serverless-api-s3location-bucket

Type:

see

key

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-s3location.html#cfn-serverless-api-s3location-key

Type:

see

version

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-serverless-api-s3location.html#cfn-serverless-api-s3location-version

Type:

see