Skip to main content

stages

Creates, updates, deletes, gets or lists a stages resource.

Overview

Namestages
TypeResource
Idaws.apigateway.stages

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_log_settingsobjectSettings for logging access in this stage.
cache_cluster_enabledbooleanSpecifies whether a cache cluster is enabled for the stage. To activate a method-level cache, set CachingEnabled to true for a method.
cache_cluster_sizestringReturns the size of the CacheCluster. (0.5, 1.6, 6.1, 13.5, 28.4, 58.2, 118, 237)
cache_cluster_statusstringThe status of the cache cluster for the stage, if enabled. (CREATE_IN_PROGRESS, AVAILABLE, DELETE_IN_PROGRESS, NOT_AVAILABLE, FLUSH_IN_PROGRESS)
canary_settingsobjectConfiguration settings of a canary deployment.
client_certificate_idstringThe identifier of a client certificate for an API stage.
created_datestring (date-time)The timestamp when the stage was created.
deployment_idstringThe identifier of the Deployment that the stage points to.
descriptionstringThe stage's description.
documentation_versionstringThe version of the associated API documentation.
last_updated_datestring (date-time)The timestamp when the stage last updated.
method_settingsobjectA 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_namestringThe 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.
tagsobjectThe collection of tags. Each tag element is associated with a given resource.
tracing_enabledbooleanSpecifies whether active tracing with X-ray is enabled for the Stage.
variablesobjectA 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_arnstringThe ARN of the WebAcl associated with the Stage.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_stageselectrestapi_id, stage_name, regionGets information about a Stage resource.
get_stagesselectrestapi_id, regiondeploymentIdGets information about one or more Stage resources.
create_stageinsertrestapi_id, region, stageName, deploymentIdCreates a new Stage resource that references a pre-existing Deployment for the API.
update_stageupdaterestapi_id, stage_name, regionChanges information about a Stage resource.
delete_stagedeleterestapi_id, stage_name, regionDeletes a Stage resource.
flush_stage_authorizers_cacheexecrestapi_id, stage_name, regionFlushes all authorizer cache entries on a stage.
flush_stage_cacheexecrestapi_id, stage_name, regionFlushes 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
restapi_idstringThe string identifier of the associated RestApi.
stage_namestringThe name of the stage to flush its cache.
deploymentIdstringThe stages' deployment identifiers.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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
;