deployments
Creates, updates, deletes or gets a deployment resource or lists deployments in a region
Overview
| Name | deployments |
| Type | Resource |
| Description | Represents a deployment resource of an AWS Mainframe Modernization (M2) application to a specified environment |
| Id | awscc.m2.deployments |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
environment_id | string | The environment ID. |
application_id | string | The application ID. |
application_version | integer | The version number of the application to deploy |
deployment_id | string | The deployment ID. |
status | string | The status of the deployment. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
application_id | string | The application ID. |
region | string | AWS region. |
For more information, see AWS::M2::Deployment.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | deployments | INSERT | EnvironmentId, ApplicationId, ApplicationVersion, 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,
environment_id,
application_id,
application_version,
deployment_id,
status
FROM awscc.m2.deployments
WHERE
region = '{{ region }}' AND
Identifier = '{{ application_id }}';
Lists all deployments in a region.
SELECT
region,
application_id
FROM awscc.m2.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.m2.deployments (
EnvironmentId,
ApplicationId,
ApplicationVersion,
region
)
SELECT
'{{ environment_id }}',
'{{ application_id }}',
'{{ application_version }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.m2.deployments (
EnvironmentId,
ApplicationId,
ApplicationVersion,
region
)
SELECT
'{{ environment_id }}',
'{{ application_id }}',
'{{ application_version }}',
'{{ 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: environment_id
value: '{{ environment_id }}'
- name: application_id
value: '{{ application_id }}'
- name: application_version
value: '{{ application_version }}'
UPDATE example
Use the following StackQL query and manifest file to update a deployment resource, using stack-deploy.
/*+ update */
UPDATE awscc.m2.deployments
SET PatchDocument = string('{{ {
"ApplicationVersion": application_version
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ application_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.m2.deployments
WHERE
Identifier = '{{ application_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:
- Create
- Read
- Update
- Delete
- List
m2:CreateDeployment,
m2:ListDeployments,
m2:GetDeployment,
iam:PassRole,
ec2:DescribeNetworkInterfaces,
elasticloadbalancing:CreateListener,
elasticloadbalancing:CreateLoadBalancer,
elasticloadbalancing:CreateTargetGroup,
elasticloadbalancing:AddTags,
elasticloadbalancing:RegisterTargets,
logs:DescribeResourcePolicies,
logs:DescribeLogGroups,
logs:CreateLogDelivery,
logs:GetLogDelivery,
logs:UpdateLogDelivery,
logs:DeleteLogDelivery,
logs:ListLogDeliveries,
logs:CreateLogGroup,
logs:PutResourcePolicy
m2:ListDeployments,
m2:GetDeployment
m2:CreateDeployment,
m2:ListDeployments,
m2:GetDeployment,
elasticloadbalancing:CreateListener,
elasticloadbalancing:CreateLoadBalancer,
elasticloadbalancing:CreateTargetGroup,
elasticloadbalancing:DeleteListener,
elasticloadbalancing:DeleteTargetGroup,
elasticloadbalancing:DeregisterTargets,
elasticloadbalancing:DeleteLoadBalancer,
elasticloadbalancing:AddTags,
elasticloadbalancing:RegisterTargets,
ec2:DescribeNetworkInterfaces
elasticloadbalancing:DeleteListener,
elasticloadbalancing:DeleteTargetGroup,
elasticloadbalancing:DeregisterTargets,
elasticloadbalancing:DeleteLoadBalancer,
logs:DeleteLogDelivery,
m2:ListDeployments,
m2:GetDeployment,
m2:DeleteApplicationFromEnvironment
m2:ListDeployments