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 | aws.apigateway.stages |
Fields
| Name | Datatype | Description |
|---|---|---|
access_log_setting | object | The AccessLogSetting property type specifies settings for logging access in this stage.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. |
For more information, see AWS::ApiGateway::Stage.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | RestApiId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT examples
Gets all stages in a region.
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 aws.apigateway.stages
WHERE region = 'us-east-1';
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 aws.apigateway.stages
WHERE region = 'us-east-1' AND data__Identifier = '<RestApiId>|<StageName>';
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 aws.apigateway.stages (
RestApiId,
region
)
SELECT
'{{ RestApiId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.apigateway.stages (
AccessLogSetting,
CacheClusterEnabled,
CacheClusterSize,
CanarySetting,
ClientCertificateId,
DeploymentId,
Description,
DocumentationVersion,
MethodSettings,
RestApiId,
StageName,
Tags,
TracingEnabled,
Variables,
region
)
SELECT
'{{ AccessLogSetting }}',
'{{ CacheClusterEnabled }}',
'{{ CacheClusterSize }}',
'{{ CanarySetting }}',
'{{ ClientCertificateId }}',
'{{ DeploymentId }}',
'{{ Description }}',
'{{ DocumentationVersion }}',
'{{ MethodSettings }}',
'{{ RestApiId }}',
'{{ StageName }}',
'{{ Tags }}',
'{{ TracingEnabled }}',
'{{ Variables }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: stage
props:
- name: AccessLogSetting
value:
DestinationArn: '{{ DestinationArn }}'
Format: '{{ Format }}'
- name: CacheClusterEnabled
value: '{{ CacheClusterEnabled }}'
- name: CacheClusterSize
value: '{{ CacheClusterSize }}'
- name: CanarySetting
value:
DeploymentId: '{{ DeploymentId }}'
PercentTraffic: null
StageVariableOverrides: {}
UseStageCache: '{{ UseStageCache }}'
- name: ClientCertificateId
value: '{{ ClientCertificateId }}'
- name: DeploymentId
value: '{{ DeploymentId }}'
- name: Description
value: '{{ Description }}'
- name: DocumentationVersion
value: '{{ DocumentationVersion }}'
- name: MethodSettings
value:
- CacheDataEncrypted: '{{ CacheDataEncrypted }}'
CacheTtlInSeconds: '{{ CacheTtlInSeconds }}'
CachingEnabled: '{{ CachingEnabled }}'
DataTraceEnabled: '{{ DataTraceEnabled }}'
HttpMethod: '{{ HttpMethod }}'
LoggingLevel: '{{ LoggingLevel }}'
MetricsEnabled: '{{ MetricsEnabled }}'
ResourcePath: '{{ ResourcePath }}'
ThrottlingBurstLimit: '{{ ThrottlingBurstLimit }}'
ThrottlingRateLimit: null
- name: RestApiId
value: '{{ RestApiId }}'
- name: StageName
value: '{{ StageName }}'
- name: Tags
value:
- Value: '{{ Value }}'
Key: '{{ Key }}'
- name: TracingEnabled
value: '{{ TracingEnabled }}'
- name: Variables
value: {}
DELETE example
/*+ delete */
DELETE FROM aws.apigateway.stages
WHERE data__Identifier = '<RestApiId|StageName>'
AND region = 'us-east-1';
Permissions
To operate on the stages resource, the following permissions are required:
Create
apigateway:POST,
apigateway:PATCH,
apigateway:GET,
apigateway:PUT
Read
apigateway:GET
Update
apigateway:GET,
apigateway:PATCH,
apigateway:PUT,
apigateway:DELETE
Delete
apigateway:DELETE
List
apigateway:GET