neulab/tldr huggingface dataset:
salt.states.boto3_route53.rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name=None, Type=None, SetIdentifier=None, Weight=None, Region=None, GeoLocation=None, Failover=None, TTL=None, ResourceRecords=None, AliasTarget=None, HealthCheckId=None, TrafficPolicyInstanceId=None, region=None, key=None, keyid=None, profile=None) Ensure the Route53 record is present.
HostedZoneId The ID of a zone to create the record in.  Exclusive with DomainName.
DomainName The domain name of a zone to create the record in. Exclusive with HostedZoneId.
PrivateZone Set to True if the resource record should be in a private zone, False if public.
Name   Name of the Route 53 resource record being managed.
Weight Valid for Weighted resource record sets only.  Among resource record sets that have the same combination of DNS name and type, a value that determines the proportion of DNS queries that Amazon Route 53 responds to using the current resource record set. Amazon Route 53 calculates the sum of the weights for the resource record sets that have the same combination of DNS name and type. Amazon Route 53 then responds to queries based on the ratio of a resource's weight to the total.
Note the following:
• You must specify a value for the Weight element for every weighted resource record set.
• You can only specify one ResourceRecord per weighted resource record set.
• You can't create latency, failover, or geolocation resource record sets that have the same values for the Name and Type elements as weighted resource record sets.
• You can create a maximum of 100 weighted resource record sets that have the same values for the Name and Type elements.
• For weighted (but not weighted alias) resource record sets, if you set Weight to 0 for a resource record set, Amazon Route 53 never responds to queries with the applicable value for that resource record set.  However, if you set Weight to 0 for all resource record sets that have the same combination of DNS name and type, traffic is routed to all resources with equal probability.  The effect of setting Weight to 0 is different when you associate health checks with weighted resource record sets. For more information, see Options for Configuring Amazon Route 53 Active-Active and Active-Passive Failover in the Amazon Route 53 Developer Guide.
Region Valid for Latency-based resource record sets only.  The Amazon EC2 Region where the resource that is specified in this resource record set resides. The resource typically is an AWS resource, such as an EC2 instance or an ELB load balancer, and is referred to by an IP address or a DNS domain name, depending on the record type.
GeoLocation Geo location resource record sets only.  A dict that lets you control how Route 53 responds to DNS queries based on the geographic origin of the query.  For example, if you want all queries from Africa to be routed to a web server with an IP address of 192.0.2.111, create a resource record set with a Type of A and a ContinentCode of AF.
ContinentCode The two-letter code for the continent. Valid values: AF | AN | AS | EU | OC | NA | SA Constraint: Specifying ContinentCode with either CountryCode or SubdivisionCode returns an InvalidInput error. CountryCode The two-letter code for the country. SubdivisionCode The code for the subdivision, for example, a state in the United States or a province in Canada.
• Creating geolocation and geolocation alias resource record sets in private hosted zones is not supported.
• If you create separate resource record sets for overlapping geographic regions (for example, one resource record set for a continent and one for a country on the same continent), priority goes to the smallest geographic region. This allows you to route most queries for a continent to one resource and to route queries for a country on that continent to a different resource.
• You can't create two geolocation resource record sets that specify the same geographic location.
• The value * in the CountryCode element matches all geographic locations that aren't specified in other geolocation resource record sets that have the same values for the Name and Type elements.
• Geolocation works by mapping IP addresses to locations. However, some IP addresses aren't mapped to geographic locations, so even if you create geolocation resource record sets that cover all seven continents, Amazon Route 53 will receive some DNS queries from locations that it can't identify.  We recommend that you create a resource record set for which the value of CountryCode is *, which handles both queries that come from locations for which you haven't created geolocation resource record sets and queries from IP addresses that aren't mapped to a location.  If you don't create a * resource record set, Amazon Route 53 returns a "no answer" response for queries from those locations.
• You can't create non-geolocation resource record sets that have the same values for the Name and Type elements as geolocation resource record sets.
TTL    The resource record cache time to live (TTL), in seconds. Note the following:
• If you're creating an alias resource record set, omit TTL. Amazon Route 53 uses the value of TTL for the alias target.
• If you're associating this resource record set with a health check (if you're adding a HealthCheckId element), we recommend that you specify a TTL of 60 seconds or less so clients respond quickly to changes in health status.
• All of the resource record sets in a group of weighted, latency, geolocation, or failover resource record sets must have the same value for TTL.
• If a group of weighted resource record sets includes one or more weighted alias resource record sets for which the alias target is an ELB load balancer, we recommend that you specify a TTL of 60 seconds for all of the non-alias weighted resource record sets that have the same name and type. Values other than 60 seconds (the TTL for load balancers) will change the effect of the values that you specify for Weight.
ResourceRecords A list, containing one or more values for the resource record.  No single value can exceed 4,000 characters.  For details on how to format values for different record types, see Supported DNS Resource Record Types in the Amazon Route 53 Developer Guide.
Note:  You can specify more than one value for all record types except CNAME and SOA.
It is also possible to pass "magic" strings as resource record values.  This functionality can easily be extended, but for the moment supports the following: 'magic:ec2_instance_tag:some_tag_name:some_string:some_instance_attr'
This tells salt to lookup an EC2 instance with a tag 'some_tag_name' which has the value 'some_string' and substitute the 'some_instance_attr' attribute of that instance as the resource record value being evaluated.
This should work generally for any EC2 instance tags, as long as the instance attribute being fetched is available to getattr(instance, 'attribute') as seen in the code below.  Anything else will most likely require this function to be extended to handle it.
The canonical use-case for this (at least at our site) is to query the Name tag (which we always populate with the host's FQDN) to lookup the public or private IPs bound to the instance, so we can then automgically create Route 53 records for them.
AliasTarget The rules governing how to define an AliasTarget for the various supported use-cases are obtuse beyond reason and attempting to paraphrase them (or even worse, cut-and-paste them in their entirety) would be silly and counterproductive.  If you need this feature, then Read The Fine Materials at the Boto 3 Route 53 page and/or the AWS Route 53 docs and suss them for yourself - I sure won't claim to understand them partcularly well.
salt.states.boto3_sns Manage SNS Topics Create and destroy SNS topics. Be aware that this interacts with Amazon's services, and so may incur charges.
This module uses boto, which can be installed via package, or pip.
This module accepts explicit AWS 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.
mytopic: boto3_sns.topic_present: - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
Using a profile from pillars mytopic: boto3_sns.topic_present: - region: us-east-1 - profile: mysnsprofile
Passing in a profile mytopic: boto3_sns.topic_present: - region: us-east-1 - profile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto3_sns.topic_absent(name, unsubscribe=False, region=None, key=None, keyid=None, profile=None) Ensure the named sns topic is deleted.
name   Name of the SNS topic.
unsubscribe If True, unsubscribe all subcriptions to the SNS topic before deleting the SNS topic
salt.states.boto3_sns.topic_present(name, subscriptions=None, attributes=None, region=None, key=None, keyid=None, profile=None) Ensure the SNS topic exists.
subscriptions List of SNS subscriptions.
Each subscription is a dictionary with a protocol and endpoint key:
subscriptions: - Protocol: https Endpoint: https://www.example.com/sns-endpoint - Protocol: sqs Endpoint: arn:aws:sqs:us-west-2:123456789012:MyQueue
attributes Dictionary of attributes to set on the SNS topic Valid attribute keys are:
• Policy:  the JSON serialization of the topic's access control policy
DisplayName: the human-readable name used in the From field for notifications to email and email-json endpoints
• DeliveryPolicy:  the JSON serialization of the topic's delivery policy
salt.states.boto_apigateway Manage Apigateway Rest APIs New in version 2016.11.0.
Create and destroy rest apis depending on a swagger version 2 definition file.  Be aware that this interacts with Amazon's services, and so may incur charges.
This module accepts explicit vpc 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 Apigateway API exists: boto_apigateway.present: - name: myfunction - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_apigateway.absent(name, api_name, stage_name, nuke_api=False, region=None, key=None, keyid=None, profile=None) Ensure the stage_name associated with the given api_name deployed by boto_apigateway's present state is removed.  If the currently associated deployment to the given stage_name has no other stages associated with it, the deployment will also be removed.
name   Name of the swagger file in YAML format
api_name Name of the rest api on AWS ApiGateway to ensure is absent.
stage_name Name of the stage to be removed irrespective of the swagger file content.  If the current deployment associated with the stage_name has no other stages associated with it, the deployment will also be removed.
nuke_api If True, removes the API itself only if there are no other stages associated with any other deployments once the given stage_name is removed.
salt.states.boto_apigateway.present(name, api_name, swagger_file, stage_name, api_key_required, lambda_integration_role, lambda_region=None, stage_variables=None, region=None, key=None, keyid=None, profile=None, lambda_funcname_format='{stage}_{api}_{resource}_{method}', authorization_type='NONE', error_response_template=None, response_template=None) Ensure the spcified api_name with the corresponding swaggerfile is deployed to the given stage_name in AWS ApiGateway.
this state currently only supports ApiGateway integration with AWS Lambda, and CORS support is handled through a Mock integration.
There may be multiple deployments for the API object, each deployment is tagged with a description (i.e. unique label) in pretty printed json format consisting of the following key/values.
{ "api_name": api_name, "swagger_file": basename_of_swagger_file "swagger_file_md5sum": md5sum_of_swagger_file, "swagger_info_object": info_object_content_in_swagger_file }
Please note that the name of the lambda function to be integrated will be derived via the provided lambda_funcname_format parameters:
• the default lambda_funcname_format is a string with the following substitutable keys: "{stage}_{api}_{resource}_{method}".  The user can choose to reorder the known keys.
• the stage key corresponds to the stage_name passed in.
• the api key corresponds to the api_name passed in.
• the resource corresponds to the resource path defined in the passed swagger file.
• the method corresponds to the method for a resource path defined in the passed swagger file.
For the default lambda_funcname_format, given the following input:
api_name = '  Test    Service' stage_name = 'alpha' basePath = '/api' path = '/a/{b}/c' method = 'POST'
We will end up with the following Lambda Function Name that will be looked up: 'test_service_alpha_a_b_c_post'
The canconicalization of these input parameters is done in the following order:
1. lambda_funcname_format is formatted with the input parameters as passed,
2. resulting string is stripped for leading/trailing spaces,
3. path parameter's curly braces are removed from the resource path,
4. consecutive spaces and forward slashes in the paths are replaced with '_'
5. consecutive '_' are replaced with '_'
Please note that for error response handling, the swagger file must have an error response model with the following schema.  The lambda functions should throw exceptions for any non successful responses.  An optional pattern field can be specified in errorMessage field to aid the response mapping from Lambda to the proper error return status codes.
Error: type: object properties: stackTrace: type: array items: type: array items: type: string description: call stack errorType: type: string description: error type errorMessage: type: string description: | Error message, will be matched based on pattern. If no pattern is specified, the default pattern used for response mapping will be +*.
name   The name of the state definition
api_name The name of the rest api that we want to ensure exists in AWS API Gateway
swagger_file Name of the location of the swagger rest api definition file in YAML format.
stage_name Name of the stage we want to be associated with the given api_name and swagger_file definition
api_key_required True or False - whether the API Key is required to call API methods
lambda_integration_role The name or ARN of the IAM role that the AWS ApiGateway assumes when it executes your lambda function to handle incoming requests
lambda_region The region where we expect to find the lambda functions. This is used to determine the region where we should look for the Lambda Function for integration purposes.  The region determination is based on the following priority:
1. lambda_region as passed in (is not None)
2. if lambda_region is None, use the region as if a boto_lambda function were executed without explicitly specifying lambda region.
3. if region determined in (2) is different than the region used by boto_apigateway functions, a final lookup will be attempted using the boto_apigateway region.
stage_variables A dict with variables and their values, or a pillar key (string) that contains a dict with variables and their values.  key and values in the dict must be strings. {'string': 'string'}
lambda_funcname_format Please review the earlier example for the usage.  The only substituable keys in the funcname format are {stage}, {api}, {resource}, {method}.  Any other keys or positional subsitution parameters will be flagged as an invalid input.
authorization_type This field can be either 'NONE', or 'AWS_IAM'.  This will be applied to all methods in the given swagger spec file. Default is set to 'NONE'
error_response_template String value that defines the response template mapping that should be applied in cases error occurs.  Refer to AWS documentation for details: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
If set to None, the following default value is used:
'#set($inputRoot = $input.path('$'))\n' '{\n' '  "errorMessage" : "$inputRoot.errorMessage",\n' '  "errorType" : "$inputRoot.errorType",\n' '  "stackTrace" : [\n' '#foreach($stackTrace in $inputRoot.stackTrace)\n' '    [\n' '#foreach($elem in $stackTrace)\n' '      "$elem"\n' '#if($foreach.hasNext),#end\n' '#end\n' '    ]\n' '#if($foreach.hasNext),#end\n' '#end\n' '  ]\n'
response_template String value that defines the response template mapping applied in case of success (including OPTIONS method) If set to None, empty ({}) template is assumed, which will transfer response from the lambda function as is.
salt.states.boto_apigateway.usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profile=None) Ensures usage plan identified by name is no longer present
name   name of the state
plan_name name of the plan to remove
usage plan absent: boto_apigateway.usage_plan_absent: - plan_name: my_usage_plan - profile: my_profile
salt.states.boto_apigateway.usage_plan_association_absent(name, plan_name, api_stages, region=None, key=None, keyid=None, profile=None) Ensures usage plan identified by name is removed from provided api_stages If a plan is associated to stages not listed in api_stages parameter, those associations remain intact.
plan_name name of the plan to use
api_stages list of dictionaries, where each dictionary consists of the following keys:
apiId  apiId of the api to detach usage plan from
stage  stage name of the api to detach usage plan from
UsagePlanAssociationAbsent: boto_apigateway.usage_plan_association_absent: - plan_name: my_plan - api_stages: - apiId: 9kb0404ec0 stage: my_stage - apiId: l9v7o2aj90 stage: my_stage - profile: my_profile
salt.states.boto_apigateway.usage_plan_association_present(name, plan_name, api_stages, region=None, key=None, keyid=None, profile=None) Ensures usage plan identified by name is added to provided api_stages
apiId  apiId of the api to attach usage plan to
stage  stage name of the api to attach usage plan to
UsagePlanAssociationPresent: boto_apigateway.usage_plan_association_present: - plan_name: my_plan - api_stages: - apiId: 9kb0404ec0 stage: my_stage - apiId: l9v7o2aj90 stage: my_stage - profile: my_profile
salt.states.boto_apigateway.usage_plan_present(name, plan_name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None) Ensure the spcifieda usage plan with the corresponding metrics is deployed
plan_name [Required] name of the usage plan
throttle [Optional] throttling parameters expressed as a dictionary. If provided, at least one of the throttling parameters must be present
rateLimit rate per second at which capacity bucket is populated
burstLimit maximum rate allowed
quota  [Optional] quota on the number of api calls permitted by the plan.  If provided, limit and period must be present
limit  [Required] number of calls permitted per quota period
offset [Optional] number of calls to be subtracted from the limit at the beginning of the period
period [Required] period to which quota applies. Must be DAY, WEEK or MONTH
UsagePlanPresent: boto_apigateway.usage_plan_present: - plan_name: my_usage_plan - throttle: rateLimit: 70 burstLimit: 100 - quota: limit: 1000 offset: 0 period: DAY - profile: my_profile
salt.states.boto_asg Manage Autoscale Groups New in version 2014.7.0.
Create and destroy autoscale groups. Be aware that this interacts with Amazon's services, and so may incur charges.
This module accepts explicit autoscale 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:
Ensure myasg exists: boto_asg.present: - name: myasg - launch_config_name: mylc - availability_zones: - us-east-1a - us-east-1b - min_size: 1 - max_size: 1 - desired_capacity: 1 - load_balancers: - myelb - suspended_processes: - AddToLoadBalancer - AlarmNotification - scaling_policies - adjustment_type: ChangeInCapacity - as_name: api-production-iad - cooldown: 1800 - min_adjustment_step: None - name: ScaleDown - scaling_adjustment: -1 - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# Using a profile from pillars. Ensure myasg exists: boto_asg.present: - name: myasg - launch_config_name: mylc - availability_zones: - us-east-1a - us-east-1b - min_size: 1 - max_size: 1 - desired_capacity: 1 - load_balancers: - myelb - profile: myprofile
# Passing in a profile. Ensure myasg exists: boto_asg.present: - name: myasg - launch_config_name: mylc - availability_zones: - us-east-1a - us-east-1b - min_size: 1 - max_size: 1 - desired_capacity: 1 - load_balancers: - myelb - profile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1
# Deleting an autoscale group with running instances. Ensure myasg is deleted: boto_asg.absent: - name: myasg # If instances exist, we must force the deletion of the asg. - force: True
It's possible to specify cloudwatch alarms that will be setup along with the ASG. Note the alarm name will be the name attribute defined, plus the ASG resource name.
Ensure myasg exists: boto_asg.present: - name: myasg - launch_config_name: mylc - availability_zones: - us-east-1a - us-east-1b - min_size: 1 - max_size: 1 - desired_capacity: 1 - load_balancers: - myelb - profile: myprofile - alarms: CPU: name: 'ASG CPU **MANAGED BY SALT**' attributes: metric: CPUUtilization namespace: AWS/EC2 statistic: Average comparison: '>=' threshold: 65.0 period: 60 evaluation_periods: 30 unit: null description: 'ASG CPU' 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_asg_alarms' will be used as a default value for all resources, if defined and can be used to ensure alarms are always set for an ASG resource.
Setting the alarms in a pillar:
my_asg_alarm: CPU: name: 'ASG CPU **MANAGED BY SALT**' attributes: metric: CPUUtilization namespace: AWS/EC2 statistic: Average comparison: '>=' threshold: 65.0 period: 60 evaluation_periods: 30 unit: null description: 'ASG CPU' alarm_actions: [ 'arn:aws:sns:us-east-1:12345:myalarm' ] insufficient_data_actions: [] ok_actions: [ 'arn:aws:sns:us-east-1:12345:myalarm' ]
Overriding the alarm values on the resource:
Ensure myasg exists: boto_asg.present: - name: myasg - launch_config_name: mylc - availability_zones: - us-east-1a - us-east-1b - min_size: 1 - max_size: 1 - desired_capacity: 1 - load_balancers: - myelb - profile: myprofile - alarms_from_pillar: my_asg_alarm # override CPU:attributes:threshold - alarms: CPU: attributes: threshold: 50.0
salt.states.boto_asg.absent(name, force=False, region=None, key=None, keyid=None, profile=None, remove_lc=False) Ensure the named autoscale group is deleted.
name   Name of the autoscale group.
force  Force deletion of autoscale group.
remove_lc Delete the launch config as well.
salt.states.boto_asg.present(name, launch_config_name, availability_zones, min_size, max_size, launch_config=None, desired_capacity=None, load_balancers=None, default_cooldown=None, health_check_type=None, health_check_period=None, placement_group=None, vpc_zone_identifier=None, subnet_names=None, tags=None, termination_policies=None, termination_policies_from_pillar='boto_asg_termination_policies', suspended_processes=None, scaling_policies=None, scaling_policies_from_pillar='boto_asg_scaling_policies', scheduled_actions=None, scheduled_actions_from_pillar='boto_asg_scheduled_actions', alarms=None, alarms_from_pillar='boto_asg_alarms', region=None, key=None, keyid=None, profile=None, notification_arn=None, notification_arn_from_pillar='boto_asg_notification_arn', notification_types=None, notification_types_from_pillar='boto_asg_notification_types') Ensure the autoscale group exists.
launch_config_name Name of the launch config to use for the group.  Or, if launch_config is specified, this will be the launch config name's prefix.  (see below)
launch_config A dictionary of launch config attributes.  If specified, a launch config will be used or created, matching this set of attributes, and the autoscale group will be set to use that launch config.  The launch config name will be the launch_config_name followed by a hyphen followed by a hash of the launch_config dict contents.  Example:
my_asg: boto_asg.present: - launch_config: - ebs_optimized: false - instance_profile_name: my_iam_profile - kernel_id: '' - ramdisk_id: '' - key_name: my_ssh_key - image_name: aws2015091-hvm - instance_type: c3.xlarge - instance_monitoring: false - security_groups: - my_sec_group_01 - my_sec_group_02
availability_zones List of availability zones for the group.
min_size Minimum size of the group.
max_size Maximum size of the group.
desired_capacity The desired capacity of the group.
load_balancers List of load balancers for the group. Once set this can not be updated (Amazon restriction).
default_cooldown Number of seconds after a Scaling Activity completes before any further scaling activities can start.
health_check_type The service you want the health status from, Amazon EC2 or Elastic Load Balancer (EC2 or ELB).
health_check_period Length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.
placement_group Physical location of your cluster placement group created in Amazon EC2. Once set this can not be updated (Amazon restriction).
vpc_zone_identifier A list of the subnet identifiers of the Virtual Private Cloud.
subnet_names For VPC, a list of subnet names (NOT subnet IDs) to deploy into.  Exclusive with vpc_zone_identifier.
tags   A list of tags. Example:
- key: 'key' value: 'value' propagate_at_launch: true
termination_policies A list of termination policies. Valid values are:
• OldestInstance
• NewestInstance
• OldestLaunchConfiguration
• ClosestToNextInstanceHour
If no value is specified, the Default value is used.
termination_policies_from_pillar: name of pillar dict that contains termination policy settings.   Termination policies defined for this specific state will override those from pillar.
suspended_processes List of processes to be suspended. see http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html
scaling_policies List of scaling policies.  Each policy is a dict of key-values described by https://boto.readthedocs.io/en/latest/ref/autoscale.html#boto.ec2.autoscale.policy.ScalingPolicy
scaling_policies_from_pillar: name of pillar dict that contains scaling policy settings. Scaling policies defined for this specific state will override those from pillar.
scheduled_actions: a dictionary of scheduled actions. Each key is the name of scheduled action and each value is dictionary of options. For example:
- scheduled_actions: scale_up_at_10: desired_capacity: 4 min_size: 3 max_size: 5 recurrence: "0 9 * * 1-5" scale_down_at_7: desired_capacity: 1 min_size: 1 max_size: 1 recurrence: "0 19 * * 1-5"
scheduled_actions_from_pillar: name of pillar dict that contains scheduled_actions settings. Scheduled actions for this specific state will override those from pillar.
alarms: a dictionary of name->boto_cloudwatch_alarm sections to be associated with this ASG.  All attributes should be specified except for dimension which will be automatically set to this ASG.
See the salt.states.boto_cloudwatch_alarm state for information about these attributes.
If any alarm actions include  ":self:" this will be replaced with the asg name.  For example, alarm_actions reading "['scaling_policy:self:ScaleUp']" will map to the arn for this asg's scaling policy named "ScaleUp".  In addition, any alarms that have only scaling_policy as actions will be ignored if min_size is equal to max_size for this ASG.
alarms_from_pillar: name of pillar dict that contains alarm settings.   Alarms defined for this specific state will override those from pillar.
notification_arn The AWS arn that notifications will be sent to
notification_arn_from_pillar name of the pillar dict that contains notifcation_arn settings.  A notification_arn defined for this specific state will override the one from pillar.
notification_types A list of event names that will trigger a notification. The list of valid notification types is:
• autoscaling:EC2_INSTANCE_LAUNCH
• autoscaling:EC2_INSTANCE_LAUNCH_ERROR
• autoscaling:EC2_INSTANCE_TERMINATE
• autoscaling:EC2_INSTANCE_TERMINATE_ERROR
• autoscaling:TEST_NOTIFICATION
notification_types_from_pillar name of the pillar dict that contains notifcation_types settings.  notification_types defined for this specific state will override those from the pillar.
salt.states.boto_cfn Connection module for Amazon Cloud Formation
configuration This module accepts explicit AWS 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
stack-present: boto_cfn.present: - name: mystack - template_body: salt://base/mytemplate.json - disable_rollback: true - region: eu-west-1 - keyid: 'AKIAJHTMIQ2ASDFLASDF' - key: 'fdkjsafkljsASSADFalkfjasdf'
stack-absent: boto_cfn.absent: - name: mystack
salt.states.boto_cfn.absent(name, region=None, key=None, keyid=None, profile=None) Ensure cloud formation stack is absent.
name (string) – The name of the stack to delete.
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) that contains a dict with region, key and keyid.
salt.states.boto_cfn.present(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=None, timeout_in_minutes=None, capabilities=None, tags=None, on_failure=None, stack_policy_body=None, stack_policy_url=None, use_previous_template=None, stack_policy_during_update_body=None, stack_policy_during_update_url=None, region=None, key=None, keyid=None, profile=None) Ensure cloud formation stack is present.
name (string) - Name of the stack.
template_body (string) – Structure containing the template body. Can also be loaded from a file by using salt://.
template_url (string) – Location of file containing the template body. The URL must point to a template located in an S3 bucket in the same region as the stack.
parameters (list) – A list of key/value tuples that specify input parameters for the stack. A 3-tuple (key, value, bool) may be used to specify the UsePreviousValue option.
notification_arns (list) – The Simple Notification Service (SNS) topic ARNs to publish stack related events.  You can find your SNS topic ARNs using the SNS_console or your Command Line Interface (CLI).
disable_rollback (bool) – Indicates whether or not to rollback on failure.
timeout_in_minutes (integer) – The amount of time that can pass before the stack status becomes CREATE_FAILED; if DisableRollback is not set or is set to False, the stack will be rolled back.
capabilities (list) – The list of capabilities you want to allow in the stack. Currently, the only valid capability is ‘CAPABILITY_IAM’.
tags (dict) – A set of user-defined Tags to associate with this stack, represented by key/value pairs. Tags defined for the stack are propagated to EC2 resources that are created as part of the stack. A maximum number of 10 tags can be specified.
on_failure (string) – Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING, ROLLBACK, or DELETE. You can specify either OnFailure or DisableRollback, but not both.
stack_policy_body (string) – Structure containing the stack policy body. Can also be loaded from a file by using salt://.
stack_policy_url (string) – Location of a file containing the stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack.If you pass StackPolicyBody and StackPolicyURL, only StackPolicyBody is used.
use_previous_template (boolean) – Used only when templates are not the same. Set to True to use the previous template instead of uploading a new one via TemplateBody or TemplateURL.
stack_policy_during_update_body (string) – Used only when templates are not the same. Structure containing the temporary overriding stack policy body. If you pass StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL, only StackPolicyDuringUpdateBody is used. Can also be loaded from a file by using salt://.
stack_policy_during_update_url (string) – Used only when templates are not the same. Location of a file containing the temporary overriding stack policy. The URL must point to a policy (max size: 16KB) located in an S3 bucket in the same region as the stack. If you pass StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL, only StackPolicyDuringUpdateBody is used.
salt.states.boto_cloudfront Manage CloudFront distributions
Create, update and destroy CloudFront distributions.
This module accepts explicit AWS 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.
If IAM roles are not used you need to specify them, either in a pillar file or in the minion's config file:
It's also possible to specify key, keyid, and region via a profile, either passed in as a dict, or a string to pull from pillars or minion config:
aws: region: us-east-1: profile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1
salt.states.boto_cloudfront.present(name, config, tags, region=None, key=None, keyid=None, profile=None) Ensure the CloudFront distribution is present.
name (string) Name of the CloudFront distribution
config (dict) Configuration for the distribution
tags (dict) Tags to associate with the distribution
region (string) Region to connect to
key (string) Secret key to use
keyid (string) Access key to use
profile (dict or string) A dict with region, key, and keyid, or a pillar key (string) that contains such a dict.
Manage my_distribution CloudFront distribution: boto_cloudfront.present: - name: my_distribution - config: Comment: 'partial config shown, most parameters elided' Enabled: True - tags: testing_key: testing_value
salt.states.boto_cloudtrail Manage CloudTrail Objects New in version 2016.3.0.
Create and destroy CloudTrail objects. Be aware that this interacts with Amazon's services, and so may incur charges.
Ensure trail exists: boto_cloudtrail.present: - Name: mytrail - S3BucketName: mybucket - S3KeyPrefix: prefix - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_cloudtrail.absent(name, Name, region=None, key=None, keyid=None, profile=None) Ensure trail with passed properties is absent.
Name   Name of the trail.
salt.states.boto_cloudtrail.present(name, Name, S3BucketName, S3KeyPrefix=None, SnsTopicName=None, IncludeGlobalServiceEvents=True, IsMultiRegionTrail=None, EnableLogFileValidation=False, CloudWatchLogsLogGroupArn=None, CloudWatchLogsRoleArn=None, KmsKeyId=None, LoggingEnabled=True, Tags=None, region=None, key=None, keyid=None, profile=None) Ensure trail exists.
S3BucketName Specifies the name of the Amazon S3 bucket designated for publishing log files.
S3KeyPrefix Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery.
SnsTopicName Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
IncludeGlobalServiceEvents Specifies whether the trail is publishing events from global services such as IAM to the log files.
EnableLogFileValidation Specifies whether log file integrity validation is enabled. The default is false.
CloudWatchLogsLogGroupArn Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.
CloudWatchLogsRoleArn Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
KmsKeyId Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be a an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
LoggingEnabled Whether logging should be enabled for the trail
Tags   A dictionary of tags that should be set on the trail
salt.states.boto_cloudwatch_alarm Manage Cloudwatch alarms
Create and destroy cloudwatch alarms. Be aware that this interacts with Amazon's services, and so may incur charges.
This module accepts explicit 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:
my test alarm: boto_cloudwatch_alarm.present: - name: my test alarm - attributes: metric: ApproximateNumberOfMessagesVisible namespace: AWS/SQS statistic: Average comparison: ">=" threshold: 20000.0 period: 60 evaluation_periods: 1 description: test alarm via salt dimensions: QueueName: - the-sqs-queue-name alarm_actions: - arn:aws:sns:us-east-1:1111111:myalerting-action
salt.states.boto_cloudwatch_alarm.absent(name, region=None, key=None, keyid=None, profile=None) Ensure the named cloudwatch alarm is deleted.
name   Name of the alarm.
salt.states.boto_cloudwatch_alarm.present(name, attributes, region=None, key=None, keyid=None, profile=None) Ensure the cloudwatch alarm exists.
name   Name of the alarm
attributes A dict of key/value cloudwatch alarm attributes.
salt.states.boto_cloudwatch_event Manage CloudTrail Objects New in version 2016.11.0.
Create and destroy CloudWatch event rules. Be aware that this interacts with Amazon's services, and so may incur charges.
Ensure event rule exists: boto_cloudwatch_event.present: - Name: mytrail - ScheduleExpression: 'rate(120 minutes)' - State: 'DISABLED' - Targets: - Id: "target1" Arn: "arn:aws:lambda:us-west-1:124456715622:function:my_function" Input: '{"arbitrary": "json"}' - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_cloudwatch_event.absent(name, Name=None, region=None, key=None, keyid=None, profile=None) Ensure CloudWatch event rule with passed properties is absent.
Name   Name of the event rule.  Defaults to the value of the 'name' param if not provided.
salt.states.boto_cloudwatch_event.present(name, Name=None, ScheduleExpression=None, EventPattern=None, Description=None, RoleArn=None, State=None, Targets=None, region=None, key=None, keyid=None, profile=None) Ensure trail exists.
ScheduleExpression The scheduling expression. For example, cron(0 20 * * ? *), "rate(5 minutes)"
EventPattern The event pattern.
Description A description of the rule
State  Indicates whether the rule is ENABLED or DISABLED.
RoleArn The Amazon Resource Name (ARN) of the IAM role associated with the rule.
Targets A list of rresources to be invoked when the rule is triggered.
salt.states.boto_cognitoidentity Manage CognitoIdentity Functions New in version 2016.11.0.
Create and destroy CognitoIdentity identity pools. Be aware that this interacts with Amazon's services, and so may incur charges.
Ensure function exists: boto_cognitoidentity.pool_present: - PoolName: my_identity_pool - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_cognitoidentity.pool_absent(name, IdentityPoolName, RemoveAllMatched=False, region=None, key=None, keyid=None, profile=None) Ensure cognito identity pool with passed properties is absent.
IdentityPoolName Name of the Cognito Identity Pool.  Please note that this may match multiple pools with the same given name, in which case, all will be removed.
RemoveAllMatched If True, all identity pools with the matching IdentityPoolName will be removed.  If False and there are more than one identity pool with the matching IdentityPoolName, no action will be taken.  If False and there is only one identity pool with the matching IdentityPoolName, the identity pool will be removed.
salt.states.boto_cognitoidentity.pool_present(name, IdentityPoolName, AuthenticatedRole, AllowUnauthenticatedIdentities=False, UnauthenticatedRole=None, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, region=None, key=None, keyid=None, profile=None) Ensure Cognito Identity Pool exists.
IdentityPoolName Name of the Cognito Identity Pool
AuthenticatedRole An IAM role name or ARN that will be associated with temporary AWS credentials for an authenticated cognito identity.
AllowUnauthenticatedIdentities Whether to allow anonymous user identities
UnauthenticatedRole An IAM role name or ARN that will be associated with anonymous user identities
SupportedLoginProviders A dictionary or pillar that contains key:value pairs mapping provider names to provider app IDs.
DeveloperProviderName A string which is the domain by which Cognito will refer to your users.  This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider.  Once you have set a developer provider name, you cannot change it.  Please take care in setting this parameter.
OpenIdConnectProviderARNs A list or pillar name that contains a list of OpenID Connect provider ARNs.
salt.states.boto_datapipeline Manage Data Pipelines
Be aware that this interacts with Amazon's services, and so may incur charges.
datapipeline.keyid: GKTADJGHEIQSXMKKRBJ08H datapipeline.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
Ensure daily data pipeline exists: boto_datapipeline.present: - name: my-datapipeline - pipeline_objects: DefaultSchedule: name: Every 1 day fields: period: 1 Day type: Schedule startAt: FIRST_ACTIVATION_DATE_TIME - parameter_values: myDDBTableName: my-dynamo-table
salt.states.boto_datapipeline.absent(name, region=None, key=None, keyid=None, profile=None) Ensure a pipeline with the service_name does not exist
name   Name of the service to ensure a data pipeline does not exist for.
salt.states.boto_datapipeline.present(name, pipeline_objects=None, pipeline_objects_from_pillars='boto_datapipeline_pipeline_objects', parameter_objects=None, parameter_objects_from_pillars='boto_datapipeline_parameter_objects', parameter_values=None, parameter_values_from_pillars='boto_datapipeline_parameter_values', region=None, key=None, keyid=None, profile=None) Ensure the data pipeline exists with matching definition.
name   Name of the service to ensure a data pipeline exists for.
pipeline_objects Pipeline objects to use. Will override objects read from pillars.
pipeline_objects_from_pillars The pillar key to use for lookup.
parameter_objects Parameter objects to use. Will override objects read from pillars.
parameter_objects_from_pillars The pillar key to use for lookup.
parameter_values Parameter values to use. Will override values read from pillars.
parameter_values_from_pillars The pillar key to use for lookup.
salt.states.boto_dynamodb Manage DynamoDB Tables New in version 2015.5.0.
Create and destroy DynamoDB tables. Be aware that this interacts with Amazon's services, and so may incur charges.
This module accepts explicit DynamoDB 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.
keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1
Ensure DynamoDB table does not exist: boto_dynamodb.absent: - table_name: new_table - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - region: us-east-1
Ensure DynamoDB table exists: boto_dynamodb.present: - table_name: new_table - read_capacity_units: 1 - write_capacity_units: 2 - hash_key: primary_id - hash_key_data_type: N - range_key: start_timestamp - range_key_data_type: N - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - region: us-east-1 - local_indexes: - index: - name: "primary_id_end_timestamp_index" - hash_key: primary_id - hash_key_data_type: N - range_key: end_timestamp - range_key_data_type: N - global_indexes: - index: - name: "name_end_timestamp_index" - hash_key: name - hash_key_data_type: S - range_key: end_timestamp - range_key_data_type: N - read_capacity_units: 3 - write_capacity_units: 4
It's possible to specify cloudwatch alarms that will be setup along with the DynamoDB table. Note the alarm name will be defined by the name attribute provided, plus the DynamoDB resource name.
Ensure DynamoDB table exists: boto_dynamodb.present: - name: new_table - read_capacity_units: 1 - write_capacity_units: 2 - hash_key: primary_id - hash_key_data_type: N - range_key: start_timestamp - range_key_data_type: N - alarms: ConsumedWriteCapacityUnits: name: 'DynamoDB ConsumedWriteCapacityUnits **MANAGED BY SALT**' attributes: metric: ConsumedWriteCapacityUnits namespace: AWS/DynamoDB statistic: Sum comparison: '>=' # threshold_percent is used to calculate the actual threshold # based on the provisioned capacity for the table. threshold_percent: 0.75 period: 300 evaluation_periods: 2 unit: Count description: 'DynamoDB ConsumedWriteCapacityUnits' alarm_actions: [ 'arn:aws:sns:us-east-1:1234:my-alarm' ] insufficient_data_actions: [] ok_actions: [ 'arn:aws:sns:us-east-1:1234:my-alarm' ] - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs - region: us-east-1
You can also use alarms from pillars, and override values from the pillar alarms by setting overrides on the resource. Note that 'boto_dynamodb_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.
boto_dynamodb_alarms: ConsumedWriteCapacityUnits: name: 'DynamoDB ConsumedWriteCapacityUnits **MANAGED BY SALT**' attributes: metric: ConsumedWriteCapacityUnits namespace: AWS/DynamoDB statistic: Sum comparison: '>=' # threshold_percent is used to calculate the actual threshold # based on the provisioned capacity for the table. threshold_percent: 0.75 period: 300 evaluation_periods: 2 unit: Count description: 'DynamoDB ConsumedWriteCapacityUnits' alarm_actions: [ 'arn:aws:sns:us-east-1:1234:my-alarm' ] insufficient_data_actions: [] ok_actions: [ 'arn:aws:sns:us-east-1:1234:my-alarm' ]
Ensure DynamoDB table exists: boto_dynamodb.present: - name: new_table - read_capacity_units: 1 - write_capacity_units: 2 - hash_key: primary_id - hash_key_data_type: N - range_key: start_timestamp - range_key_data_type: N - alarms: ConsumedWriteCapacityUnits: attributes: threshold_percent: 0.90 period: 900
exception salt.states.boto_dynamodb.GsiNotUpdatableError Raised when a global secondary index cannot be updated.
salt.states.boto_dynamodb.absent(name, region=None, key=None, keyid=None, profile=None) Ensure the DynamoDB table does not exist.
name   Name of the DynamoDB table.
salt.states.boto_dynamodb.present(name=None, table_name=None, region=None, key=None, keyid=None, profile=None, read_capacity_units=None, write_capacity_units=None, alarms=None, alarms_from_pillar='boto_dynamodb_alarms', hash_key=None, hash_key_data_type=None, range_key=None, range_key_data_type=None, local_indexes=None, global_indexes=None, backup_configs_from_pillars='boto_dynamodb_backup_configs') Ensure the DynamoDB table exists. Table throughput can be updated after table creation.
Global secondary indexes (GSIs) are managed with some exceptions:
• If a GSI deletion is detected, a failure will occur (deletes should be done manually in the AWS console).
• If multiple GSIs are added in a single Salt call, a failure will occur (boto supports one creation at a time). Note that this only applies after table creation; multiple GSIs can be created during table creation.
• Updates to existing GSIs are limited to read/write capacity only (DynamoDB limitation).
name   Name of the DynamoDB table
table_name Name of the DynamoDB table (deprecated)
read_capacity_units The read throughput for this table
write_capacity_units The write throughput for this table