stages
Creates, updates, deletes, gets or lists a stages resource.
Overview
| Name | stages |
| Type | Resource |
| Id | aws.apigateway.stages |
Fields
The following fields are returned by SELECT queries:
- get_stage
- get_stages
| Name | Datatype | Description |
|---|---|---|
access_log_settings | object | Settings for logging access in this stage. |
cache_cluster_enabled | boolean | Specifies whether a cache cluster is enabled for the stage. To activate a method-level cache, set CachingEnabled to true for a method. |
cache_cluster_size | string | Returns the size of the CacheCluster. (0.5, 1.6, 6.1, 13.5, 28.4, 58.2, 118, 237) |
cache_cluster_status | string | The status of the cache cluster for the stage, if enabled. (CREATE_IN_PROGRESS, AVAILABLE, DELETE_IN_PROGRESS, NOT_AVAILABLE, FLUSH_IN_PROGRESS) |
canary_settings | object | Configuration settings of a canary deployment. |
client_certificate_id | string | The identifier of a client certificate for an API stage. |
created_date | string (date-time) | The timestamp when the stage was created. |
deployment_id | string | The identifier of the Deployment that the stage points to. |
description | string | The stage's description. |
documentation_version | string | The version of the associated API documentation. |
last_updated_date | string (date-time) | The timestamp when the stage last updated. |
method_settings | object | A map that defines the method settings for a Stage resource. Keys (designated as /{method_setting_key below) are method paths defined as {resource_path}/{http_method} for an individual method override, or /*/* for overriding all methods in the stage. |
stage_name | string | The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters. |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
tracing_enabled | boolean | Specifies whether active tracing with X-ray is enabled for the Stage. |
variables | object | A map that defines the stage variables for a Stage resource. Variable names can have alphanumeric and underscore characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+. |
web_acl_arn | string | The ARN of the WebAcl associated with the Stage. |
| Name | Datatype | Description |
|---|---|---|
item | array | The current page of elements from this collection. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_stage | select | restapi_id, stage_name, region | Gets information about a Stage resource. | |
get_stages | select | restapi_id, region | deploymentId | Gets information about one or more Stage resources. |
create_stage | insert | restapi_id, region, stageName, deploymentId | Creates a new Stage resource that references a pre-existing Deployment for the API. | |
update_stage | update | restapi_id, stage_name, region | Changes information about a Stage resource. | |
delete_stage | delete | restapi_id, stage_name, region | Deletes a Stage resource. | |
flush_stage_authorizers_cache | exec | restapi_id, stage_name, region | Flushes all authorizer cache entries on a stage. | |
flush_stage_cache | exec | restapi_id, stage_name, region | Flushes a stage's cache. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
restapi_id | string | The string identifier of the associated RestApi. |
stage_name | string | The name of the stage to flush its cache. |
deploymentId | string | The stages' deployment identifiers. |
SELECT examples
- get_stage
- get_stages
Gets information about a Stage resource.
SELECT
access_log_settings,
cache_cluster_enabled,
cache_cluster_size,
cache_cluster_status,
canary_settings,
client_certificate_id,
created_date,
deployment_id,
description,
documentation_version,
last_updated_date,
method_settings,
stage_name,
tags,
tracing_enabled,
variables,
web_acl_arn
FROM aws.apigateway.stages
WHERE restapi_id = '{{ restapi_id }}' -- required
AND stage_name = '{{ stage_name }}' -- required
AND region = '{{ region }}' -- required
;
Gets information about one or more Stage resources.
SELECT
item
FROM aws.apigateway.stages
WHERE restapi_id = '{{ restapi_id }}' -- required
AND region = '{{ region }}' -- required
AND deploymentId = '{{ deploymentId }}'
;
INSERT examples
- create_stage
- Manifest
Creates a new Stage resource that references a pre-existing Deployment for the API.
INSERT INTO aws.apigateway.stages (
stageName,
deploymentId,
description,
cacheClusterEnabled,
cacheClusterSize,
variables,
documentationVersion,
canarySettings,
tracingEnabled,
tags,
restapi_id,
region
)
SELECT
'{{ stageName }}' /* required */,
'{{ deploymentId }}' /* required */,
'{{ description }}',
{{ cacheClusterEnabled }},
'{{ cacheClusterSize }}',
'{{ variables }}',
'{{ documentationVersion }}',
'{{ canarySettings }}',
{{ tracingEnabled }},
'{{ tags }}',
'{{ restapi_id }}',
'{{ region }}'
RETURNING
access_log_settings,
cache_cluster_enabled,
cache_cluster_size,
cache_cluster_status,
canary_settings,
client_certificate_id,
created_date,
deployment_id,
description,
documentation_version,
last_updated_date,
method_settings,
stage_name,
tags,
tracing_enabled,
variables,
web_acl_arn
;
# Description fields are for documentation purposes
- name: stages
props:
- name: restapi_id
value: "{{ restapi_id }}"
description: Required parameter for the stages resource.
- name: region
value: "{{ region }}"
description: Required parameter for the stages resource.
- name: stageName
value: "{{ stageName }}"
- name: deploymentId
value: "{{ deploymentId }}"
- name: description
value: "{{ description }}"
- name: cacheClusterEnabled
value: {{ cacheClusterEnabled }}
- name: cacheClusterSize
value: "{{ cacheClusterSize }}"
description: |
Returns the size of the CacheCluster.
valid_values: ['0.5', '1.6', '6.1', '13.5', '28.4', '58.2', '118', '237']
- name: variables
value: "{{ variables }}"
- name: documentationVersion
value: "{{ documentationVersion }}"
- name: canarySettings
description: |
Configuration settings of a canary deployment.
value:
percentTraffic: {{ percentTraffic }}
deploymentId: "{{ deploymentId }}"
stageVariableOverrides: "{{ stageVariableOverrides }}"
useStageCache: {{ useStageCache }}
- name: tracingEnabled
value: {{ tracingEnabled }}
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_stage
Changes information about a Stage resource.
UPDATE aws.apigateway.stages
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND stage_name = '{{ stage_name }}' --required
AND region = '{{ region }}' --required
RETURNING
access_log_settings,
cache_cluster_enabled,
cache_cluster_size,
cache_cluster_status,
canary_settings,
client_certificate_id,
created_date,
deployment_id,
description,
documentation_version,
last_updated_date,
method_settings,
stage_name,
tags,
tracing_enabled,
variables,
web_acl_arn;
DELETE examples
- delete_stage
Deletes a Stage resource.
DELETE FROM aws.apigateway.stages
WHERE restapi_id = '{{ restapi_id }}' --required
AND stage_name = '{{ stage_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- flush_stage_authorizers_cache
- flush_stage_cache
Flushes all authorizer cache entries on a stage.
EXEC aws.apigateway.stages.flush_stage_authorizers_cache
@restapi_id='{{ restapi_id }}' --required,
@stage_name='{{ stage_name }}' --required,
@region='{{ region }}' --required
;
Flushes a stage's cache.
EXEC aws.apigateway.stages.flush_stage_cache
@restapi_id='{{ restapi_id }}' --required,
@stage_name='{{ stage_name }}' --required,
@region='{{ region }}' --required
;