neulab/tldr huggingface dataset:
hash_key The name of the attribute that will be used as the hash key for this table
hash_key_data_type The DynamoDB datatype of the hash key
range_key The name of the attribute that will be used as the range key for this table
range_key_data_type The DynamoDB datatype of the range key
local_indexes The local indexes you would like to create
global_indexes The global indexes you would like to create
backup_configs_from_pillars Pillars to use to configure DataPipeline backups
salt.states.boto_ec2 Manage EC2
This module provides an interface to the Elastic Compute Cloud (EC2) service from AWS.
The below code creates a key pair:
create-key-pair: boto_ec2.key_present: - name: mykeypair - save_private: /root/ - region: eu-west-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
import-key-pair: boto_ec2.key_present: - name: mykeypair - upload_public: 'ssh-rsa AAAA' - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
You can also use salt:// in order to define the public key.
import-key-pair: boto_ec2.key_present: - name: mykeypair - upload_public: salt://mybase/public_key.pub - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
The below code deletes a key pair:
delete-key-pair: boto_ec2.key_absent: - name: mykeypair - region: eu-west-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_ec2.eni_absent(name, release_eip=False, region=None, key=None, keyid=None, profile=None) Ensure the EC2 ENI is absent.
name   Name tag associated with the ENI.
release_eip True/False - release any EIP associated with the ENI
salt.states.boto_ec2.eni_present(name, subnet_id=None, subnet_name=None, private_ip_address=None, description=None, groups=None, source_dest_check=True, allocate_eip=None, arecords=None, region=None, key=None, keyid=None, profile=None) Ensure the EC2 ENI exists.
subnet_id The VPC subnet ID the ENI will exist within.
subnet_name The VPC subnet name the ENI will exist within.
private_ip_address The private ip address to use for this ENI. If this is not specified AWS will automatically assign a private IP address to the ENI. Must be specified at creation time; will be ignored afterward.
description Description of the key.
groups A list of security groups to apply to the ENI.
source_dest_check Boolean specifying whether source/destination checking is enabled on the ENI.
allocate_eip allocate and associate an EIP to the ENI. Could be 'standard' to allocate Elastic IP to EC2 region or 'vpc' to get it for a particular VPC
arecords A list of arecord dicts with attributes needed for the DNS add_record state.  By default the boto_route53.add_record state will be used, which requires: name, zone, ttl, and identifier.  See the boto_route53 state for information about these attributes.  Other DNS modules can be called by specifying the provider keyword.  By default, the private ENI IP address will be used, set 'public: True' in the arecord dict to use the ENI's public IP address
salt.states.boto_ec2.instance_absent(name, instance_name=None, instance_id=None, release_eip=False, region=None, key=None, keyid=None, profile=None, filters=None) Ensure an EC2 instance does not exist (is stopped and removed).
name   (string) - The name of the state definition.
instance_name (string) - The name of the instance.
instance_id (string) - The ID of the instance.
release_eip (bool)   - Release any associated EIPs during termination.
key    (string) - Secret key to be used.
keyid  (string) - Access key to be used.
profile (variable) - A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
filters (dict) - A dict of additional filters to use in matching the instance to delete.
- filters: vpc-id: vpc-abcdef12
salt.states.boto_ec2.instance_present(name, instance_name=None, instance_id=None, image_id=None, image_name=None, tags=None, key_name=None, security_groups=None, user_data=None, instance_type=None, placement=None, kernel_id=None, ramdisk_id=None, vpc_id=None, vpc_name=None, monitoring_enabled=None, subnet_id=None, subnet_name=None, private_ip_address=None, block_device_map=None, disable_api_termination=None, instance_initiated_shutdown_behavior=None, placement_group=None, client_token=None, security_group_ids=None, security_group_names=None, additional_info=None, tenancy=None, instance_profile_arn=None, instance_profile_name=None, ebs_optimized=None, network_interfaces=None, network_interface_name=None, network_interface_id=None, attributes=None, target_state=None, public_ip=None, allocation_id=None, allocate_eip=False, region=None, key=None, keyid=None, profile=None) Ensure an EC2 instance is running with the given attributes and state.
name   (string) - The name of the state definition.  Recommended that this match the instance_name attribute (generally the FQDN of the instance).
instance_name (string) - The name of the instance, generally its FQDN. Exclusive with 'instance_id'.
instance_id (string) - The ID of the instance (if known).  Exclusive with 'instance_name'.
image_id (string) – The ID of the AMI image to run.
image_name (string) – The name of the AMI image to run.
tags   (dict) - Tags to apply to the instance.
instance_type (string) – The EC2 instance size/type.  Note that only certain types are compatible with HVM based AMIs.
vpc_id (string) - The ID of a VPC to attach the instance to.
vpc_name (string) - The name of a VPC to attach the instance to.
subnet_id (string) – The ID of the subnet within which to launch the instances for VPC.
subnet_name (string) – The name of the subnet within which to launch the instances for VPC.
private_ip_address (string) – If you’re using VPC, you can optionally use this parameter to assign the instance a specific available IP address from the subnet (e.g., 10.0.0.25).
block_device_map (boto.ec2.blockdevicemapping.BlockDeviceMapping) – A BlockDeviceMapping data structure describing the EBS volumes associated with the Image.
instance_initiated_shutdown_behavior (string) – Specifies whether the instance stops or terminates on instance-initiated shutdown. Valid values are:
• 'stop'
• 'terminate'
security_group_ids (list of strings) – The IDs of the VPC security groups with which to associate instances.
security_group_names (list of strings) – The names of the VPC security groups with which to associate instances.
ebs_optimized (bool) – Whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and a tuned configuration stack to provide optimal EBS I/O performance. This optimization isn’t available with all instance types.
network_interface_name (string) - The name of Elastic Network Interface to attach
network_interface_id (string) - The id of Elastic Network Interface to attach
attributes (dict) - Instance attributes and value to be applied to the instance.  Available options are:
• instanceType - A valid instance type (m1.small)
• kernel - Kernel ID (None)
• ramdisk - Ramdisk ID (None)
• userData - Base64 encoded String (None)
• disableApiTermination - Boolean (true)
• instanceInitiatedShutdownBehavior - stop|terminate
• blockDeviceMapping - List of strings - ie: [‘/dev/sda=false’]
• sourceDestCheck - Boolean (true)
• groupSet - Set of Security Groups or IDs
• ebsOptimized - Boolean (false)
• sriovNetSupport - String - ie: ‘simple’
target_state (string) - The desired target state of the instance. Available options are:
• stopped
Note that this option is currently UNIMPLEMENTED.
public_ip: (string) - The IP of a previously allocated EIP address, which will be attached to the instance.  EC2 Classic instances ONLY - for VCP pass in an allocation_id instead.
allocation_id: (string) - The ID of a previously allocated EIP address, which will be attached to the instance.  VPC instances ONLY - for Classic pass in a public_ip instead.
allocate_eip: (bool) - Allocate and attach an EIP on-the-fly for this instance.  Note you'll want to release this address when terminating the instance, either manually or via the 'release_eip' flag to 'instance_absent'.
salt.states.boto_ec2.key_absent(name, region=None, key=None, keyid=None, profile=None) Deletes a key pair
salt.states.boto_ec2.key_present(name, save_private=None, upload_public=None, region=None, key=None, keyid=None, profile=None) Ensure key pair is present.
salt.states.boto_ec2.private_ips_absent(name, network_interface_name=None, network_interface_id=None, private_ip_addresses=None, region=None, key=None, keyid=None, profile=None) Ensure an ENI does not have secondary private ip addresses associated with it
name   (String) - State definition name
network_interface_id (String) - The EC2 network interface id, example eni-123456789
private_ip_addresses (List or String) - The secondary private ip address(es) that should be absent on the ENI.
salt.states.boto_ec2.private_ips_present(name, network_interface_name=None, network_interface_id=None, private_ip_addresses=None, allow_reassignment=False, region=None, key=None, keyid=None, profile=None) Ensure an ENI has secondary private ip addresses associated with it
private_ip_addresses (List or String) - The secondary private ip address(es) that should be present on the ENI.
allow_reassignment (Boolean) - If true, will reassign a secondary private ip address associated with another ENI. If false, state will fail if the secondary private ip address is associated with another ENI.
salt.states.boto_ec2.snapshot_created(name, ami_name, instance_name, wait_until_available=True, wait_timeout_seconds=300, **kwargs) Create a snapshot from the given instance
salt.states.boto_ec2.volume_absent(name, volume_name=None, volume_id=None, instance_name=None, instance_id=None, device=None, region=None, key=None, keyid=None, profile=None) Ensure the EC2 volume is detached and absent.
name   State definition name.
volume_name Name tag associated with the volume.  For safety, if this matches more than one volume, the state will refuse to apply.
volume_id Resource ID of the volume.
instance_name Only remove volume if it is attached to instance with this Name tag.  Exclusive with 'instance_id'.  Requires 'device'.
instance_id Only remove volume if it is attached to this instance. Exclusive with 'instance_name'.  Requires 'device'.
device Match by device rather than ID.  Requires one of 'instance_name' or 'instance_id'.
salt.states.boto_ec2.volume_present(name, volume_name=None, volume_id=None, instance_name=None, instance_id=None, device=None, size=None, snapshot_id=None, volume_type=None, iops=None, encrypted=False, kms_key_id=None, region=None, key=None, keyid=None, profile=None) Ensure the EC2 volume is present and attached.
volume_name The Name tag value for the volume. If no volume with that matching name tag is found, a new volume will be created. If multiple volumes are matched, the state will fail.
volume_id Resource ID of the volume. Exclusive with 'volume_name'.
instance_name Attach volume to instance with this Name tag.  Exclusive with 'instance_id'.
instance_id Attach volume to instance with this ID.  Exclusive with 'instance_name'.
device The device on the instance through which the volume is exposed (e.g. /dev/sdh)
size   The size of the new volume, in GiB. If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size. Optionally specified at volume creation time; will be ignored afterward. Requires 'volume_name'.
snapshot_id The snapshot ID from which the new Volume will be created. Optionally specified at volume creation time; will be ignored afterward. Requires 'volume_name'.
volume_type The type of the volume. Optionally specified at volume creation time; will be ignored afterward.  Requires 'volume_name'.  Valid volume types for AWS can be found here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
iops   The provisioned IOPS you want to associate with this volume. Optionally specified at volume creation time; will be ignored afterward. Requires 'volume_name'.
encrypted Specifies whether the volume should be encrypted. Optionally specified at volume creation time; will be ignored afterward. Requires 'volume_name'.
kms_key_id If encrypted is True, this KMS Key ID may be specified to encrypt volume with this key.  Optionally specified at volume creation time; will be ignored afterward.  Requires 'volume_name'.  e.g.: arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef
salt.states.boto_ec2.volumes_tagged(name, tag_maps, authoritative=False, region=None, key=None, keyid=None, profile=None) Ensure EC2 volume(s) matching the given filters have the defined tags.
tag_maps List of dicts of filters and tags, where 'filters' is a dict suitable for passing to the 'filters' argument of boto_ec2.get_all_volumes(), and 'tags' is a dict of tags to be set on volumes as matched by the given filters.  The filter syntax is extended to permit passing either a list of volume_ids or an instance_name (with instance_name being the Name tag of the instance to which the desired volumes are mapped).  Each mapping in the list is applied separately, so multiple sets of volumes can be all tagged differently with one call to this function.
- filters: attachment.instance_id: i-abcdef12 tags: Name: dev-int-abcdef12.aws-foo.com - filters: attachment.device: /dev/sdf tags: ManagedSnapshots: true BillingGroup: bubba.hotep@aws-foo.com - filters: instance_name: prd-foo-01.aws-foo.com tags: Name: prd-foo-01.aws-foo.com BillingGroup: infra-team@aws-foo.com - filters: volume_ids: [ vol-12345689, vol-abcdef12 ] tags: BillingGroup: infra-team@aws-foo.com
authoritative Should un-declared tags currently set on matched volumes be deleted?  Boolean.
salt.states.boto_elasticache Manage Elasticache New in version 2014.7.0.
Note: This module currently only supports creation and deletion of elasticache resources and will not modify clusters when their configuration changes in your state files.
This module accepts explicit elasticache 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 here.
Ensure myelasticache exists: boto_elasticache.present: - name: myelasticache - engine: redis - cache_node_type: cache.t1.micro - num_cache_nodes: 1 - notification_topic_arn: arn:aws:sns:us-east-1:879879:my-sns-topic - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# Using a profile from pillars Ensure myelasticache exists: boto_elasticache.present: - name: myelasticache - engine: redis - cache_node_type: cache.t1.micro - num_cache_nodes: 1 - notification_topic_arn: arn:aws:sns:us-east-1:879879:my-sns-topic - region: us-east-1 - profile: myprofile
# Passing in a profile Ensure myelasticache exists: boto_elasticache.present: - name: myelasticache - engine: redis - cache_node_type: cache.t1.micro - num_cache_nodes: 1 - notification_topic_arn: arn:aws:sns:us-east-1:879879:my-sns-topic - region: us-east-1 - profile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_elasticache.absent(name, wait=True, region=None, key=None, keyid=None, profile=None) Ensure the named elasticache cluster is deleted.
wait   Boolean. Wait for confirmation from boto that the cluster is in the deleting state.
salt.states.boto_elasticache.cache_cluster_absent(*args, **kwargs)
salt.states.boto_elasticache.cache_cluster_present(*args, **kwargs)
salt.states.boto_elasticache.creategroup(name, primary_cluster_id, replication_group_description, wait=None, region=None, key=None, keyid=None, profile=None) Ensure the a replication group is create.
wait   Waits for the group to be available
primary_cluster_id Name of the master cache node
replication_group_description Description for the group
salt.states.boto_elasticache.present(name, engine=None, cache_node_type=None, num_cache_nodes=None, preferred_availability_zone=None, port=None, cache_parameter_group_name=None, cache_security_group_names=None, replication_group_id=None, auto_minor_version_upgrade=True, security_group_ids=None, cache_subnet_group_name=None, engine_version=None, notification_topic_arn=None, preferred_maintenance_window=None, wait=None, region=None, key=None, keyid=None, profile=None) Ensure the cache cluster exists.
engine The name of the cache engine to be used for this cache cluster. Valid values are memcached or redis.
cache_node_type The compute and memory capacity of the nodes in the cache cluster.  cache.t1.micro, cache.m1.small, etc. See: https://boto.readthedocs.io/en/latest/ref/elasticache.html#boto.elasticache.layer1.ElastiCacheConnection.create_cache_cluster
num_cache_nodes The number of cache nodes that the cache cluster will have.
preferred_availability_zone The EC2 Availability Zone in which the cache cluster will be created.  All cache nodes belonging to a cache cluster are placed in the preferred availability zone.
port   The port number on which each of the cache nodes will accept connections.
cache_parameter_group_name The name of the cache parameter group to associate with this cache cluster. If this argument is omitted, the default cache parameter group for the specified engine will be used.
cache_security_group_names A list of cache security group names to associate with this cache cluster. Use this parameter only when you are creating a cluster outside of a VPC.
replication_group_id The replication group to which this cache cluster should belong. If this parameter is specified, the cache cluster will be added to the specified replication group as a read replica; otherwise, the cache cluster will be a standalone primary that is not part of any replication group.
auto_minor_version_upgrade Determines whether minor engine upgrades will be applied automatically to the cache cluster during the maintenance window. A value of True allows these upgrades to occur; False disables automatic upgrades.
security_group_ids One or more VPC security groups associated with the cache cluster. Use this parameter only when you are creating a cluster in a VPC.
cache_subnet_group_name The name of the cache subnet group to be used for the cache cluster.  Use this parameter only when you are creating a cluster in a VPC.
engine_version The version number of the cache engine to be used for this cluster.
notification_topic_arn The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications will be sent. The Amazon SNS topic owner must be the same as the cache cluster owner.
preferred_maintenance_window The weekly time range (in UTC) during which system maintenance can occur. Example: sun:05:00-sun:09:00
wait   Boolean. Wait for confirmation from boto that the cluster is in the available state.
salt.states.boto_elasticache.replication_group_absent(name, tags=None, region=None, key=None, keyid=None, profile=None)
salt.states.boto_elasticache.replication_group_present(*args, **kwargs)
salt.states.boto_elasticache.subnet_group_absent(name, tags=None, region=None, key=None, keyid=None, profile=None)
salt.states.boto_elasticache.subnet_group_present(name, subnet_ids=None, subnet_names=None, description=None, tags=None, region=None, key=None, keyid=None, profile=None) Ensure ElastiCache subnet group exists.
name   The name for the ElastiCache subnet group. This value is stored as a lowercase string.
subnet_ids A list of VPC subnet IDs for the cache subnet group. Exclusive with subnet_names.
subnet_names A list of VPC subnet names for the cache subnet group. Exclusive with subnet_ids.
description Subnet group description.
tags   A list of tags.
salt.states.boto_elasticsearch_domain Manage Elasticsearch Domains New in version 2016.11.0.
Create and destroy Elasticsearch domains. Be aware that this interacts with Amazon's services, and so may incur charges.
Ensure domain exists: boto_elasticsearch_domain.present: - DomainName: mydomain - profile='user-credentials' - ElasticsearchVersion: "2.3" - ElasticsearchClusterConfig: InstanceType": "t2.micro.elasticsearch" InstanceCount: 1 DedicatedMasterEnabled: False ZoneAwarenessEnabled: False - EBSOptions: EBSEnabled: True VolumeType: "gp2" VolumeSize: 10 Iops: 0 - AccessPolicies: Version: "2012-10-17" Statement: - Effect: "Allow" - Principal: AWS: "*" - Action: - "es:*" - Resource: "arn:aws:es:*:111111111111:domain/mydomain/*" - Condition: IpAddress: "aws:SourceIp": - "127.0.0.1" - "127.0.0.2" - SnapshotOptions: AutomatedSnapshotStartHour: 0 - AdvancedOptions: rest.action.multi.allow_explicit_index": "true" - Tags: a: "b" - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_elasticsearch_domain.absent(name, DomainName, region=None, key=None, keyid=None, profile=None) Ensure domain with passed properties is absent.
DomainName Name of the domain.
salt.states.boto_elasticsearch_domain.present(name, DomainName, ElasticsearchClusterConfig=None, EBSOptions=None, AccessPolicies=None, SnapshotOptions=None, AdvancedOptions=None, Tags=None, region=None, key=None, keyid=None, profile=None, ElasticsearchVersion='1.5') Ensure domain exists.
ElasticsearchClusterConfig Configuration options for an Elasticsearch domain. Specifies the instance type and number of instances in the domain cluster.
InstanceType (string) -- The instance type for an Elasticsearch cluster.
InstanceCount (integer) -- The number of instances in the specified domain cluster.
DedicatedMasterEnabled (boolean) -- A boolean value to indicate whether a dedicated master node is enabled.  See About Dedicated Master Nodes for more information.
ZoneAwarenessEnabled (boolean) -- A boolean value to indicate whether zone awareness is enabled. See About Zone Awareness for more information.
DedicatedMasterType (string) -- The instance type for a dedicated master node.
DedicatedMasterCount (integer) -- Total number of dedicated master nodes, active and on standby, for the cluster.
EBSOptions Options to enable, disable and specify the type and size of EBS storage volumes.
EBSEnabled (boolean) -- Specifies whether EBS-based storage is enabled.
VolumeType (string) -- Specifies the volume type for EBS-based storage.
VolumeSize (integer) -- Integer to specify the size of an EBS volume.
Iops (integer) -- Specifies the IOPD for a Provisioned IOPS EBS volume (SSD).
AccessPolicies IAM access policy
SnapshotOptions Option to set time, in UTC format, of the daily automated snapshot.  Default value is 0 hours.
AutomatedSnapshotStartHour (integer) -- Specifies the time, in UTC format, when the service takes a daily automated snapshot of the specified Elasticsearch domain. Default value is 0 hours.
AdvancedOptions Option to allow references to indices in an HTTP request body. Must be false when configuring access to individual sub-resources. By default, the value is true .
ElasticsearchVersion String of format X.Y to specify version for the Elasticsearch domain eg.  "1.5" or "2.3".
salt.states.boto_elb Manage ELBs
Create and destroy ELBs. Be aware that this interacts with Amazon's services, and so may incur charges.
This module accepts explicit elb 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 here.
Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - availability_zones: - us-east-1a - us-east-1c - us-east-1d - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - listeners: - elb_port: 443 instance_port: 80 elb_protocol: HTTPS instance_protocol: HTTP certificate: 'arn:aws:iam::1111111:server-certificate/mycert' policies: - my-ssl-policy - cookie-policy - elb_port: 8210 instance_port: 8210 elb_protocol: TCP - backends: - instance_port: 80 policies: - enable-proxy-protocol - health_check: target: 'HTTP:80/' - attributes: cross_zone_load_balancing: enabled: true access_log: enabled: true s3_bucket_name: 'mybucket' s3_bucket_prefix: 'my-logs' emit_interval: 5 connecting_settings: idle_timeout: 60 - cnames: - name: mycname.example.com. zone: example.com. ttl: 60 - name: myothercname.example.com. zone: example.com. - security_groups: - my-security-group - policies: - policy_name: my-ssl-policy policy_type: SSLNegotiationPolicyType policy: Protocol-TLSv1.2: true Protocol-SSLv3: false Server-Defined-Cipher-Order: true ECDHE-ECDSA-AES128-GCM-SHA256: true - policy_name: cookie-policy policy_type: LBCookieStickinessPolicyType policy: {}  # no policy means this is a session cookie - policy_name: enable-proxy-protocol policy_type: ProxyProtocolPolicyType policy: ProxyProtocol: true
# Using a profile from pillars Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - profile: myelbprofile
# Passing in a profile Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - profile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
It's possible to specify attributes from pillars by specifying a pillar. You can override the values defined in the pillard by setting the attributes on the resource. The module will use the default pillar key 'boto_elb_attributes', which allows you to set default attributes for all ELB resources.
Setting the attributes pillar:
my_elb_attributes: cross_zone_load_balancing: enabled: true connection_draining: enabled: true timeout: 20 access_log: enabled: true s3_bucket_name: 'mybucket' s3_bucket_prefix: 'my-logs' emit_interval: 5
Overriding the attribute values on the resource:
Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - attributes_from_pillar: my_elb_attributes # override cross_zone_load_balancing:enabled - attributes: cross_zone_load_balancing: enabled: false - profile: myelbprofile
It's possible to specify cloudwatch alarms that will be setup along with the ELB. Note the alarm name will be defined by the name attribute provided, plus the ELB resource name.
Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - profile: myelbprofile - alarms: UnHealthyHostCount: name: 'ELB UnHealthyHostCount **MANAGED BY SALT**' attributes: metric: UnHealthyHostCount namespace: AWS/ELB statistic: Average comparison: '>=' threshold: 1.0 period: 600 evaluation_periods: 6 unit: null description: ELB UnHealthyHostCount alarm_actions: ['arn:aws:sns:us-east-1:12345:myalarm'] insufficient_data_actions: [] ok_actions: ['arn:aws:sns:us-east-1:12345:myalarm']
You can also use alarms from pillars, and override values from the pillar alarms by setting overrides on the resource. Note that 'boto_elb_alarms' will be used as a default value for all resources, if defined and can be used to ensure alarms are always set for a resource.
my_elb_alarm: UnHealthyHostCount: name: 'ELB UnHealthyHostCount **MANAGED BY SALT**' attributes: metric: UnHealthyHostCount namespace: AWS/ELB statistic: Average comparison: '>=' threshold: 1.0 period: 600 evaluation_periods: 6 unit: null description: ELB UnHealthyHostCount alarm_actions: ['arn:aws:sns:us-east-1:12345:myalarm'] insufficient_data_actions: [] ok_actions: ['arn:aws:sns:us-east-1:12345:myalarm']
Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - profile: myelbprofile - alarms_from_pillar: my_elb_alarm # override UnHealthyHostCount:attributes:threshold - alarms: UnHealthyHostCount: attributes: threshold: 2.0
Tags can also be set:
Ensure myelb ELB exists: boto_elb.present: - name: myelb - region: us-east-1 - profile: myelbprofile - tags: MyTag: 'My Tag Value' OtherTag: 'My Other Value'
salt.states.boto_elb.absent(name, region=None, key=None, keyid=None, profile=None) Ensure an ELB does not exist
salt.states.boto_elb.present(name, listeners, availability_zones=None, subnets=None, subnet_names=None, security_groups=None, scheme='internet-facing', health_check=None, attributes=None, attributes_from_pillar='boto_elb_attributes', cnames=None, alarms=None, alarms_from_pillar='boto_elb_alarms', policies=None, policies_from_pillar='boto_elb_policies', backends=None, region=None, key=None, keyid=None, profile=None, wait_for_sync=True, tags=None, instance_ids=None, instance_names=None) Ensure the ELB exists.
name   Name of the ELB.
availability_zones A list of availability zones for this ELB.
listeners A list of listener lists; example:
[ ['443', 'HTTPS', 'arn:aws:iam::1111111:server-certificate/mycert'], ['8443', '80', 'HTTPS', 'HTTP', 'arn:aws:iam::1111111:server-certificate/mycert'] ]
subnets A list of subnet IDs in your VPC to attach to your LoadBalancer.
subnet_names A list of subnet names in your VPC to attach to your LoadBalancer.
security_groups The security groups assigned to your LoadBalancer within your VPC. Must be passed either as a list or a comma-separated string.
For example, a list:
- security_groups: - secgroup-one - secgroup-two
Or as a comma-separated string:
- security_groups: secgroup-one,secgroup-two
scheme The type of a LoadBalancer, internet-facing or internal. Once set, can not be modified.
health_check A dict defining the health check for this ELB.
attributes A dict defining the attributes to set on this ELB.  Unknown keys will be silently ignored.
See the salt.modules.boto_elb.set_attributes function for recognized attributes.
attributes_from_pillar name of pillar dict that contains attributes.   Attributes defined for this specific state will override those from pillar.
cnames A list of cname dicts with attributes needed for the DNS add_record state.  By default the boto_route53.add_record state will be used, which requires: name, zone, ttl, and identifier.  See the boto_route53 state for information about these attributes.  Other DNS modules can be called by specifying the provider keyword.  the cnames dict will be passed to the state as kwargs.
See the salt.states.boto_route53 state for information about these attributes.
alarms: a dictionary of name->boto_cloudwatch_alarm sections to be associated with this ELB.  All attributes should be specified except for dimension which will be automatically set to this ELB.
wait_for_sync Wait for an INSYNC change status from Route53.
tags   dict of tags
instance_ids list of instance ids.  The state will ensure that these, and ONLY these, instances are registered with the ELB. This is additive with instance_names.
instance_names list of instance names.  The state will ensure that these, and ONLY these, instances are registered with the ELB. This is additive with instance_ids.
salt.states.boto_elb.register_instances(name, instances, region=None, key=None, keyid=None, profile=None) Add EC2 instance(s) to an Elastic Load Balancer. Removing an instance from the instances list does not remove it from the ELB.
name   The name of the Elastic Load Balancer to add EC2 instances to.
instances A list of EC2 instance IDs that this Elastic Load Balancer should distribute traffic to. This state will only ever append new instances to the ELB. EC2 instances already associated with this ELB will not be removed if they are not in the instances list.
add-instances: boto_elb.register_instances: - name: myloadbalancer - instances: - instance-id1 - instance-id2
salt.states.boto_elbv2 Manage AWS Application Load Balancer
Add and remove targets from an ALB target group.
This module accepts explicit alb 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 here.
salt.states.boto_elbv2.create_target_group(name, protocol, port, vpc_id, region=None, key=None, keyid=None, profile=None, health_check_protocol='HTTP', health_check_port='traffic-port', health_check_path='/', health_check_interval_seconds=30, health_check_timeout_seconds=5, healthy_threshold_count=5, unhealthy_threshold_count=2, **kwargs) New in version 2017.11.0.
Create target group if not present.
create-target: boto_elb2.create_targets_group: - name: myALB - protocol: https - port: 443 - vpc_id: myVPC
salt.states.boto_elbv2.delete_target_group(name, region=None, key=None, keyid=None, profile=None) Delete target group.
name   (string) - The Amazon Resource Name (ARN) of the resource.
check-target: boto_elb2.delete_targets_group: - name: myALB - protocol: https - port: 443 - vpc_id: myVPC
salt.states.boto_elbv2.targets_deregistered(name, targets, region=None, key=None, keyid=None, profile=None, **kwargs) Remove targets to an Application Load Balancer target group.
name   The ARN of the Application Load Balancer Target Group to remove targets from.
targets A list of target IDs or a string of a single target registered to the target group to be removed
remove-targets: boto_elb.targets_deregistered: - name: arn:myloadbalancer - targets: - instance-id1 - instance-id2
salt.states.boto_elbv2.targets_registered(name, targets, region=None, key=None, keyid=None, profile=None, **kwargs) New in version 2017.7.0.
Add targets to an Application Load Balancer target group. This state will not remove targets.
name   The ARN of the Application Load Balancer Target Group to add targets to.
targets A list of target IDs or a string of a single target that this target group should distribute traffic to.
add-targets: boto_elb.targets_registered: - name: arn:myloadbalancer - targets: - instance-id1 - instance-id2
salt.states.boto_iam Manage IAM objects New in version 2015.8.0.
This module accepts explicit IAM 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 here.
delete-user: boto_iam.user_absent: - name: myuser - delete_keys: true
delete-keys: boto_iam.keys_absent: - access_keys: - 'AKIAJHTMIQ2ASDFLASDF' - 'PQIAJHTMIQ2ASRTLASFR' - user_name: myuser
create-user: boto_iam.user_present: - name: myuser - policies: mypolicy: | { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "*", "Resource": "*"}] } - password: NewPassword$$1 - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'fdkjsafkljsASSADFalkfjasdf'
create-group: boto_iam.group_present: - name: mygroup - users: - myuser - myuser1 - policies: mypolicy: | { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "*", "Resource": "*"}] } - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'safsdfsal;fdkjsafkljsASSADFalkfj'
change-policy: boto_iam.account_policy: - change_password: True - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'safsdfsal;fdkjsafkljsASSADFalkfj'
create server certificate: boto_iam.server_cert_present: - name: mycert - public_key: salt://base/mycert.crt - private_key: salt://base/mycert.key - cert_chain: salt://base/mycert_chain.crt - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'fdkjsafkljsASSADFalkfjasdf'
delete server certificate: boto_iam.server_cert_absent: - name: mycert
create keys for user: boto_iam.keys_present: - name: myusername - number: 2 - save_dir: /root - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'fdkjsafkljsASSADFalkfjasdf'
create policy: boto_iam.policy_present: - name: myname - policy_document: '{"MyPolicy": "Statement": [{"Action": ["sqs:*"], "Effect": "Allow", "Resource": ["arn:aws:sqs:*:*:*"], "Sid": "MyPolicySqs1"}]}' - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'fdkjsafkljsASSADFalkfjasdf'
add-saml-provider: boto_iam.saml_provider_present: - name: my_saml_provider - saml_metadata_document: salt://base/files/provider.xml - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'safsdfsal;fdkjsafkljsASSADFalkfj'
salt.states.boto_iam.account_policy(name=None, allow_users_to_change_password=None, hard_expiry=None, max_password_age=None, minimum_password_length=None, password_reuse_prevention=None, require_lowercase_characters=None, require_numbers=None, require_symbols=None, require_uppercase_characters=None, region=None, key=None, keyid=None, profile=None) Change account policy.
name (string) The name of the account policy
allow_users_to_change_password (bool) Allows all IAM users in your account to use the AWS Management Console to change their own passwords.
hard_expiry (bool) Prevents IAM users from setting a new password after their password has expired.
max_password_age (int) The number of days that an IAM user password is valid.
minimum_password_length (int) The minimum number of characters allowed in an IAM user password.
password_reuse_prevention (int) Specifies the number of previous passwords that IAM users are prevented from reusing.
require_lowercase_characters (bool) Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).
require_numbers (bool) Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
require_symbols (bool) Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters: ! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
require_uppercase_characters (bool) Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).
region (string) Region to connect to.
key (string) Secret key to be used.
keyid (string) Access key to be used.
profile (dict) A dict with region, key and keyid, or a pillar key (string)
salt.states.boto_iam.group_absent(name, region=None, key=None, keyid=None, profile=None) New in version 2015.8.0.
Ensure the IAM group is absent.
name (string) The name of the group.
profile (dict) A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
salt.states.boto_iam.group_present(name, policies=None, policies_from_pillars=None, managed_policies=None, users=None, path='/', region=None, key=None, keyid=None, profile=None, delete_policies=True) New in version 2015.8.0.
Ensure the IAM group is present
name (string) The name of the new group.
path (string) The path for the group, defaults to '/'
policies (dict) A dict of IAM group policy documents.
policies_from_pillars (list) A list of pillars that contain role policy dicts. Policies in the pillars will be merged in the order defined in the list and key conflicts will be handled by later defined keys overriding earlier defined keys. The policies defined here will be merged with the policies defined in the policies argument. If keys conflict, the keys in the policies argument will override the keys defined in policies_from_pillars.
managed_policies (list) A list of policy names or ARNs that should be attached to this group.
users (list) A list of users to be added to the group.
delete_policies (boolean) Delete or detach existing policies that are not in the given list of policies.  Default value is True. If False is specified, existing policies will not be deleted or detached allowing manual modifications on the IAM group to be persistent.
salt.states.boto_iam.keys_absent(access_keys, user_name, region=None, key=None, keyid=None, profile=None) New in version 2015.8.0.
Ensure the IAM user access_key_id is absent.
access_key_id (list) A list of access key ids
user_name (string) The username of the user
salt.states.boto_iam.keys_present(name, number, save_dir, region=None, key=None, keyid=None, profile=None, save_format='{2}\n{0}\n{3}\n{1}\n') New in version 2015.8.0.
Ensure the IAM access keys are present.
name (string) The name of the new user.
number (int) Number of keys that user should have.
save_dir (string) The directory that the key/keys will be saved. Keys are saved to a file named according to the username privided.
save_format (dict) Save format is repeated for each key. Default format is "{2}n{0}n{3}n{1}n", where {0} and {1} are placeholders for new key_id and key respectively, whereas {2} and {3} are "key_id-{number}" and 'key-{number}' strings kept for compatibility.
salt.states.boto_iam.policy_absent(name, region=None, key=None, keyid=None, profile=None) New in version 2015.8.0.
Ensure the IAM managed policy with the specified name is absent
name (string) The name of the new policy.
salt.states.boto_iam.policy_present(name, policy_document, path=None, description=None, region=None, key=None, keyid=None, profile=None) New in version 2015.8.0.
Ensure the IAM managed policy is present
policy_document (dict) The document of the new policy
path (string) The path in which the policy will be created. Default is '/'.
description (string) Description
salt.states.boto_iam.saml_provider_absent(name, region=None, key=None, keyid=None, profile=None) New in version 2016.11.0.
Ensure the SAML provider with the specified name is absent.
name (string) The name of the SAML provider.
saml_metadata_document (string) The xml document of the SAML provider.
salt.states.boto_iam.saml_provider_present(name, saml_metadata_document, region=None, key=None, keyid=None, profile=None) New in version 2016.11.0.
Ensure the SAML provider with the specified name is present.
salt.states.boto_iam.server_cert_absent(name, region=None, key=None, keyid=None, profile=None) Deletes a server certificate.
name (string) The name for the server certificate. Do not include the path in this value.
region (string) The name of the region to connect to.
key (string) The key to be used in order to connect
keyid (string) The keyid to be used in order to connect
profile (string) The profile that contains a dict of region, key, keyid
salt.states.boto_iam.server_cert_present(name, public_key, private_key, cert_chain=None, path=None, region=None, key=None, keyid=None, profile=None) Crete server certificate.
public_key (string) The contents of the public key certificate in PEM-encoded format.
private_key (string) The contents of the private key in PEM-encoded format.
cert_chain (string) The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
path (string) The path for the server certificate.
salt.states.boto_iam.user_absent(name, delete_keys=True, delete_mfa_devices=True, delete_profile=True, region=None, key=None, keyid=None, profile=None) New in version 2015.8.0.
Ensure the IAM user is absent. User cannot be deleted if it has keys.
delete_keys (bool) Delete all keys from user.
delete_mfa_devices (bool) Delete all mfa devices from user.
delete_profile (bool) Delete profile from user.
salt.states.boto_iam.user_present(name, policies=None, policies_from_pillars=None, managed_policies=None, password=None, path=None, region=None, key=None, keyid=None, profile=None) New in version 2015.8.0.
Ensure the IAM user is present
managed_policies (list) A list of managed policy names or ARNs that should be attached to this user.
password (string) The password for the new user. Must comply with account policy.
path (string) The path of the user. Default is '/'.
salt.states.boto_iam_role Manage IAM roles New in version 2014.7.0.
iam.keyid: GKTADJGHEIQSXMKKRBJ08H iam.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1
Creating a role will automatically create an instance profile and associate it with the role. This is the default behavior of the AWS console.
myrole: boto_iam_role.present: - region: us-east-1 - key: GKTADJGHEIQSXMKKRBJ08H - keyid: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - policies_from_pillars: - shared_iam_bootstrap_policy - policies: MySQSPolicy: Statement: - Action: - sqs:* Effect: Allow Resource: - arn:aws:sqs:*:*:* Sid: MyPolicySQS1 MyS3Policy: Statement: - Action: - s3:GetObject Effect: Allow Resource: - arn:aws:s3:*:*:mybucket/*
# Using a credentials profile from pillars myrole: boto_iam_role.present: - profile: myiamprofile
# Passing in a credentials profile myrole: boto_iam_role.present: - profile: key: GKTADJGHEIQSXMKKRBJ08H keyid: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1
If delete_policies: False is specified, existing policies that are not in the given list of policies will not be deleted. This allows manual modifications on the IAM role to be persistent. This functionality was added in 2015.8.0.
NOTE: When using the profile parameter and region is set outside of the profile group, region is ignored and a default region will be used.
If region is missing from the profile data set, us-east-1 will be used as the default region.
salt.states.boto_iam_role.absent(name, region=None, key=None, keyid=None, profile=None) Ensure the IAM role is deleted.
name   Name of the IAM role.
salt.states.boto_iam_role.present(name, policy_document=None, policy_document_from_pillars=None, path=None, policies=None, policies_from_pillars=None, managed_policies=None, create_instance_profile=True, region=None, key=None, keyid=None, profile=None, delete_policies=True) Ensure the IAM role exists.
policy_document The policy that grants an entity permission to assume the role.  (See https://boto.readthedocs.io/en/latest/ref/iam.html#boto.iam.connection.IAMConnection.create_role)
policy_document_from_pillars A pillar key that contains a role policy document. The statements defined here will be appended with the policy document statements defined in the policy_document argument.
path   The path to the role/instance profile.  (See https://boto.readthedocs.io/en/latest/ref/iam.html#boto.iam.connection.IAMConnection.create_role)
policies A dict of IAM role policies.
policies_from_pillars A list of pillars that contain role policy dicts. Policies in the pillars will be merged in the order defined in the list and key conflicts will be handled by later defined keys overriding earlier defined keys. The policies defined here will be merged with the policies defined in the policies argument. If keys conflict, the keys in the policies argument will override the keys defined in policies_from_pillars.
managed_policies A list of (AWS or Customer) managed policies to be attached to the role.
create_instance_profile A boolean of whether or not to create an instance profile and associate it with this role.
delete_policies Deletes existing policies that are not in the given list of policies. Default value is True. If False is specified, existing policies will not be deleted allowing manual modifications on the IAM role to be persistent.
salt.states.boto_iot Manage IoT Objects New in version 2016.3.0.
Create and destroy IoT objects. Be aware that this interacts with Amazon's services, and so may incur charges.
Ensure policy exists: boto_iot.policy_present: - policyName: mypolicy - policyDocument: Version: "2012-10-17" Statement: Action: - iot:Publish Resource: - "*" Effect: "Allow" - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
Ensure topic rule exists: boto_iot.topic_rule_present: - ruleName: myrule - sql: "SELECT * FROM 'iot/test'" - description: 'test rule' - ruleDisabled: false - actions: - lambda: functionArn: "arn:aws:us-east-1:1234:function/functionname" - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_iot.policy_absent(name, policyName, region=None, key=None, keyid=None, profile=None) Ensure policy with passed properties is absent.
policyName Name of the policy.
salt.states.boto_iot.policy_attached(name, policyName, principal, region=None, key=None, keyid=None, profile=None) Ensure policy is attached to the given principal.
principal The principal which can be a certificate ARN or a Cognito ID.
salt.states.boto_iot.policy_detached(name, policyName, principal, region=None, key=None, keyid=None, profile=None) Ensure policy is attached to the given principal.
salt.states.boto_iot.policy_present(name, policyName, policyDocument, region=None, key=None, keyid=None, profile=None) Ensure policy exists.
policyDocument The JSON document that describes the policy. The length of the policyDocument must be a minimum length of 1, with a maximum length of 2048, excluding whitespace.
salt.states.boto_iot.thing_type_absent(name, thingTypeName, region=None, key=None, keyid=None, profile=None) Ensure thing type with passed properties is absent.
thingTypeName Name of the thing type.
salt.states.boto_iot.thing_type_present(name, thingTypeName, thingTypeDescription, searchableAttributesList, region=None, key=None, keyid=None, profile=None) Ensure thing type exists.
thingTypeName Name of the thing type
thingTypeDescription Description of the thing type
searchableAttributesList List of string attributes that are searchable for the thing type
keyid  Access key to be used
profile A dict with region, key, keyid, or a pillar key (string) that contains a dict with region, key, and keyid