mount_targets
Creates, updates, deletes or gets a mount_target resource or lists mount_targets in a region
Overview
| Name | mount_targets |
| Type | Resource |
| Description | The AWS::EFS::MountTarget resource is an Amazon EFS resource that creates a mount target for an EFS file system. You can then mount the file system on Amazon EC2 instances or other resources by using the mount target. |
| Id | awscc.efs.mount_targets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | |
ip_address | string | If the IpAddressType for the mount target is IPv4 ( IPV4_ONLY or DUAL_STACK), then specify the IPv4 address to use. If you do not specify an IpAddress, then Amazon EFS selects an unused IP address from the subnet specified for SubnetId. |
ipv6_address | string | If the IPAddressType for the mount target is IPv6 (IPV6_ONLY or DUAL_STACK), then specify the IPv6 address to use. If you do not specify an Ipv6Address, then Amazon EFS selects an unused IP address from the subnet specified for SubnetId. |
ip_address_type | string | The IP address type for the mount target. The possible values are The |
file_system_id | string | The ID of the file system for which to create the mount target. |
security_groups | array | VPC security group IDs, of the form sg-xxxxxxxx. These must be for the same VPC as the subnet specified. The maximum number of security groups depends on account quota. For more information, see Amazon VPC Quotas in the Amazon VPC User Guide (see the Security Groups table). If you don't specify a security group, then Amazon EFS uses the default security group for the subnet's VPC. |
subnet_id | string | The ID of the subnet to add the mount target in. For One Zone file systems, use the subnet that is associated with the file system's Availability Zone. The subnet type must be the same type as the IpAddressType. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::EFS::MountTarget.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | mount_targets | INSERT | FileSystemId, SecurityGroups, SubnetId, region |
delete_resource | mount_targets | DELETE | Identifier, region |
update_resource | mount_targets | UPDATE | Identifier, PatchDocument, region |
list_resources | mount_targets_list_only | SELECT | region |
get_resource | mount_targets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual mount_target.
SELECT
region,
id,
ip_address,
ipv6_address,
ip_address_type,
file_system_id,
security_groups,
subnet_id
FROM awscc.efs.mount_targets
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all mount_targets in a region.
SELECT
region,
id
FROM awscc.efs.mount_targets_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new mount_target resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.efs.mount_targets (
FileSystemId,
SecurityGroups,
SubnetId,
region
)
SELECT
'{{ file_system_id }}',
'{{ security_groups }}',
'{{ subnet_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.efs.mount_targets (
IpAddress,
Ipv6Address,
IpAddressType,
FileSystemId,
SecurityGroups,
SubnetId,
region
)
SELECT
'{{ ip_address }}',
'{{ ipv6_address }}',
'{{ ip_address_type }}',
'{{ file_system_id }}',
'{{ security_groups }}',
'{{ subnet_id }}',
'{{ 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: mount_target
props:
- name: ip_address
value: '{{ ip_address }}'
- name: ipv6_address
value: '{{ ipv6_address }}'
- name: ip_address_type
value: '{{ ip_address_type }}'
- name: file_system_id
value: '{{ file_system_id }}'
- name: security_groups
value:
- '{{ security_groups[0] }}'
- name: subnet_id
value: '{{ subnet_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a mount_target resource, using stack-deploy.
/*+ update */
UPDATE awscc.efs.mount_targets
SET PatchDocument = string('{{ {
"SecurityGroups": security_groups
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.efs.mount_targets
WHERE
Identifier = '{{ id }}' 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 mount_targets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
elasticfilesystem:CreateMountTarget,
elasticfilesystem:DescribeMountTargets
elasticfilesystem:DescribeMountTargets,
elasticfilesystem:DescribeMountTargetSecurityGroups
elasticfilesystem:DescribeMountTargets,
elasticfilesystem:DescribeMountTargetSecurityGroups,
elasticfilesystem:ModifyMountTargetSecurityGroups
elasticfilesystem:DescribeMountTargets,
elasticfilesystem:DeleteMountTarget
elasticfilesystem:DescribeMountTargets,
elasticfilesystem:DescribeMountTargetSecurityGroups