Skip to main content

deployments

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

Overview​

Namedeployments
TypeResource
Idaws.apigateway.deployments

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier for the deployment resource.
api_summaryobjectA summary of the RestApi at the date and time that the deployment resource was created.
created_datestring (date-time)The date and time that the deployment resource was created.
descriptionstringThe description for the deployment resource.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_deploymentselectrestapi_id, deployment_id, regionembedGets information about a Deployment resource.
get_deploymentsselectrestapi_id, regionposition, limitGets information about a Deployments collection.
create_deploymentinsertrestapi_id, regionCreates a Deployment resource, which makes a specified RestApi callable over the internet.
update_deploymentupdaterestapi_id, deployment_id, regionChanges information about a Deployment resource.
delete_deploymentdeleterestapi_id, deployment_id, regionDeletes a Deployment resource. Deleting a deployment will only succeed if there are no Stage resources associated with it.

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
deployment_idstringThe identifier of the Deployment resource to delete.
regionstringAWS region (default: us-east-1)
restapi_idstringThe string identifier of the associated RestApi.
embedarrayA query parameter to retrieve the specified embedded resources of the returned Deployment resource in the response. In a REST API call, this embed parameter value is a list of comma-separated strings, as in GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=var1,var2. The SDK and other platform-dependent libraries might use a different format for the list. Currently, this request supports only retrieval of the embedded API summary this way. Hence, the parameter value must be a single-valued list containing only the "apisummary" string. For example, GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=apisummary.
limitintegerThe maximum number of returned results per page. The default value is 25 and the maximum value is 500.
positionstringThe current pagination position in the paged result set.

SELECT examples​

Gets information about a Deployment resource.

SELECT
id,
api_summary,
created_date,
description
FROM aws.apigateway.deployments
WHERE restapi_id = '{{ restapi_id }}' -- required
AND deployment_id = '{{ deployment_id }}' -- required
AND region = '{{ region }}' -- required
AND embed = '{{ embed }}'
;

INSERT examples​

Creates a Deployment resource, which makes a specified RestApi callable over the internet.

INSERT INTO aws.apigateway.deployments (
stageName,
stageDescription,
description,
cacheClusterEnabled,
cacheClusterSize,
variables,
canarySettings,
tracingEnabled,
restapi_id,
region
)
SELECT
'{{ stageName }}',
'{{ stageDescription }}',
'{{ description }}',
{{ cacheClusterEnabled }},
'{{ cacheClusterSize }}',
'{{ variables }}',
'{{ canarySettings }}',
{{ tracingEnabled }},
'{{ restapi_id }}',
'{{ region }}'
RETURNING
id,
api_summary,
created_date,
description
;

UPDATE examples​

Changes information about a Deployment resource.

UPDATE aws.apigateway.deployments
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND deployment_id = '{{ deployment_id }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
api_summary,
created_date,
description;

DELETE examples​

Deletes a Deployment resource. Deleting a deployment will only succeed if there are no Stage resources associated with it.

DELETE FROM aws.apigateway.deployments
WHERE restapi_id = '{{ restapi_id }}' --required
AND deployment_id = '{{ deployment_id }}' --required
AND region = '{{ region }}' --required
;