boto3_efs

Connection module for Amazon EFS using boto3.

Renamed from boto_efs to boto3_efs and rewritten to use the boto3 efs client APIs directly via saltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

configuration:

This module accepts explicit EFS credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:

efs.keyid: GKTADJGHEIQSXMKKRBJ08H
efs.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

A region may also be specified in the configuration:

efs.region: us-east-1

It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:

myprofile:
    keyid: GKTADJGHEIQSXMKKRBJ08H
    key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
    region: us-east-1

Added in version 1.0.0.

saltext.boto3.modules.boto3_efs.__virtual__()[source]

Only load if boto3 is available.

saltext.boto3.modules.boto3_efs.create_file_system(name, performance_mode='generalPurpose', keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs)[source]

Creates a new, empty file system.

name

(string) - The name for the new file system

performance_mode

(string) - The PerformanceMode of the file system. Can be either generalPurpose or maxIO

creation_token

(string) - A unique name to be used as reference when creating an EFS. This will ensure idempotency. Set to name if not specified otherwise

returns

(dict) - A dict of the data for the elastic file system

CLI Example:

salt 'my-minion' boto3_efs.create_file_system efs-name generalPurpose
saltext.boto3.modules.boto3_efs.create_mount_target(filesystemid, subnetid, ipaddress=None, securitygroups=None, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Creates a mount target for a file system.

filesystemid

(string) - ID of the file system for which to create the mount target.

subnetid

(string) - ID of the subnet to add the mount target in.

ipaddress
(string) - Valid IPv4 address within the address range

of the specified subnet.

securitygroups

(list[string]) - Up to five VPC security group IDs.

returns

(dict) - A dict of the response data

CLI Example:

salt 'my-minion' boto3_efs.create_mount_target filesystemid subnetid
saltext.boto3.modules.boto3_efs.create_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Creates or overwrites tags associated with a file system.

filesystemid

(string) - ID of the file system for whose tags will be modified.

tags

(dict) - The tags to add to the file system

CLI Example:

salt 'my-minion' boto3_efs.create_tags
saltext.boto3.modules.boto3_efs.delete_file_system(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Deletes a file system, permanently severing access to its contents.

filesystemid

(string) - ID of the file system to delete.

CLI Example:

salt 'my-minion' boto3_efs.delete_file_system filesystemid
saltext.boto3.modules.boto3_efs.delete_mount_target(mounttargetid, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Deletes the specified mount target.

mounttargetid

(string) - ID of the mount target to delete

CLI Example:

salt 'my-minion' boto3_efs.delete_mount_target mounttargetid
saltext.boto3.modules.boto3_efs.delete_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Deletes the specified tags from a file system.

filesystemid

(string) - ID of the file system for whose tags will be removed.

tags

(list[string]) - The tag keys to delete from the file system

CLI Example:

salt 'my-minion' boto3_efs.delete_tags
saltext.boto3.modules.boto3_efs.get_file_systems(filesystemid=None, keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs)[source]

Get all EFS properties or a specific instance property if filesystemid is specified.

filesystemid

(string) - ID of the file system to retrieve properties

creation_token

(string) - A unique token that identifies an EFS.

returns

(list[dict]) - list of all elastic file system properties

CLI Example:

salt 'my-minion' boto3_efs.get_file_systems efs-id
saltext.boto3.modules.boto3_efs.get_mount_targets(filesystemid=None, mounttargetid=None, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Get all the EFS mount point properties for a specific filesystemid or the properties for a specific mounttargetid.

filesystemid

(string) - ID of the file system whose mount targets to list.

mounttargetid

(string) - ID of the mount target to have its properties returned.

returns

(list[dict]) - list of all mount point properties

CLI Example:

salt 'my-minion' boto3_efs.get_mount_targets
saltext.boto3.modules.boto3_efs.get_tags(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Return the tags associated with an EFS instance.

filesystemid

(string) - ID of the file system whose tags to list

returns

(list) - list of tags as key/value pairs

CLI Example:

salt 'my-minion' boto3_efs.get_tags efs-id
saltext.boto3.modules.boto3_efs.set_security_groups(mounttargetid, securitygroup, keyid=None, key=None, profile=None, region=None, **kwargs)[source]

Modifies the set of security groups in effect for a mount target.

mounttargetid

(string) - ID of the mount target whose security groups will be modified

securitygroups

(list[string]) - list of no more than 5 VPC security group IDs.

CLI Example:

salt 'my-minion' boto3_efs.set_security_groups my-mount-target-id my-sec-group