deployments
Creates, updates, deletes or gets a deployment resource or lists deployments in a region
Overview
| Name | deployments |
| Type | Resource |
| Description | The ``AWS::ApiGatewayV2::Deployment`` resource creates a deployment for an API. |
| Id | awscc.apigatewayv2.deployments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
deployment_id | string | |
description | string | The description for the deployment resource. |
stage_name | string | The name of an existing stage to associate with the deployment. |
api_id | string | The API identifier. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
deployment_id | string | |
api_id | string | The API identifier. |
region | string | AWS region. |
For more information, see AWS::ApiGatewayV2::Deployment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | deployments | INSERT | ApiId, region |
delete_resource | deployments | DELETE | Identifier, region |
update_resource | deployments | UPDATE | Identifier, PatchDocument, region |
list_resources | deployments_list_only | SELECT | region |
get_resource | deployments | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual deployment.
SELECT
region,
deployment_id,
description,
stage_name,
api_id
FROM awscc.apigatewayv2.deployments
WHERE
region = 'us-east-1' AND
Identifier = '{{ api_id }}|{{ deployment_id }}';
Lists all deployments in a region.
SELECT
region,
api_id,
deployment_id
FROM awscc.apigatewayv2.deployments_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new deployment resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.apigatewayv2.deployments (
ApiId,
region
)
SELECT
'{{ api_id }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.apigatewayv2.deployments (
Description,
StageName,
ApiId,
region
)
SELECT
'{{ description }}',
'{{ stage_name }}',
'{{ api_id }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: deployment
props:
- name: description
value: '{{ description }}'
- name: stage_name
value: '{{ stage_name }}'
- name: api_id
value: '{{ api_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a deployment resource, using stack-deploy.
/*+ update */
UPDATE awscc.apigatewayv2.deployments
SET PatchDocument = string('{{ {
"Description": description,
"StageName": stage_name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ api_id }}|{{ deployment_id }}';
DELETE example
/*+ delete */
DELETE FROM awscc.apigatewayv2.deployments
WHERE
Identifier = '{{ api_id }}|{{ deployment_id }}' AND
region = 'us-east-1';
Permissions
To operate on the deployments resource, the following permissions are required:
- Create
- Update
- Read
- Delete
- List
apigateway:POST
apigateway:PATCH,
apigateway:GET,
apigateway:PUT
apigateway:GET
apigateway:GET,
apigateway:DELETE
apigateway:GET