Connection module for Amazon EFS
New in version 2017.7.0.
This module accepts explicit EFS credentials but can also utilize IAM roles assigned to the instance through Instance Profiles or it can read them from the ~/.aws/credentials file or from these environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More information available at:
http://docs.aws.amazon.com/efs/latest/ug/ access-control-managing-permissions.html http://boto3.readthedocs.io/en/latest/guide/ configuration.html#guide-configuration
If IAM roles are not used you need to specify them either in a pillar or in the minion's config file
efs.keyid: GKTADJGHEIQSXMKKRBJ08H efs.key: askd+ghsdfjkghWupU/asdflkdfklgjsdfjajkghs
A region may also be specified in the configuration
If a region is not specified, the default is 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: askd+ghsdfjkghWupU/asdflkdfklgjsdfjajkghs region: us-east-1
create_file_system(name, performance_mode='generalPurpose', keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs)¶
Creates a new, empty file system.
(string) - The name for the new file system
(string) - The PerformanceMode of the file system. Can be either generalPurpose or maxIO
(string) - A unique name to be used as reference when creating an EFS. This will ensure idempotency. Set to name if not specified otherwise
(dict) - A dict of the data for the elastic file system
salt 'my-minion' boto_efs.create_file_system efs-name generalPurpose
create_mount_target(filesystemid, subnetid, ipaddress=None, securitygroups=None, keyid=None, key=None, profile=None, region=None, **kwargs)¶
Creates a mount target for a file system. You can then mount the file system on EC2 instances via the mount target.
You can create one mount target in each Availability Zone in your VPC. All EC2 instances in a VPC within a given Availability Zone share a single mount target for a given file system.
If you have multiple subnets in an Availability Zone, you create a mount target in one of the subnets. EC2 instances do not need to be in the same subnet as the mount target in order to access their file system.
(string) - ID of the file system for which to create the mount target.
(string) - ID of the subnet to add the mount target in.
of the specified subnet.
of the form sg-xxxxxxxx. These must be for the same VPC as subnet specified.
(dict) - A dict of the response data
salt 'my-minion' boto_efs.create_mount_target filesystemid subnetid
Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified in the request already exists on the file system, this operation overwrites its value with the value provided in the request.
(string) - ID of the file system for whose tags will be modified.
(dict) - The tags to add to the file system
salt 'my-minion' boto_efs.create_tags
delete_file_system(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs)¶
Deletes a file system, permanently severing access to its contents. Upon return, the file system no longer exists and you can't access any contents of the deleted file system. You can't delete a file system that is in use. That is, if the file system has any mount targets, you must first delete them.
(string) - ID of the file system to delete.
salt 'my-minion' boto_efs.delete_file_system filesystemid
delete_mount_target(mounttargetid, keyid=None, key=None, profile=None, region=None, **kwargs)¶
Deletes the specified mount target.
This operation forcibly breaks any mounts of the file system via the mount target that is being deleted, which might disrupt instances or applications using those mounts. To avoid applications getting cut off abruptly, you might consider unmounting any mounts of the mount target, if feasible. The operation also deletes the associated network interface. Uncommitted writes may be lost, but breaking a mount target using this operation does not corrupt the file system itself. The file system you created remains. You can mount an EC2 instance in your VPC via another mount target.
(string) - ID of the mount target to delete
salt 'my-minion' boto_efs.delete_mount_target mounttargetid
Deletes the specified tags from a file system.
(string) - ID of the file system for whose tags will be removed.
(list[string]) - The tag keys to delete to the file system
salt 'my-minion' boto_efs.delete_tags
get_file_systems(filesystemid=None, keyid=None, key=None, profile=None, region=None, creation_token=None, **kwargs)¶
Get all EFS properties or a specific instance property if filesystemid is specified
(string) - ID of the file system to retrieve properties
(string) - A unique token that identifies an EFS. If fileysystem created via create_file_system this would either be explictitly passed in or set to name. You can limit your search with this.
(list[dict]) - list of all elastic file system properties
salt 'my-minion' boto_efs.get_file_systems efs-id
get_mount_targets(filesystemid=None, mounttargetid=None, keyid=None, key=None, profile=None, region=None, **kwargs)¶
Get all the EFS mount point properties for a specific filesystemid or the properties for a specific mounttargetid. One or the other must be specified
Must be specified if mounttargetid is not
Must be specified if filesystemid is not
(list[dict]) - list of all mount point properties
salt 'my-minion' boto_efs.get_mount_targets
Return the tags associated with an EFS instance.
(string) - ID of the file system whose tags to list
(list) - list of tags as key/value pairs
salt 'my-minion' boto_efs.get_tags efs-id
set_security_groups(mounttargetid, securitygroup, keyid=None, key=None, profile=None, region=None, **kwargs)¶
Modifies the set of security groups in effect for a mount target
(string) - ID of the mount target whose security groups will be modified
(list[string]) - list of no more than 5 VPC security group IDs.
salt 'my-minion' boto_efs.set_security_groups my-mount-target-id my-sec-group