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 = 'us-east-1' AND
Identifier = '{{ agent_arn }}';
Lists all agents in a region.
SELECT
region,
agent_arn
FROM awscc.datasync.agents_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ 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 }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.datasync.agents
WHERE
Identifier = '{{ agent_arn }}' AND
region = 'us-east-1';
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