stages
Creates, updates, deletes or gets a stage resource or lists stages in a region
Overview
| Name | stages |
| Type | Resource |
| Description | The ``AWS::ApiGateway::Stage`` resource creates a stage for a deployment. |
| Id | awscc.apigateway.stages |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
access_log_setting | object | The ``AccessLogSetting`` property type specifies settings for logging access in this stage.<br />``AccessLogSetting`` is a property of the [AWS::ApiGateway::Stage](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html) resource. |
cache_cluster_enabled | boolean | |
cache_cluster_size | string | |
canary_setting | object | |
client_certificate_id | string | |
deployment_id | string | |
description | string | |
documentation_version | string | |
method_settings | array | |
rest_api_id | string | |
stage_name | string | |
tags | array | |
tracing_enabled | boolean | |
variables | object | A map (string-to-string map) that defines the stage variables, where the variable name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. Values must match the following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
rest_api_id | string | |
stage_name | string | |
region | string | AWS region. |
For more information, see AWS::ApiGateway::Stage.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | stages | INSERT | RestApiId, region |
delete_resource | stages | DELETE | Identifier, region |
update_resource | stages | UPDATE | Identifier, PatchDocument, region |
list_resources | stages_list_only | SELECT | region |
get_resource | stages | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual stage.
SELECT
region,
access_log_setting,
cache_cluster_enabled,
cache_cluster_size,
canary_setting,
client_certificate_id,
deployment_id,
description,
documentation_version,
method_settings,
rest_api_id,
stage_name,
tags,
tracing_enabled,
variables
FROM awscc.apigateway.stages
WHERE
region = 'us-east-1' AND
Identifier = '{{ rest_api_id }}|{{ stage_name }}';
Lists all stages in a region.
SELECT
region,
rest_api_id,
stage_name
FROM awscc.apigateway.stages_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new stage resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.apigateway.stages (
RestApiId,
region
)
SELECT
'{{ rest_api_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.apigateway.stages (
AccessLogSetting,
CacheClusterEnabled,
CacheClusterSize,
CanarySetting,
ClientCertificateId,
DeploymentId,
Description,
DocumentationVersion,
MethodSettings,
RestApiId,
StageName,
Tags,
TracingEnabled,
Variables,
region
)
SELECT
'{{ access_log_setting }}',
'{{ cache_cluster_enabled }}',
'{{ cache_cluster_size }}',
'{{ canary_setting }}',
'{{ client_certificate_id }}',
'{{ deployment_id }}',
'{{ description }}',
'{{ documentation_version }}',
'{{ method_settings }}',
'{{ rest_api_id }}',
'{{ stage_name }}',
'{{ tags }}',
'{{ tracing_enabled }}',
'{{ variables }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: stage
props:
- name: access_log_setting
value:
destination_arn: '{{ destination_arn }}'
format: '{{ format }}'
- name: cache_cluster_enabled
value: '{{ cache_cluster_enabled }}'
- name: cache_cluster_size
value: '{{ cache_cluster_size }}'
- name: canary_setting
value:
deployment_id: '{{ deployment_id }}'
percent_traffic: null
stage_variable_overrides: {}
use_stage_cache: '{{ use_stage_cache }}'
- name: client_certificate_id
value: '{{ client_certificate_id }}'
- name: deployment_id
value: '{{ deployment_id }}'
- name: description
value: '{{ description }}'
- name: documentation_version
value: '{{ documentation_version }}'
- name: method_settings
value:
- cache_data_encrypted: '{{ cache_data_encrypted }}'
cache_ttl_in_seconds: '{{ cache_ttl_in_seconds }}'
caching_enabled: '{{ caching_enabled }}'
data_trace_enabled: '{{ data_trace_enabled }}'
http_method: '{{ http_method }}'
logging_level: '{{ logging_level }}'
metrics_enabled: '{{ metrics_enabled }}'
resource_path: '{{ resource_path }}'
throttling_burst_limit: '{{ throttling_burst_limit }}'
throttling_rate_limit: null
- name: rest_api_id
value: '{{ rest_api_id }}'
- name: stage_name
value: '{{ stage_name }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
- name: tracing_enabled
value: '{{ tracing_enabled }}'
- name: variables
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a stage resource, using stack-deploy.
/*+ update */
UPDATE awscc.apigateway.stages
SET PatchDocument = string('{{ {
"AccessLogSetting": access_log_setting,
"CacheClusterEnabled": cache_cluster_enabled,
"CacheClusterSize": cache_cluster_size,
"CanarySetting": canary_setting,
"ClientCertificateId": client_certificate_id,
"DeploymentId": deployment_id,
"Description": description,
"DocumentationVersion": documentation_version,
"MethodSettings": method_settings,
"Tags": tags,
"TracingEnabled": tracing_enabled,
"Variables": variables
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ stage_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.apigateway.stages
WHERE
Identifier = '{{ rest_api_id }}|{{ stage_name }}' AND
region = 'us-east-1';
Permissions
To operate on the stages resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
apigateway:POST,
apigateway:PATCH,
apigateway:GET,
apigateway:PUT
apigateway:GET
apigateway:GET,
apigateway:PATCH,
apigateway:PUT,
apigateway:DELETE
apigateway:DELETE
apigateway:GET