Class CfnApi

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:16.740Z") @Stability(Stable) public class CfnApi extends CfnResource implements IInspectable, ITaggable
https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessapi.

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())
         .alwaysDeploy(false)
         .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();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnApiProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getStageName

      @Stability(Stable) @NotNull public String getStageName()
    • setStageName

      @Stability(Stable) public void setStageName(@NotNull String value)
    • getAccessLogSetting

      @Stability(Stable) @Nullable public Object getAccessLogSetting()
    • setAccessLogSetting

      @Stability(Stable) public void setAccessLogSetting(@Nullable IResolvable value)
    • setAccessLogSetting

      @Stability(Stable) public void setAccessLogSetting(@Nullable CfnApi.AccessLogSettingProperty value)
    • getAlwaysDeploy

      @Stability(Stable) @Nullable public Object getAlwaysDeploy()
    • setAlwaysDeploy

      @Stability(Stable) public void setAlwaysDeploy(@Nullable Boolean value)
    • setAlwaysDeploy

      @Stability(Stable) public void setAlwaysDeploy(@Nullable IResolvable value)
    • getAuth

      @Stability(Stable) @Nullable public Object getAuth()
    • setAuth

      @Stability(Stable) public void setAuth(@Nullable IResolvable value)
    • setAuth

      @Stability(Stable) public void setAuth(@Nullable CfnApi.AuthProperty value)
    • getBinaryMediaTypes

      @Stability(Stable) @Nullable public List<String> getBinaryMediaTypes()
    • setBinaryMediaTypes

      @Stability(Stable) public void setBinaryMediaTypes(@Nullable List<String> value)
    • getCacheClusterEnabled

      @Stability(Stable) @Nullable public Object getCacheClusterEnabled()
    • setCacheClusterEnabled

      @Stability(Stable) public void setCacheClusterEnabled(@Nullable Boolean value)
    • setCacheClusterEnabled

      @Stability(Stable) public void setCacheClusterEnabled(@Nullable IResolvable value)
    • getCacheClusterSize

      @Stability(Stable) @Nullable public String getCacheClusterSize()
    • setCacheClusterSize

      @Stability(Stable) public void setCacheClusterSize(@Nullable String value)
    • getCanarySetting

      @Stability(Stable) @Nullable public Object getCanarySetting()
    • setCanarySetting

      @Stability(Stable) public void setCanarySetting(@Nullable IResolvable value)
    • setCanarySetting

      @Stability(Stable) public void setCanarySetting(@Nullable CfnApi.CanarySettingProperty value)
    • getCors

      @Stability(Stable) @Nullable public Object getCors()
    • setCors

      @Stability(Stable) public void setCors(@Nullable String value)
    • setCors

      @Stability(Stable) public void setCors(@Nullable IResolvable value)
    • setCors

      @Stability(Stable) public void setCors(@Nullable CfnApi.CorsConfigurationProperty value)
    • getDefinitionBody

      @Stability(Stable) @Nullable public Object getDefinitionBody()
    • setDefinitionBody

      @Stability(Stable) public void setDefinitionBody(@Nullable Object value)
    • getDefinitionUri

      @Stability(Stable) @Nullable public Object getDefinitionUri()
    • setDefinitionUri

      @Stability(Stable) public void setDefinitionUri(@Nullable String value)
    • setDefinitionUri

      @Stability(Stable) public void setDefinitionUri(@Nullable IResolvable value)
    • setDefinitionUri

      @Stability(Stable) public void setDefinitionUri(@Nullable CfnApi.S3LocationProperty value)
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
    • getDisableExecuteApiEndpoint

      @Stability(Stable) @Nullable public Object getDisableExecuteApiEndpoint()
    • setDisableExecuteApiEndpoint

      @Stability(Stable) public void setDisableExecuteApiEndpoint(@Nullable Boolean value)
    • setDisableExecuteApiEndpoint

      @Stability(Stable) public void setDisableExecuteApiEndpoint(@Nullable IResolvable value)
    • getDomain

      @Stability(Stable) @Nullable public Object getDomain()
    • setDomain

      @Stability(Stable) public void setDomain(@Nullable IResolvable value)
    • setDomain

      @Stability(Stable) public void setDomain(@Nullable CfnApi.DomainConfigurationProperty value)
    • getEndpointConfiguration

      @Stability(Stable) @Nullable public Object getEndpointConfiguration()
    • setEndpointConfiguration

      @Stability(Stable) public void setEndpointConfiguration(@Nullable String value)
    • setEndpointConfiguration

      @Stability(Stable) public void setEndpointConfiguration(@Nullable IResolvable value)
    • setEndpointConfiguration

      @Stability(Stable) public void setEndpointConfiguration(@Nullable CfnApi.EndpointConfigurationProperty value)
    • getGatewayResponses

      @Stability(Stable) @Nullable public Object getGatewayResponses()
    • setGatewayResponses

      @Stability(Stable) public void setGatewayResponses(@Nullable Object value)
    • getMethodSettings

      @Stability(Stable) @Nullable public Object getMethodSettings()
    • setMethodSettings

      @Stability(Stable) public void setMethodSettings(@Nullable List<Object> value)
    • setMethodSettings

      @Stability(Stable) public void setMethodSettings(@Nullable IResolvable value)
    • getMinimumCompressionSize

      @Stability(Stable) @Nullable public Number getMinimumCompressionSize()
    • setMinimumCompressionSize

      @Stability(Stable) public void setMinimumCompressionSize(@Nullable Number value)
    • getModels

      @Stability(Stable) @Nullable public Object getModels()
    • setModels

      @Stability(Stable) public void setModels(@Nullable Object value)
    • getName

      @Stability(Stable) @Nullable public String getName()
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
    • getOpenApiVersion

      @Stability(Stable) @Nullable public String getOpenApiVersion()
    • setOpenApiVersion

      @Stability(Stable) public void setOpenApiVersion(@Nullable String value)
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
    • getTracingEnabled

      @Stability(Stable) @Nullable public Object getTracingEnabled()
    • setTracingEnabled

      @Stability(Stable) public void setTracingEnabled(@Nullable Boolean value)
    • setTracingEnabled

      @Stability(Stable) public void setTracingEnabled(@Nullable IResolvable value)
    • getVariables

      @Stability(Stable) @Nullable public Object getVariables()
    • setVariables

      @Stability(Stable) public void setVariables(@Nullable IResolvable value)
    • setVariables

      @Stability(Stable) public void setVariables(@Nullable Map<String,String> value)