CfnApiProps

class aws_cdk.aws_sam.CfnApiProps(*, stage_name, access_log_setting=None, auth=None, binary_media_types=None, cache_cluster_enabled=None, cache_cluster_size=None, canary_setting=None, cors=None, definition_body=None, definition_uri=None, description=None, disable_execute_api_endpoint=None, domain=None, endpoint_configuration=None, gateway_responses=None, method_settings=None, minimum_compression_size=None, models=None, name=None, open_api_version=None, tags=None, tracing_enabled=None, variables=None)

Bases: object

Properties for defining a CfnApi.

Parameters:
  • stage_name (str) – AWS::Serverless::Api.StageName.

  • access_log_setting (Union[AccessLogSettingProperty, Dict[str, Any], IResolvable, None]) – AWS::Serverless::Api.AccessLogSetting.

  • auth (Union[IResolvable, AuthProperty, Dict[str, Any], None]) – AWS::Serverless::Api.Auth.

  • binary_media_types (Optional[Sequence[str]]) – AWS::Serverless::Api.BinaryMediaTypes.

  • cache_cluster_enabled (Union[bool, IResolvable, None]) – AWS::Serverless::Api.CacheClusterEnabled.

  • cache_cluster_size (Optional[str]) – AWS::Serverless::Api.CacheClusterSize.

  • canary_setting (Union[IResolvable, CanarySettingProperty, Dict[str, Any], None]) – AWS::Serverless::Api.CanarySetting.

  • cors (Union[str, IResolvable, CorsConfigurationProperty, Dict[str, Any], None]) – AWS::Serverless::Api.Cors.

  • definition_body (Optional[Any]) – AWS::Serverless::Api.DefinitionBody.

  • definition_uri (Union[str, IResolvable, S3LocationProperty, Dict[str, Any], None]) – AWS::Serverless::Api.DefinitionUri.

  • description (Optional[str]) – AWS::Serverless::Api.Description.

  • disable_execute_api_endpoint (Union[bool, IResolvable, None]) – AWS::Serverless::Api.DisableExecuteApiEndpoint.

  • domain (Union[IResolvable, DomainConfigurationProperty, Dict[str, Any], None]) – AWS::Serverless::Api.Domain.

  • endpoint_configuration (Union[str, IResolvable, EndpointConfigurationProperty, Dict[str, Any], None]) – AWS::Serverless::Api.EndpointConfiguration.

  • gateway_responses (Optional[Any]) – AWS::Serverless::Api.GatewayResponses.

  • method_settings (Union[Sequence[Any], IResolvable, None]) – AWS::Serverless::Api.MethodSettings.

  • minimum_compression_size (Union[int, float, None]) – AWS::Serverless::Api.MinimumCompressionSize.

  • models (Optional[Any]) – AWS::Serverless::Api.Models.

  • name (Optional[str]) – AWS::Serverless::Api.Name.

  • open_api_version (Optional[str]) – AWS::Serverless::Api.OpenApiVersion.

  • tags (Optional[Mapping[str, str]]) – AWS::Serverless::Api.Tags.

  • tracing_enabled (Union[bool, IResolvable, None]) – AWS::Serverless::Api.TracingEnabled.

  • variables (Union[IResolvable, Mapping[str, str], None]) – AWS::Serverless::Api.Variables.

Link:

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

ExampleMetadata:

fixture=_generated

Example:

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

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

cfn_api_props = sam.CfnApiProps(
    stage_name="stageName",

    # the properties below are optional
    access_log_setting=sam.CfnApi.AccessLogSettingProperty(
        destination_arn="destinationArn",
        format="format"
    ),
    auth=sam.CfnApi.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.CfnApi.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.CfnApi.DomainConfigurationProperty(
        certificate_arn="certificateArn",
        domain_name="domainName",

        # the properties below are optional
        base_path=["basePath"],
        endpoint_configuration="endpointConfiguration",
        mutual_tls_authentication=sam.CfnApi.MutualTlsAuthenticationProperty(
            truststore_uri="truststoreUri",
            truststore_version="truststoreVersion"
        ),
        ownership_verification_certificate_arn="ownershipVerificationCertificateArn",
        route53=sam.CfnApi.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",
    tags={
        "tags_key": "tags"
    },
    tracing_enabled=False,
    variables={
        "variables_key": "variables"
    }
)

Attributes

access_log_setting

AWS::Serverless::Api.AccessLogSetting.

Link:

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

auth

AWS::Serverless::Api.Auth.

Link:

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

binary_media_types

AWS::Serverless::Api.BinaryMediaTypes.

Link:

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

cache_cluster_enabled

AWS::Serverless::Api.CacheClusterEnabled.

Link:

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

cache_cluster_size

AWS::Serverless::Api.CacheClusterSize.

Link:

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

canary_setting

AWS::Serverless::Api.CanarySetting.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-canarysetting

cors

AWS::Serverless::Api.Cors.

Link:

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

definition_body

AWS::Serverless::Api.DefinitionBody.

Link:

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

definition_uri

AWS::Serverless::Api.DefinitionUri.

Link:

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

description

AWS::Serverless::Api.Description.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-description

disable_execute_api_endpoint

AWS::Serverless::Api.DisableExecuteApiEndpoint.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-disableexecuteapiendpoint

domain

AWS::Serverless::Api.Domain.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-domain

endpoint_configuration

AWS::Serverless::Api.EndpointConfiguration.

Link:

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

gateway_responses

AWS::Serverless::Api.GatewayResponses.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-gatewayresponses

method_settings

AWS::Serverless::Api.MethodSettings.

Link:

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

minimum_compression_size

AWS::Serverless::Api.MinimumCompressionSize.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-minimumcompressionsize

models

AWS::Serverless::Api.Models.

Link:

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-models

name

AWS::Serverless::Api.Name.

Link:

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

open_api_version

AWS::Serverless::Api.OpenApiVersion.

Link:

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

stage_name

AWS::Serverless::Api.StageName.

Link:

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

tags

AWS::Serverless::Api.Tags.

Link:

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

tracing_enabled

AWS::Serverless::Api.TracingEnabled.

Link:

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

variables

AWS::Serverless::Api.Variables.

Link:

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