deployments
Creates, updates, deletes or gets a deployment resource or lists deployments in a region
Overview
| Name | deployments |
| Type | Resource |
| Description | The 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. |
| Id | awscc.apigateway.deployments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
deployment_id | string | |
description | string | |
stage_description | object | The description of the Stage resource for the Deployment resource to create. To specify a stage description, you must also provide a stage name. |
stage_name | string | |
rest_api_id | string | |
deployment_canary_settings | object | The DeploymentCanarySettings property type specifies settings for the canary deployment. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
deployment_id | string | |
rest_api_id | string | |
region | string | AWS region. |
For more information, see AWS::ApiGateway::Deployment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | deployments | INSERT | RestApiId, 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_description,
stage_name,
rest_api_id,
deployment_canary_settings
FROM awscc.apigateway.deployments
WHERE
region = '{{ region }}' AND
Identifier = '{{ deployment_id }}|{{ rest_api_id }}';
Lists all deployments in a region.
SELECT
region,
deployment_id,
rest_api_id
FROM awscc.apigateway.deployments_list_only
WHERE
region = '{{ region }}';
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.apigateway.deployments (
RestApiId,
region
)
SELECT
'{{ rest_api_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.apigateway.deployments (
Description,
StageDescription,
StageName,
RestApiId,
DeploymentCanarySettings,
region
)
SELECT
'{{ description }}',
'{{ stage_description }}',
'{{ stage_name }}',
'{{ rest_api_id }}',
'{{ deployment_canary_settings }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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_description
value:
cache_ttl_in_seconds: '{{ cache_ttl_in_seconds }}'
description: '{{ description }}'
logging_level: '{{ logging_level }}'
canary_setting:
deployment_id: '{{ deployment_id }}'
percent_traffic: null
stage_variable_overrides: {}
use_stage_cache: '{{ use_stage_cache }}'
throttling_rate_limit: null
client_certificate_id: '{{ client_certificate_id }}'
variables: {}
documentation_version: '{{ documentation_version }}'
cache_data_encrypted: '{{ cache_data_encrypted }}'
data_trace_enabled: '{{ data_trace_enabled }}'
throttling_burst_limit: '{{ throttling_burst_limit }}'
caching_enabled: '{{ caching_enabled }}'
tracing_enabled: '{{ tracing_enabled }}'
method_settings:
- cache_data_encrypted: '{{ cache_data_encrypted }}'
cache_ttl_in_seconds: '{{ cache_ttl_in_seconds }}'
caching_enabled: '{{ caching_enabled }}'
data_trace_enabled: '{{ data_trace_enabled }}'
http_method: '{{ http_method }}'
logging_level: '{{ logging_level }}'
metrics_enabled: '{{ metrics_enabled }}'
resource_path: '{{ resource_path }}'
throttling_burst_limit: '{{ throttling_burst_limit }}'
throttling_rate_limit: null
access_log_setting:
destination_arn: '{{ destination_arn }}'
format: '{{ format }}'
cache_cluster_size: '{{ cache_cluster_size }}'
metrics_enabled: '{{ metrics_enabled }}'
tags:
- value: '{{ value }}'
key: '{{ key }}'
cache_cluster_enabled: '{{ cache_cluster_enabled }}'
- name: stage_name
value: '{{ stage_name }}'
- name: rest_api_id
value: '{{ rest_api_id }}'
- name: deployment_canary_settings
value:
stage_variable_overrides: {}
percent_traffic: null
use_stage_cache: '{{ use_stage_cache }}'
UPDATE example
Use the following StackQL query and manifest file to update a deployment resource, using stack-deploy.
/*+ update */
UPDATE awscc.apigateway.deployments
SET PatchDocument = string('{{ {
"Description": description,
"StageDescription": stage_description,
"StageName": stage_name
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ deployment_id }}|{{ rest_api_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.apigateway.deployments
WHERE
Identifier = '{{ deployment_id }}|{{ rest_api_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the deployments resource, the following permissions are required:
- Read
- Create
- Update
- List
- Delete
apigateway:GET
apigateway:POST,
apigateway:PATCH,
apigateway:PUT,
apigateway:GET
apigateway:PATCH,
apigateway:GET,
apigateway:PUT,
apigateway:DELETE
apigateway:GET
apigateway:GET,
apigateway:DELETE