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 | aws.datasync.agents |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | , region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all agents
in a region.
SELECT
region,
agent_name,
activation_key,
security_group_arns,
subnet_arns,
vpc_endpoint_id,
endpoint_type,
tags,
agent_arn
FROM aws.datasync.agents
WHERE region = 'us-east-1';
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 aws.datasync.agents
WHERE region = 'us-east-1' AND data__Identifier = '<AgentArn>';
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 aws.datasync.agents (
,
region
)
SELECT
'{{ }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.datasync.agents (
AgentName,
ActivationKey,
SecurityGroupArns,
SubnetArns,
VpcEndpointId,
Tags,
region
)
SELECT
'{{ AgentName }}',
'{{ ActivationKey }}',
'{{ SecurityGroupArns }}',
'{{ SubnetArns }}',
'{{ VpcEndpointId }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: agent
props:
- name: AgentName
value: '{{ AgentName }}'
- name: ActivationKey
value: '{{ ActivationKey }}'
- name: SecurityGroupArns
value:
- '{{ SecurityGroupArns[0] }}'
- name: SubnetArns
value:
- '{{ SubnetArns[0] }}'
- name: VpcEndpointId
value: '{{ VpcEndpointId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.datasync.agents
WHERE data__Identifier = '<AgentArn>'
AND region = 'us-east-1';
Permissions
To operate on the agents
resource, the following permissions are required:
Create
datasync:CreateAgent,
datasync:TagResource,
datasync:DescribeAgent,
datasync:ListTagsForResource,
ec2:DescribeNetworkInterfaces,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcEndpoints
Read
datasync:DescribeAgent,
datasync:ListTagsForResource
Update
datasync:UpdateAgent,
datasync:DescribeAgent,
datasync:ListTagsForResource,
datasync:TagResource,
datasync:UntagResource
Delete
datasync:DeleteAgent
List
datasync:ListAgents