agents
Creates, updates, deletes or gets an agent resource or lists agents in a region
Overview
| Name | agents |
| Type | Resource |
| Description | Resource schema for AWS::DataSync::Agent. |
| Id | awscc.datasync.agents |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
agent_name | string | The name configured for the agent. Text reference used to identify the agent in the console. |
activation_key | string | Activation key of the Agent. |
security_group_arns | array | The ARNs of the security group used to protect your data transfer task subnets. |
subnet_arns | array | The ARNs of the subnets in which DataSync will create elastic network interfaces for each data transfer task. |
vpc_endpoint_id | string | The ID of the VPC endpoint that the agent has access to. |
endpoint_type | string | The service endpoints that the agent will connect to. |
tags | array | An array of key-value pairs to apply to this resource. |
agent_arn | string | The DataSync Agent ARN. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
agent_arn | string | The DataSync Agent ARN. |
region | string | AWS region. |
For more information, see AWS::DataSync::Agent.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | agents | INSERT | , region |
delete_resource | agents | DELETE | Identifier, region |
update_resource | agents | UPDATE | Identifier, PatchDocument, region |
list_resources | agents_list_only | SELECT | region |
get_resource | agents | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual agent.
SELECT
region,
agent_name,
activation_key,
security_group_arns,
subnet_arns,
vpc_endpoint_id,
endpoint_type,
tags,
agent_arn
FROM awscc.datasync.agents
WHERE
region = '{{ region }}' AND
Identifier = '{{ agent_arn }}';
Lists all agents in a region.
SELECT
region,
agent_arn
FROM awscc.datasync.agents_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new agent resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.datasync.agents (
,
region
)
SELECT
'{{ }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.datasync.agents (
AgentName,
ActivationKey,
SecurityGroupArns,
SubnetArns,
VpcEndpointId,
Tags,
region
)
SELECT
'{{ agent_name }}',
'{{ activation_key }}',
'{{ security_group_arns }}',
'{{ subnet_arns }}',
'{{ vpc_endpoint_id }}',
'{{ tags }}',
'{{ 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: agent
props:
- name: agent_name
value: '{{ agent_name }}'
- name: activation_key
value: '{{ activation_key }}'
- name: security_group_arns
value:
- '{{ security_group_arns[0] }}'
- name: subnet_arns
value:
- '{{ subnet_arns[0] }}'
- name: vpc_endpoint_id
value: '{{ vpc_endpoint_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a agent resource, using stack-deploy.
/*+ update */
UPDATE awscc.datasync.agents
SET PatchDocument = string('{{ {
"AgentName": agent_name,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ agent_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.datasync.agents
WHERE
Identifier = '{{ agent_arn }}' 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 agents resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
datasync:CreateAgent,
datasync:TagResource,
datasync:DescribeAgent,
datasync:ListTagsForResource,
ec2:DescribeNetworkInterfaces,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcEndpoints
datasync:DescribeAgent,
datasync:ListTagsForResource
datasync:UpdateAgent,
datasync:DescribeAgent,
datasync:ListTagsForResource,
datasync:TagResource,
datasync:UntagResource
datasync:DeleteAgent
datasync:ListAgents