Class CfnApi

All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:35.577Z") @Stability(Stable) public class CfnApi extends CfnResource implements IInspectable
A CloudFormation AWS::Serverless::Api.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.sam.*;
 Object authorizers;
 Object definitionBody;
 Object gatewayResponses;
 Object methodSettings;
 Object models;
 CfnApi cfnApi = CfnApi.Builder.create(this, "MyCfnApi")
         .stageName("stageName")
         // the properties below are optional
         .accessLogSetting(AccessLogSettingProperty.builder()
                 .destinationArn("destinationArn")
                 .format("format")
                 .build())
         .auth(AuthProperty.builder()
                 .addDefaultAuthorizerToCorsPreflight(false)
                 .authorizers(authorizers)
                 .defaultAuthorizer("defaultAuthorizer")
                 .build())
         .binaryMediaTypes(List.of("binaryMediaTypes"))
         .cacheClusterEnabled(false)
         .cacheClusterSize("cacheClusterSize")
         .canarySetting(CanarySettingProperty.builder()
                 .deploymentId("deploymentId")
                 .percentTraffic(123)
                 .stageVariableOverrides(Map.of(
                         "stageVariableOverridesKey", "stageVariableOverrides"))
                 .useStageCache(false)
                 .build())
         .cors("cors")
         .definitionBody(definitionBody)
         .definitionUri("definitionUri")
         .description("description")
         .disableExecuteApiEndpoint(false)
         .domain(DomainConfigurationProperty.builder()
                 .certificateArn("certificateArn")
                 .domainName("domainName")
                 // the properties below are optional
                 .basePath(List.of("basePath"))
                 .endpointConfiguration("endpointConfiguration")
                 .mutualTlsAuthentication(MutualTlsAuthenticationProperty.builder()
                         .truststoreUri("truststoreUri")
                         .truststoreVersion("truststoreVersion")
                         .build())
                 .ownershipVerificationCertificateArn("ownershipVerificationCertificateArn")
                 .route53(Route53ConfigurationProperty.builder()
                         .distributedDomainName("distributedDomainName")
                         .evaluateTargetHealth(false)
                         .hostedZoneId("hostedZoneId")
                         .hostedZoneName("hostedZoneName")
                         .ipV6(false)
                         .build())
                 .securityPolicy("securityPolicy")
                 .build())
         .endpointConfiguration("endpointConfiguration")
         .gatewayResponses(gatewayResponses)
         .methodSettings(List.of(methodSettings))
         .minimumCompressionSize(123)
         .models(models)
         .name("name")
         .openApiVersion("openApiVersion")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .tracingEnabled(false)
         .variables(Map.of(
                 "variablesKey", "variables"))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
    • REQUIRED_TRANSFORM

      @Stability(Stable) public static final String REQUIRED_TRANSFORM
      The Transform a template must use in order to use this resource.
  • Constructor Details

    • CfnApi

      protected CfnApi(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnApi

      protected CfnApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnApi

      @Stability(Stable) public CfnApi(@NotNull Construct scope, @NotNull String id, @NotNull CfnApiProps props)
      Create a new AWS::Serverless::Api.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      AWS::Serverless::Api.Tags.
    • getDefinitionBody

      @Stability(Stable) @NotNull public Object getDefinitionBody()
      AWS::Serverless::Api.DefinitionBody.
    • setDefinitionBody

      @Stability(Stable) public void setDefinitionBody(@NotNull Object value)
      AWS::Serverless::Api.DefinitionBody.
    • getGatewayResponses

      @Stability(Stable) @NotNull public Object getGatewayResponses()
      AWS::Serverless::Api.GatewayResponses.
    • setGatewayResponses

      @Stability(Stable) public void setGatewayResponses(@NotNull Object value)
      AWS::Serverless::Api.GatewayResponses.
    • getModels

      @Stability(Stable) @NotNull public Object getModels()
      AWS::Serverless::Api.Models.
    • setModels

      @Stability(Stable) public void setModels(@NotNull Object value)
      AWS::Serverless::Api.Models.
    • getStageName

      @Stability(Stable) @NotNull public String getStageName()
      AWS::Serverless::Api.StageName.
    • setStageName

      @Stability(Stable) public void setStageName(@NotNull String value)
      AWS::Serverless::Api.StageName.
    • getAccessLogSetting

      @Stability(Stable) @Nullable public Object getAccessLogSetting()
      AWS::Serverless::Api.AccessLogSetting.
    • setAccessLogSetting

      @Stability(Stable) public void setAccessLogSetting(@Nullable CfnApi.AccessLogSettingProperty value)
      AWS::Serverless::Api.AccessLogSetting.
    • setAccessLogSetting

      @Stability(Stable) public void setAccessLogSetting(@Nullable IResolvable value)
      AWS::Serverless::Api.AccessLogSetting.
    • getAuth

      @Stability(Stable) @Nullable public Object getAuth()
      AWS::Serverless::Api.Auth.
    • setAuth

      @Stability(Stable) public void setAuth(@Nullable IResolvable value)
      AWS::Serverless::Api.Auth.
    • setAuth

      @Stability(Stable) public void setAuth(@Nullable CfnApi.AuthProperty value)
      AWS::Serverless::Api.Auth.
    • getBinaryMediaTypes

      @Stability(Stable) @Nullable public List<String> getBinaryMediaTypes()
      AWS::Serverless::Api.BinaryMediaTypes.
    • setBinaryMediaTypes

      @Stability(Stable) public void setBinaryMediaTypes(@Nullable List<String> value)
      AWS::Serverless::Api.BinaryMediaTypes.
    • getCacheClusterEnabled

      @Stability(Stable) @Nullable public Object getCacheClusterEnabled()
      AWS::Serverless::Api.CacheClusterEnabled.
    • setCacheClusterEnabled

      @Stability(Stable) public void setCacheClusterEnabled(@Nullable Boolean value)
      AWS::Serverless::Api.CacheClusterEnabled.
    • setCacheClusterEnabled

      @Stability(Stable) public void setCacheClusterEnabled(@Nullable IResolvable value)
      AWS::Serverless::Api.CacheClusterEnabled.
    • getCacheClusterSize

      @Stability(Stable) @Nullable public String getCacheClusterSize()
      AWS::Serverless::Api.CacheClusterSize.
    • setCacheClusterSize

      @Stability(Stable) public void setCacheClusterSize(@Nullable String value)
      AWS::Serverless::Api.CacheClusterSize.
    • getCanarySetting

      @Stability(Stable) @Nullable public Object getCanarySetting()
      AWS::Serverless::Api.CanarySetting.
    • setCanarySetting

      @Stability(Stable) public void setCanarySetting(@Nullable IResolvable value)
      AWS::Serverless::Api.CanarySetting.
    • setCanarySetting

      @Stability(Stable) public void setCanarySetting(@Nullable CfnApi.CanarySettingProperty value)
      AWS::Serverless::Api.CanarySetting.
    • getCors

      @Stability(Stable) @Nullable public Object getCors()
      AWS::Serverless::Api.Cors.
    • setCors

      @Stability(Stable) public void setCors(@Nullable String value)
      AWS::Serverless::Api.Cors.
    • setCors

      @Stability(Stable) public void setCors(@Nullable IResolvable value)
      AWS::Serverless::Api.Cors.
    • setCors

      @Stability(Stable) public void setCors(@Nullable CfnApi.CorsConfigurationProperty value)
      AWS::Serverless::Api.Cors.
    • getDefinitionUri

      @Stability(Stable) @Nullable public Object getDefinitionUri()
      AWS::Serverless::Api.DefinitionUri.
    • setDefinitionUri

      @Stability(Stable) public void setDefinitionUri(@Nullable String value)
      AWS::Serverless::Api.DefinitionUri.
    • setDefinitionUri

      @Stability(Stable) public void setDefinitionUri(@Nullable IResolvable value)
      AWS::Serverless::Api.DefinitionUri.
    • setDefinitionUri

      @Stability(Stable) public void setDefinitionUri(@Nullable CfnApi.S3LocationProperty value)
      AWS::Serverless::Api.DefinitionUri.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      AWS::Serverless::Api.Description.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      AWS::Serverless::Api.Description.
    • getDisableExecuteApiEndpoint

      @Stability(Stable) @Nullable public Object getDisableExecuteApiEndpoint()
      AWS::Serverless::Api.DisableExecuteApiEndpoint.
    • setDisableExecuteApiEndpoint

      @Stability(Stable) public void setDisableExecuteApiEndpoint(@Nullable Boolean value)
      AWS::Serverless::Api.DisableExecuteApiEndpoint.
    • setDisableExecuteApiEndpoint

      @Stability(Stable) public void setDisableExecuteApiEndpoint(@Nullable IResolvable value)
      AWS::Serverless::Api.DisableExecuteApiEndpoint.
    • getDomain

      @Stability(Stable) @Nullable public Object getDomain()
      AWS::Serverless::Api.Domain.
    • setDomain

      @Stability(Stable) public void setDomain(@Nullable IResolvable value)
      AWS::Serverless::Api.Domain.
    • setDomain

      @Stability(Stable) public void setDomain(@Nullable CfnApi.DomainConfigurationProperty value)
      AWS::Serverless::Api.Domain.
    • getEndpointConfiguration

      @Stability(Stable) @Nullable public Object getEndpointConfiguration()
      AWS::Serverless::Api.EndpointConfiguration.
    • setEndpointConfiguration

      @Stability(Stable) public void setEndpointConfiguration(@Nullable String value)
      AWS::Serverless::Api.EndpointConfiguration.
    • setEndpointConfiguration

      @Stability(Stable) public void setEndpointConfiguration(@Nullable IResolvable value)
      AWS::Serverless::Api.EndpointConfiguration.
    • setEndpointConfiguration

      @Stability(Stable) public void setEndpointConfiguration(@Nullable CfnApi.EndpointConfigurationProperty value)
      AWS::Serverless::Api.EndpointConfiguration.
    • getMethodSettings

      @Stability(Stable) @Nullable public Object getMethodSettings()
      AWS::Serverless::Api.MethodSettings.
    • setMethodSettings

      @Stability(Stable) public void setMethodSettings(@Nullable List<Object> value)
      AWS::Serverless::Api.MethodSettings.
    • setMethodSettings

      @Stability(Stable) public void setMethodSettings(@Nullable IResolvable value)
      AWS::Serverless::Api.MethodSettings.
    • getMinimumCompressionSize

      @Stability(Stable) @Nullable public Number getMinimumCompressionSize()
      AWS::Serverless::Api.MinimumCompressionSize.
    • setMinimumCompressionSize

      @Stability(Stable) public void setMinimumCompressionSize(@Nullable Number value)
      AWS::Serverless::Api.MinimumCompressionSize.
    • getName

      @Stability(Stable) @Nullable public String getName()
      AWS::Serverless::Api.Name.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      AWS::Serverless::Api.Name.
    • getOpenApiVersion

      @Stability(Stable) @Nullable public String getOpenApiVersion()
      AWS::Serverless::Api.OpenApiVersion.
    • setOpenApiVersion

      @Stability(Stable) public void setOpenApiVersion(@Nullable String value)
      AWS::Serverless::Api.OpenApiVersion.
    • getTracingEnabled

      @Stability(Stable) @Nullable public Object getTracingEnabled()
      AWS::Serverless::Api.TracingEnabled.
    • setTracingEnabled

      @Stability(Stable) public void setTracingEnabled(@Nullable Boolean value)
      AWS::Serverless::Api.TracingEnabled.
    • setTracingEnabled

      @Stability(Stable) public void setTracingEnabled(@Nullable IResolvable value)
      AWS::Serverless::Api.TracingEnabled.
    • getVariables

      @Stability(Stable) @Nullable public Object getVariables()
      AWS::Serverless::Api.Variables.
    • setVariables

      @Stability(Stable) public void setVariables(@Nullable IResolvable value)
      AWS::Serverless::Api.Variables.
    • setVariables

      @Stability(Stable) public void setVariables(@Nullable Map<String,String> value)
      AWS::Serverless::Api.Variables.