agents
Creates, updates, deletes, gets or lists an agents resource.
Overview
| Name | agents |
| Type | Resource |
| Id | aws.datasync.agents |
Fields
The following fields are returned by SELECT queries:
- describe_agent
- list_agents
| Name | Datatype | Description |
|---|---|---|
agent_arn | string | The ARN of the agent. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$</code>) |
creation_time | string (date-time) | The time that the agent was activated. |
endpoint_type | string | The type of service endpoint that your agent is connected to. (PUBLIC, PRIVATE_LINK, FIPS, FIPS_PRIVATE_LINK) |
last_connection_time | string (date-time) | The last time that the agent was communicating with the DataSync service. |
name | string | The name of the agent. (pattern: <code>^[a-zA-Z0-9\s+=._:@/-]+$</code>) |
platform | object | The platform-related details about the agent, such as the version number. |
private_link_config | object | The network configuration that the agent uses when connecting to a VPC service endpoint. |
status | string | The status of the agent. If the status is ONLINE, the agent is configured properly and ready to use. If the status is OFFLINE, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see What do I do if my agent is offline? (ONLINE, OFFLINE) |
| Name | Datatype | Description |
|---|---|---|
agent_arn | string | The Amazon Resource Name (ARN) of a DataSync agent. (pattern: <code>^arn:(aws|aws-cn|aws-us-gov|aws-eusc|aws-iso|aws-iso-b):datasync:[a-z-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$</code>) |
name | string | The name of an agent. (pattern: <code>^[a-zA-Z0-9\s+=._:@/-]+$</code>) |
platform | object | The platform-related details about the agent, such as the version number. |
status | string | The status of an agent. If the status is ONLINE, the agent is configured properly and ready to use. If the status is OFFLINE, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see What do I do if my agent is offline? (ONLINE, OFFLINE) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_agent | select | region | Returns information about an DataSync agent, such as its name, service endpoint type, and status. | |
list_agents | select | region | Returns a list of DataSync agents that belong to an Amazon Web Services account in the Amazon Web Services Region specified in the request. With pagination, you can reduce the number of agents returned in a response. If you get a truncated list of agents in a response, the response contains a marker that you can specify in your next request to fetch the next page of agents. ListAgents is eventually consistent. This means the result of running the operation might not reflect that you just created or deleted an agent. For example, if you create an agent with CreateAgent and then immediately run ListAgents, that agent might not show up in the list right away. In situations like this, you can always confirm whether an agent has been created (or deleted) by using DescribeAgent. | |
create_agent | insert | region, ActivationKey | Activates an DataSync agent that you deploy in your storage environment. The activation process associates the agent with your Amazon Web Services account. If you haven't deployed an agent yet, see Do I need a DataSync agent? | |
update_agent | update | region, AgentArn | Updates the name of an DataSync agent. | |
delete_agent | delete | region | Removes an DataSync agent resource from your Amazon Web Services account. Keep in mind that this operation (which can't be undone) doesn't remove the agent's virtual machine (VM) or Amazon EC2 instance from your storage environment. For next steps, you can delete the VM or instance from your storage environment or reuse it to activate a new agent. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_agent
- list_agents
Returns information about an DataSync agent, such as its name, service endpoint type, and status.
SELECT
agent_arn,
creation_time,
endpoint_type,
last_connection_time,
name,
platform,
private_link_config,
status
FROM aws.datasync.agents
WHERE region = '{{ region }}' -- required
;
Returns a list of DataSync agents that belong to an Amazon Web Services account in the Amazon Web Services Region specified in the request. With pagination, you can reduce the number of agents returned in a response. If you get a truncated list of agents in a response, the response contains a marker that you can specify in your next request to fetch the next page of agents. ListAgents is eventually consistent. This means the result of running the operation might not reflect that you just created or deleted an agent. For example, if you create an agent with CreateAgent and then immediately run ListAgents, that agent might not show up in the list right away. In situations like this, you can always confirm whether an agent has been created (or deleted) by using DescribeAgent.
SELECT
agent_arn,
name,
platform,
status
FROM aws.datasync.agents
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_agent
- Manifest
Activates an DataSync agent that you deploy in your storage environment. The activation process associates the agent with your Amazon Web Services account. If you haven't deployed an agent yet, see Do I need a DataSync agent?
INSERT INTO aws.datasync.agents (
ActivationKey,
AgentName,
Tags,
VpcEndpointId,
SubnetArns,
SecurityGroupArns,
region
)
SELECT
'{{ ActivationKey }}' /* required */,
'{{ AgentName }}',
'{{ Tags }}',
'{{ VpcEndpointId }}',
'{{ SubnetArns }}',
'{{ SecurityGroupArns }}',
'{{ region }}'
RETURNING
agent_arn
;
# Description fields are for documentation purposes
- name: agents
props:
- name: region
value: "{{ region }}"
description: Required parameter for the agents resource.
- name: ActivationKey
value: "{{ ActivationKey }}"
description: |
Specifies your DataSync agent's activation key. If you don't have an activation key, see Activating your agent.
- name: AgentName
value: "{{ AgentName }}"
description: |
Specifies a name for your agent. We recommend specifying a name that you can remember.
- name: Tags
description: |
Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least one tag for your agent.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: VpcEndpointId
value: "{{ VpcEndpointId }}"
description: |
Specifies the ID of the VPC service endpoint that you're using. For example, a VPC endpoint ID looks like vpce-01234d5aff67890e1. The VPC service endpoint you use must include the DataSync service name (for example, com.amazonaws.us-east-2.datasync).
- name: SubnetArns
value:
- "{{ SubnetArns }}"
description: |
Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.
- name: SecurityGroupArns
value:
- "{{ SecurityGroupArns }}"
description: |
Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.
UPDATE examples
- update_agent
Updates the name of an DataSync agent.
UPDATE aws.datasync.agents
SET
AgentArn = '{{ AgentArn }}',
Name = '{{ Name }}'
WHERE
region = '{{ region }}' --required
AND AgentArn = '{{ AgentArn }}' --required;
DELETE examples
- delete_agent
Removes an DataSync agent resource from your Amazon Web Services account. Keep in mind that this operation (which can't be undone) doesn't remove the agent's virtual machine (VM) or Amazon EC2 instance from your storage environment. For next steps, you can delete the VM or instance from your storage environment or reuse it to activate a new agent.
DELETE FROM aws.datasync.agents
WHERE region = '{{ region }}' --required
;