CfnDeploymentPropsMixin
- class aws_cdk.mixins_preview.aws_apigateway.mixins.CfnDeploymentPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::ApiGateway::Deploymentresource deploys an API GatewayRestApiresource to a stage so that clients can call the API over the internet.The stage acts as an environment.
- See:
- CloudformationResource:
AWS::ApiGateway::Deployment
- 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_apigateway import mixins as apigateway_mixins cfn_deployment_props_mixin = apigateway_mixins.CfnDeploymentPropsMixin(apigateway_mixins.CfnDeploymentMixinProps( deployment_canary_settings=apigateway_mixins.CfnDeploymentPropsMixin.DeploymentCanarySettingsProperty( percent_traffic=123, stage_variable_overrides={ "stage_variable_overrides_key": "stageVariableOverrides" }, use_stage_cache=False ), description="description", rest_api_id="restApiId", stage_description=apigateway_mixins.CfnDeploymentPropsMixin.StageDescriptionProperty( access_log_setting=apigateway_mixins.CfnDeploymentPropsMixin.AccessLogSettingProperty( destination_arn="destinationArn", format="format" ), cache_cluster_enabled=False, cache_cluster_size="cacheClusterSize", cache_data_encrypted=False, cache_ttl_in_seconds=123, caching_enabled=False, canary_setting=apigateway_mixins.CfnDeploymentPropsMixin.CanarySettingProperty( percent_traffic=123, stage_variable_overrides={ "stage_variable_overrides_key": "stageVariableOverrides" }, use_stage_cache=False ), client_certificate_id="clientCertificateId", data_trace_enabled=False, description="description", documentation_version="documentationVersion", logging_level="loggingLevel", method_settings=[apigateway_mixins.CfnDeploymentPropsMixin.MethodSettingProperty( cache_data_encrypted=False, cache_ttl_in_seconds=123, caching_enabled=False, data_trace_enabled=False, http_method="httpMethod", logging_level="loggingLevel", metrics_enabled=False, resource_path="resourcePath", throttling_burst_limit=123, throttling_rate_limit=123 )], metrics_enabled=False, tags=[CfnTag( key="key", value="value" )], throttling_burst_limit=123, throttling_rate_limit=123, tracing_enabled=False, variables={ "variables_key": "variables" } ), stage_name="stageName" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::ApiGateway::Deployment.- Parameters:
props (
Union[CfnDeploymentMixinProps,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 = ['deploymentCanarySettings', 'description', 'restApiId', 'stageDescription', 'stageName']
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
AccessLogSettingProperty
- class CfnDeploymentPropsMixin.AccessLogSettingProperty(*, destination_arn=None, format=None)
Bases:
objectThe
AccessLogSettingproperty type specifies settings for logging access in this stage.AccessLogSettingis a property of the StageDescription property type.- Parameters:
destination_arn (
Optional[str]) – The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin withamazon-apigateway-.format (
Optional[str]) – A single line format of the access logs of data, as specified by selected $context variables. The format must include at least$context.requestId.
- 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_apigateway import mixins as apigateway_mixins access_log_setting_property = apigateway_mixins.CfnDeploymentPropsMixin.AccessLogSettingProperty( destination_arn="destinationArn", format="format" )
Attributes
- destination_arn
The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs.
If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with
amazon-apigateway-.
- format
A single line format of the access logs of data, as specified by selected $context variables.
The format must include at least
$context.requestId.
CanarySettingProperty
- class CfnDeploymentPropsMixin.CanarySettingProperty(*, percent_traffic=None, stage_variable_overrides=None, use_stage_cache=None)
Bases:
objectThe
CanarySettingproperty type specifies settings for the canary deployment in this stage.CanarySettingis a property of the StageDescription property type.- Parameters:
percent_traffic (
Union[int,float,None]) – The percent (0-100) of traffic diverted to a canary deployment.stage_variable_overrides (
Union[Mapping[str,str],IResolvable,None]) – Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary. These stage variables are represented as a string-to-string map between stage variable names and their values.use_stage_cache (
Union[bool,IResolvable,None]) – A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
- 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_apigateway import mixins as apigateway_mixins canary_setting_property = apigateway_mixins.CfnDeploymentPropsMixin.CanarySettingProperty( percent_traffic=123, stage_variable_overrides={ "stage_variable_overrides_key": "stageVariableOverrides" }, use_stage_cache=False )
Attributes
- percent_traffic
The percent (0-100) of traffic diverted to a canary deployment.
- stage_variable_overrides
Stage variables overridden for a canary release deployment, including new stage variables introduced in the canary.
These stage variables are represented as a string-to-string map between stage variable names and their values.
- use_stage_cache
A Boolean flag to indicate whether the canary deployment uses the stage cache or not.
DeploymentCanarySettingsProperty
- class CfnDeploymentPropsMixin.DeploymentCanarySettingsProperty(*, percent_traffic=None, stage_variable_overrides=None, use_stage_cache=None)
Bases:
objectThe
DeploymentCanarySettingsproperty type specifies settings for the canary deployment.- Parameters:
percent_traffic (
Union[int,float,None]) – The percentage (0.0-100.0) of traffic routed to the canary deployment.stage_variable_overrides (
Union[Mapping[str,str],IResolvable,None]) – A stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.use_stage_cache (
Union[bool,IResolvable,None]) – A Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
- 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_apigateway import mixins as apigateway_mixins deployment_canary_settings_property = apigateway_mixins.CfnDeploymentPropsMixin.DeploymentCanarySettingsProperty( percent_traffic=123, stage_variable_overrides={ "stage_variable_overrides_key": "stageVariableOverrides" }, use_stage_cache=False )
Attributes
- percent_traffic
The percentage (0.0-100.0) of traffic routed to the canary deployment.
- stage_variable_overrides
A stage variable overrides used for the canary release deployment.
They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- use_stage_cache
A Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
MethodSettingProperty
- class CfnDeploymentPropsMixin.MethodSettingProperty(*, cache_data_encrypted=None, cache_ttl_in_seconds=None, caching_enabled=None, data_trace_enabled=None, http_method=None, logging_level=None, metrics_enabled=None, resource_path=None, throttling_burst_limit=None, throttling_rate_limit=None)
Bases:
objectThe
MethodSettingproperty type configures settings for all methods in a stage.If you modify this property type, you must create a new deployment for your API.
The
MethodSettingsproperty of the Amazon API Gateway Deployment StageDescription property type contains a list ofMethodSettingproperty types.- Parameters:
cache_data_encrypted (
Union[bool,IResolvable,None]) – Specifies whether the cached responses are encrypted.cache_ttl_in_seconds (
Union[int,float,None]) – Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached.caching_enabled (
Union[bool,IResolvable,None]) – Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached.data_trace_enabled (
Union[bool,IResolvable,None]) – Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don’t enable this option for production APIs.http_method (
Optional[str]) – The HTTP method.logging_level (
Optional[str]) – Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. Valid values areOFF,ERROR, andINFO. ChooseERRORto write only error-level entries to CloudWatch Logs, or chooseINFOto include allERRORevents as well as extra informational events.metrics_enabled (
Union[bool,IResolvable,None]) – Specifies whether Amazon CloudWatch metrics are enabled for this method.resource_path (
Optional[str]) – The resource path for this method. Forward slashes (/) are encoded as~1and the initial slash must include a forward slash. For example, the path value/resource/subresourcemust be encoded as/~1resource~1subresource. To specify the root path, use only a slash (/).throttling_burst_limit (
Union[int,float,None]) – Specifies the throttling burst limit.throttling_rate_limit (
Union[int,float,None]) – Specifies the throttling rate limit.
- 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_apigateway import mixins as apigateway_mixins method_setting_property = apigateway_mixins.CfnDeploymentPropsMixin.MethodSettingProperty( cache_data_encrypted=False, cache_ttl_in_seconds=123, caching_enabled=False, data_trace_enabled=False, http_method="httpMethod", logging_level="loggingLevel", metrics_enabled=False, resource_path="resourcePath", throttling_burst_limit=123, throttling_rate_limit=123 )
Attributes
- cache_data_encrypted
Specifies whether the cached responses are encrypted.
- cache_ttl_in_seconds
Specifies the time to live (TTL), in seconds, for cached responses.
The higher the TTL, the longer the response will be cached.
- caching_enabled
Specifies whether responses should be cached and returned for requests.
A cache cluster must be enabled on the stage for responses to be cached.
- data_trace_enabled
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs.
This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don’t enable this option for production APIs.
- http_method
The HTTP method.
- logging_level
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs.
Valid values are
OFF,ERROR, andINFO. ChooseERRORto write only error-level entries to CloudWatch Logs, or chooseINFOto include allERRORevents as well as extra informational events.
- metrics_enabled
Specifies whether Amazon CloudWatch metrics are enabled for this method.
- resource_path
The resource path for this method.
Forward slashes (
/) are encoded as~1and the initial slash must include a forward slash. For example, the path value/resource/subresourcemust be encoded as/~1resource~1subresource. To specify the root path, use only a slash (/).
- throttling_burst_limit
Specifies the throttling burst limit.
- throttling_rate_limit
Specifies the throttling rate limit.
StageDescriptionProperty
- class CfnDeploymentPropsMixin.StageDescriptionProperty(*, access_log_setting=None, cache_cluster_enabled=None, cache_cluster_size=None, cache_data_encrypted=None, cache_ttl_in_seconds=None, caching_enabled=None, canary_setting=None, client_certificate_id=None, data_trace_enabled=None, description=None, documentation_version=None, logging_level=None, method_settings=None, metrics_enabled=None, tags=None, throttling_burst_limit=None, throttling_rate_limit=None, tracing_enabled=None, variables=None)
Bases:
objectStageDescriptionis a property of the AWS::ApiGateway::Deployment resource that configures a deployment stage.- Parameters:
access_log_setting (
Union[IResolvable,AccessLogSettingProperty,Dict[str,Any],None]) – Specifies settings for logging access in this stage.cache_cluster_enabled (
Union[bool,IResolvable,None]) – Specifies whether a cache cluster is enabled for the stage. To activate a method-level cache, setCachingEnabledtotruefor a method.cache_cluster_size (
Optional[str]) – The size of the stage’s cache cluster. For more information, see cacheClusterSize in the API Gateway API Reference .cache_data_encrypted (
Union[bool,IResolvable,None]) – Indicates whether the cached responses are encrypted.cache_ttl_in_seconds (
Union[int,float,None]) – The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches responses.caching_enabled (
Union[bool,IResolvable,None]) – Indicates whether responses are cached and returned for requests. You must enable a cache cluster on the stage to cache responses. For more information, see Enable API Gateway Caching in a Stage to Enhance API Performance in the API Gateway Developer Guide .canary_setting (
Union[IResolvable,CanarySettingProperty,Dict[str,Any],None]) – Specifies settings for the canary deployment in this stage.client_certificate_id (
Optional[str]) – The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.data_trace_enabled (
Union[bool,IResolvable,None]) – Indicates whether data trace logging is enabled for methods in the stage. API Gateway pushes these logs to Amazon CloudWatch Logs.description (
Optional[str]) – A description of the purpose of the stage.documentation_version (
Optional[str]) – The version identifier of the API documentation snapshot.logging_level (
Optional[str]) – The logging level for this method. For valid values, see theloggingLevelproperty of the MethodSetting resource in the Amazon API Gateway API Reference .method_settings (
Union[IResolvable,Sequence[Union[IResolvable,MethodSettingProperty,Dict[str,Any]]],None]) – Configures settings for all of the stage’s methods.metrics_enabled (
Union[bool,IResolvable,None]) – Indicates whether Amazon CloudWatch metrics are enabled for methods in the stage.tags (
Optional[Sequence[Union[CfnTag,Dict[str,Any]]]]) – An array of arbitrary tags (key-value pairs) to associate with the stage.throttling_burst_limit (
Union[int,float,None]) – The target request burst rate limit. This allows more requests through for a period of time than the target rate limit. For more information, see Manage API Request Throttling in the API Gateway Developer Guide .throttling_rate_limit (
Union[int,float,None]) –The target request steady-state rate limit. For more information, see Manage API Request Throttling in the API Gateway Developer Guide .
tracing_enabled (
Union[bool,IResolvable,None]) – Specifies whether active tracing with X-ray is enabled for this stage. For more information, see Trace API Gateway API Execution with AWS X-Ray in the API Gateway Developer Guide .variables (
Union[Mapping[str,str],IResolvable,None]) – A map that defines the stage variables. Variable names must consist of alphanumeric characters, and the values must match the following regular expression:[A-Za-z0-9-._~:/?#&=,]+.
- 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_apigateway import mixins as apigateway_mixins stage_description_property = apigateway_mixins.CfnDeploymentPropsMixin.StageDescriptionProperty( access_log_setting=apigateway_mixins.CfnDeploymentPropsMixin.AccessLogSettingProperty( destination_arn="destinationArn", format="format" ), cache_cluster_enabled=False, cache_cluster_size="cacheClusterSize", cache_data_encrypted=False, cache_ttl_in_seconds=123, caching_enabled=False, canary_setting=apigateway_mixins.CfnDeploymentPropsMixin.CanarySettingProperty( percent_traffic=123, stage_variable_overrides={ "stage_variable_overrides_key": "stageVariableOverrides" }, use_stage_cache=False ), client_certificate_id="clientCertificateId", data_trace_enabled=False, description="description", documentation_version="documentationVersion", logging_level="loggingLevel", method_settings=[apigateway_mixins.CfnDeploymentPropsMixin.MethodSettingProperty( cache_data_encrypted=False, cache_ttl_in_seconds=123, caching_enabled=False, data_trace_enabled=False, http_method="httpMethod", logging_level="loggingLevel", metrics_enabled=False, resource_path="resourcePath", throttling_burst_limit=123, throttling_rate_limit=123 )], metrics_enabled=False, tags=[CfnTag( key="key", value="value" )], throttling_burst_limit=123, throttling_rate_limit=123, tracing_enabled=False, variables={ "variables_key": "variables" } )
Attributes
- access_log_setting
Specifies settings for logging access in this stage.
- cache_cluster_enabled
Specifies whether a cache cluster is enabled for the stage.
To activate a method-level cache, set
CachingEnabledtotruefor a method.
- cache_cluster_size
The size of the stage’s cache cluster.
For more information, see cacheClusterSize in the API Gateway API Reference .
- cache_data_encrypted
Indicates whether the cached responses are encrypted.
- cache_ttl_in_seconds
The time-to-live (TTL) period, in seconds, that specifies how long API Gateway caches responses.
- caching_enabled
Indicates whether responses are cached and returned for requests.
You must enable a cache cluster on the stage to cache responses. For more information, see Enable API Gateway Caching in a Stage to Enhance API Performance in the API Gateway Developer Guide .
- canary_setting
Specifies settings for the canary deployment in this stage.
- client_certificate_id
The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.
- data_trace_enabled
Indicates whether data trace logging is enabled for methods in the stage.
API Gateway pushes these logs to Amazon CloudWatch Logs.
- description
A description of the purpose of the stage.
- documentation_version
The version identifier of the API documentation snapshot.
- logging_level
The logging level for this method.
For valid values, see the
loggingLevelproperty of the MethodSetting resource in the Amazon API Gateway API Reference .
- method_settings
Configures settings for all of the stage’s methods.
- metrics_enabled
Indicates whether Amazon CloudWatch metrics are enabled for methods in the stage.
- tags
An array of arbitrary tags (key-value pairs) to associate with the stage.
- throttling_burst_limit
The target request burst rate limit.
This allows more requests through for a period of time than the target rate limit. For more information, see Manage API Request Throttling in the API Gateway Developer Guide .
- throttling_rate_limit
The target request steady-state rate limit.
For more information, see Manage API Request Throttling in the API Gateway Developer Guide .
- tracing_enabled
Specifies whether active tracing with X-ray is enabled for this stage.
For more information, see Trace API Gateway API Execution with AWS X-Ray in the API Gateway Developer Guide .
- variables
A map that defines the stage variables.
Variable names must consist of alphanumeric characters, and the values must match the following regular expression:
[A-Za-z0-9-._~:/?#&=,]+.