Skip to main content

agents

Creates, updates, deletes or gets an agent resource or lists agents in a region

Overview

Nameagents
TypeResource
DescriptionResource schema for AWS::DataSync::Agent.
Idawscc.datasync.agents

Fields

NameDatatypeDescription
agent_namestringThe name configured for the agent. Text reference used to identify the agent in the console.
activation_keystringActivation key of the Agent.
security_group_arnsarrayThe ARNs of the security group used to protect your data transfer task subnets.
subnet_arnsarrayThe ARNs of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
vpc_endpoint_idstringThe ID of the VPC endpoint that the agent has access to.
endpoint_typestringThe service endpoints that the agent will connect to.
tagsarrayAn array of key-value pairs to apply to this resource.
agent_arnstringThe DataSync Agent ARN.
regionstringAWS region.

For more information, see AWS::DataSync::Agent.

Methods

NameResourceAccessible byRequired Params
create_resourceagentsINSERT, region
delete_resourceagentsDELETEIdentifier, region
update_resourceagentsUPDATEIdentifier, PatchDocument, region
list_resourcesagents_list_onlySELECTregion
get_resourceagentsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new agent resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.datasync.agents (
,
region
)
SELECT
'{{ }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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:

ParameterDescription
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:

datasync:CreateAgent,
datasync:TagResource,
datasync:DescribeAgent,
datasync:ListTagsForResource,
ec2:DescribeNetworkInterfaces,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcEndpoints