Skip to main content

stages

Creates, updates, deletes or gets a stage resource or lists stages in a region

Overview

Namestages
TypeResource
DescriptionThe AWS::ApiGateway::Stage resource creates a stage for a deployment.
Idaws.apigateway.stages

Fields

NameDatatypeDescription
access_log_settingobjectAccess log settings, including the access log format and access log destination ARN.
cache_cluster_enabledbooleanSpecifies whether a cache cluster is enabled for the stage.
cache_cluster_sizestringThe stage's cache capacity in GB. For more information about choosing a cache size, see [Enabling API caching to enhance responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html).
canary_settingobjectSettings for the canary deployment in this stage.
client_certificate_idstringThe identifier of a client certificate for an API stage.
deployment_idstringThe identifier of the Deployment that the stage points to.
descriptionstringThe stage's description.
documentation_versionstringThe version of the associated API documentation.
method_settingsarrayA 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.
rest_api_idstringThe string identifier of the associated RestApi.
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.
tagsarrayThe 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 (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-._~:/?#&=,]+.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTRestApiId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.apigateway.stages (
RestApiId,
region
)
SELECT
'{{ RestApiId }}',
'{{ region }}';

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