stages
Creates, updates, deletes, gets or lists a stages resource.
Overview
| Name | stages |
| Type | Resource |
| Id | aws.apigatewayv2.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 a stage. |
api_gateway_managed | boolean | Specifies whether a stage is managed by API Gateway. If you created an API using quick create, the $default stage is managed by API Gateway. You can't modify the $default stage. |
auto_deploy | boolean | Specifies whether updates to an API automatically trigger a new deployment. The default value is false. |
client_certificate_id | string | The identifier. |
created_date | string (date-time) | The timestamp when the stage was created. |
default_route_settings | object | Represents a collection of route settings. |
deployment_id | string | The identifier. |
description | string | A string with a length between [0-1024]. |
last_deployment_status_message | string | Describes the status of the last deployment of a stage. Supported only for stages with autoDeploy enabled. |
last_updated_date | string (date-time) | The timestamp when the stage was last updated. |
route_settings | object | Route settings for the stage, by routeKey. |
stage_name | string | A string with a length between [1-128]. |
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-._~:/?#&=,]+. |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
| Name | Datatype | Description |
|---|---|---|
access_log_settings | object | Settings for logging access in a stage. |
api_gateway_managed | boolean | Specifies whether a stage is managed by API Gateway. If you created an API using quick create, the $default stage is managed by API Gateway. You can't modify the $default stage. |
auto_deploy | boolean | Specifies whether updates to an API automatically trigger a new deployment. The default value is false. |
client_certificate_id | string | The identifier. |
created_date | string (date-time) | The timestamp when the stage was created. |
default_route_settings | object | Represents a collection of route settings. |
deployment_id | string | The identifier. |
description | string | A string with a length between [0-1024]. |
last_deployment_status_message | string | Describes the status of the last deployment of a stage. Supported only for stages with autoDeploy enabled. |
last_updated_date | string (date-time) | The timestamp when the stage was last updated. |
route_settings | object | Route settings for the stage, by routeKey. |
stage_name | string | A string with a length between [1-128]. |
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-._~:/?#&=,]+. |
tags | object | The collection of tags. Each tag element is associated with a given resource. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_stage | select | api_id, stage_name, region | Gets a Stage. | |
get_stages | select | api_id, region | maxResults, nextToken | Gets the Stages for an API. |
create_stage | insert | api_id, region, StageName | Creates a Stage for an API. | |
update_stage | update | api_id, stage_name, region | Updates a Stage. | |
delete_stage | delete | api_id, stage_name, region | Deletes a Stage. | |
delete_access_log_settings | exec | api_id, stage_name, region | Deletes the AccessLogSettings for a Stage. To disable access logging for a Stage, delete its AccessLogSettings. |
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 |
|---|---|---|
api_id | string | The API identifier. |
region | string | AWS region (default: us-east-1) |
stage_name | string | The stage name. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters. |
maxResults | string | The maximum number of elements to be returned for this resource. |
nextToken | string | The next page of elements from this collection. Not valid for the last element of the collection. |
SELECT examples
- get_stage
- get_stages
Gets a Stage.
SELECT
access_log_settings,
api_gateway_managed,
auto_deploy,
client_certificate_id,
created_date,
default_route_settings,
deployment_id,
description,
last_deployment_status_message,
last_updated_date,
route_settings,
stage_name,
stage_variables,
tags
FROM aws.apigatewayv2.stages
WHERE api_id = '{{ api_id }}' -- required
AND stage_name = '{{ stage_name }}' -- required
AND region = '{{ region }}' -- required
;
Gets the Stages for an API.
SELECT
access_log_settings,
api_gateway_managed,
auto_deploy,
client_certificate_id,
created_date,
default_route_settings,
deployment_id,
description,
last_deployment_status_message,
last_updated_date,
route_settings,
stage_name,
stage_variables,
tags
FROM aws.apigatewayv2.stages
WHERE api_id = '{{ api_id }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_stage
- Manifest
Creates a Stage for an API.
INSERT INTO aws.apigatewayv2.stages (
AccessLogSettings,
AutoDeploy,
ClientCertificateId,
DefaultRouteSettings,
DeploymentId,
Description,
RouteSettings,
StageName,
StageVariables,
Tags,
api_id,
region
)
SELECT
'{{ AccessLogSettings }}',
{{ AutoDeploy }},
'{{ ClientCertificateId }}',
'{{ DefaultRouteSettings }}',
'{{ DeploymentId }}',
'{{ Description }}',
'{{ RouteSettings }}',
'{{ StageName }}' /* required */,
'{{ StageVariables }}',
'{{ Tags }}',
'{{ api_id }}',
'{{ region }}'
RETURNING
access_log_settings,
api_gateway_managed,
auto_deploy,
client_certificate_id,
created_date,
default_route_settings,
deployment_id,
description,
last_deployment_status_message,
last_updated_date,
route_settings,
stage_name,
stage_variables,
tags
;
# Description fields are for documentation purposes
- name: stages
props:
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the stages resource.
- name: region
value: "{{ region }}"
description: Required parameter for the stages resource.
- name: AccessLogSettings
description: |
Settings for logging access in a stage.
value:
DestinationArn: "{{ DestinationArn }}"
Format: "{{ Format }}"
- name: AutoDeploy
value: {{ AutoDeploy }}
- name: ClientCertificateId
value: "{{ ClientCertificateId }}"
description: |
The identifier.
- name: DefaultRouteSettings
description: |
Represents a collection of route settings.
value:
DataTraceEnabled: {{ DataTraceEnabled }}
DetailedMetricsEnabled: {{ DetailedMetricsEnabled }}
LoggingLevel: "{{ LoggingLevel }}"
ThrottlingBurstLimit: {{ ThrottlingBurstLimit }}
ThrottlingRateLimit: {{ ThrottlingRateLimit }}
- name: DeploymentId
value: "{{ DeploymentId }}"
description: |
The identifier.
- name: Description
value: "{{ Description }}"
description: |
A string with a length between [0-1024].
- name: RouteSettings
value: "{{ RouteSettings }}"
description: |
The route settings map.
- name: StageName
value: "{{ StageName }}"
description: |
A string with a length between [1-128].
- name: StageVariables
value: "{{ StageVariables }}"
description: |
The stage variable map.
- name: Tags
value: "{{ Tags }}"
description: |
Represents a collection of tags associated with the resource.
UPDATE examples
- update_stage
Updates a Stage.
UPDATE aws.apigatewayv2.stages
SET
AccessLogSettings = '{{ AccessLogSettings }}',
AutoDeploy = {{ AutoDeploy }},
ClientCertificateId = '{{ ClientCertificateId }}',
DefaultRouteSettings = '{{ DefaultRouteSettings }}',
DeploymentId = '{{ DeploymentId }}',
Description = '{{ Description }}',
RouteSettings = '{{ RouteSettings }}',
StageVariables = '{{ StageVariables }}'
WHERE
api_id = '{{ api_id }}' --required
AND stage_name = '{{ stage_name }}' --required
AND region = '{{ region }}' --required
RETURNING
access_log_settings,
api_gateway_managed,
auto_deploy,
client_certificate_id,
created_date,
default_route_settings,
deployment_id,
description,
last_deployment_status_message,
last_updated_date,
route_settings,
stage_name,
stage_variables,
tags;
DELETE examples
- delete_stage
Deletes a Stage.
DELETE FROM aws.apigatewayv2.stages
WHERE api_id = '{{ api_id }}' --required
AND stage_name = '{{ stage_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- delete_access_log_settings
Deletes the AccessLogSettings for a Stage. To disable access logging for a Stage, delete its AccessLogSettings.
EXEC aws.apigatewayv2.stages.delete_access_log_settings
@api_id='{{ api_id }}' --required,
@stage_name='{{ stage_name }}' --required,
@region='{{ region }}' --required
;