Skip to main content

deployments

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

Overview

Namedeployments
TypeResource
DescriptionResource for Greengrass V2 deployment.
Idawscc.greengrassv2.deployments

Fields

NameDatatypeDescription
target_arnstring
parent_target_arnstring
deployment_idstring
deployment_namestring
componentsobject
iot_job_configurationobject
deployment_policiesobject
tagsobject
regionstringAWS region.

For more information, see AWS::GreengrassV2::Deployment.

Methods

NameResourceAccessible byRequired Params
create_resourcedeploymentsINSERTTargetArn, region
delete_resourcedeploymentsDELETEIdentifier, region
update_resourcedeploymentsUPDATEIdentifier, PatchDocument, region
list_resourcesdeployments_list_onlySELECTregion
get_resourcedeploymentsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual deployment.

SELECT
region,
target_arn,
parent_target_arn,
deployment_id,
deployment_name,
components,
iot_job_configuration,
deployment_policies,
tags
FROM awscc.greengrassv2.deployments
WHERE
region = '{{ region }}' AND
Identifier = '{{ deployment_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.greengrassv2.deployments (
TargetArn,
region
)
SELECT
'{{ target_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.greengrassv2.deployments
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ deployment_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.greengrassv2.deployments
WHERE
Identifier = '{{ deployment_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:

ParameterDescription
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:

greengrass:CreateDeployment,
greengrass:GetDeployment,
greengrass:TagResource,
iot:CancelJob,
iot:CreateJob,
iot:DeleteThingShadow,
iot:DescribeJob,
iot:DescribeThing,
iot:DescribeThingGroup,
iot:GetThingShadow,
iot:UpdateJob,
iot:UpdateThingShadow