Skip to main content

deployments

Creates, updates, deletes or gets a deployment resource or lists deployments in a region

Overview

Namedeployments
TypeResource
DescriptionThe AWS::ApiGateway::Deployment resource deploys an API Gateway RestApi resource to a stage so that clients can call the API over the internet. The stage acts as an environment.
Idaws.apigateway.deployments

Fields

NameDatatypeDescription
deployment_idstring
descriptionstringThe description for the Deployment resource to create.
stage_descriptionobjectThe description of the Stage resource for the Deployment resource to create. To specify a stage description, you must also provide a stage name.
stage_namestringThe name of the Stage resource for the Deployment resource to create.
rest_api_idstringThe string identifier of the associated RestApi.
deployment_canary_settingsobjectThe input configuration for a canary deployment.
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 deployments in a region.

SELECT
region,
deployment_id,
description,
stage_description,
stage_name,
rest_api_id,
deployment_canary_settings
FROM aws.apigateway.deployments
WHERE region = 'us-east-1';

Gets all properties from an individual deployment.

SELECT
region,
deployment_id,
description,
stage_description,
stage_name,
rest_api_id,
deployment_canary_settings
FROM aws.apigateway.deployments
WHERE region = 'us-east-1' AND data__Identifier = '<DeploymentId>|<RestApiId>';

INSERT example

Use the following StackQL query and manifest file to create a new deployment resource, using stack-deploy.

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

DELETE example

/*+ delete */
DELETE FROM aws.apigateway.deployments
WHERE data__Identifier = '<DeploymentId|RestApiId>'
AND region = 'us-east-1';

Permissions

To operate on the deployments resource, the following permissions are required:

Read

apigateway:GET

Create

apigateway:POST,
apigateway:PATCH,
apigateway:PUT,
apigateway:GET

Update

apigateway:PATCH,
apigateway:GET,
apigateway:PUT,
apigateway:DELETE

List

apigateway:GET

Delete

apigateway:GET,
apigateway:DELETE