salt.modules.boto_efs module

Connection module for Amazon EFS

New in version 2017.7.0.

configuration

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

efs.region: us-east-1

If a region is not specified, the default is us-east-1.

It's also possible to speficy 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
depends

boto3

salt.modules.boto_efs.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.

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' boto_efs.create_file_system efs-name generalPurpose
salt.modules.boto_efs.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.

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,

of the form sg-xxxxxxxx. These must be for the same VPC as subnet specified.

returns

(dict) - A dict of the response data

CLI Example:

salt 'my-minion' boto_efs.create_mount_target filesystemid subnetid
salt.modules.boto_efs.create_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs)

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.

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' boto_efs.create_tags
salt.modules.boto_efs.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.

filesystemid

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

CLI Example:

salt 'my-minion' boto_efs.delete_file_system filesystemid
salt.modules.boto_efs.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.

mounttargetid

(string) - ID of the mount target to delete

CLI Example:

salt 'my-minion' boto_efs.delete_mount_target mounttargetid
salt.modules.boto_efs.delete_tags(filesystemid, tags, keyid=None, key=None, profile=None, region=None, **kwargs)

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 to the file system

CLI Example:

salt 'my-minion' boto_efs.delete_tags
salt.modules.boto_efs.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

filesystemid

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

creation_token

(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.

returns

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

CLI Example:

salt 'my-minion' boto_efs.get_file_systems efs-id
salt.modules.boto_efs.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

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

Must be specified if mounttargetid is not

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

Must be specified if filesystemid is not

returns

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

CLI Example:

salt 'my-minion' boto_efs.get_mount_targets
salt.modules.boto_efs.get_tags(filesystemid, keyid=None, key=None, profile=None, region=None, **kwargs)

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' boto_efs.get_tags efs-id
salt.modules.boto_efs.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

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' boto_efs.set_security_groups my-mount-target-id my-sec-group