Module Expr Str FunctionDef arguments args defaults body Expr Str If CompareIn Str NameLoad body Return Str orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict If BoolOpAnd NameLoad NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Assign NameStore ListLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Str Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad orelse If UnaryOpNot NameLoad body If SubscriptLoad NameLoad Index Str body Assign NameStore Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If UnaryOpNot NameLoad body If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad Assign SubscriptStore NameLoad Index Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad If NameLoad body If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Assign NameStore Dict Str Str Str Str NameLoad NameLoad Str Dict Assign NameStore Call SubscriptLoad NameLoad Index Str keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list
N/A N/A 
Manage Elasticache
==================

.. versionadded:: 2014.7.0

Create, destroy and update Elasticache clusters. Be aware that this interacts
with Amazon's services, and so may incur charges.

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 uses ``boto``, which can be installed via package, or pip.

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
<http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html>`_.

If IAM roles are not used you need to specify them either in a pillar file or
in the minion's config file:

.. code-block:: yaml

    elasticache.keyid: GKTADJGHEIQSXMKKRBJ08H
    elasticache.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

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

.. code-block:: yaml

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

.. code-block:: yaml

    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
 __virtual__ N/A N/A N/A N/A N/A 
    Only load if boto is available.
     N/A N/A boto_elasticache.exists __salt__ N/A N/A boto_elasticache N/A N/A False N/A present N/A N/A name engine cache_node_type num_cache_nodes preferred_availability_zone port cache_parameter_group_name cache_security_group_names replication_group_id auto_minor_version_upgrade security_group_ids cache_subnet_group_name engine_version notification_topic_arn preferred_maintenance_window wait region key keyid profile N/A None None None None None None None None True None None None None None None None None None None N/A N/A 
    Ensure the cache cluster exists.

    name
        Name of the cache cluster (cache cluster id).

    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: http://boto.readthedocs.org/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.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string)
        that contains a dict with region, key and keyid.
     N/A ret N/A name result comment changes name True N/A N/A N/A cache_security_group_names cache_subnet_group_name N/A N/A _subnet_group N/A N/A __salt__ N/A boto_elasticache.get_cache_subnet_group cache_subnet_group_name region key keyid profile N/A vpc_id N/A _subnet_group N/A vpc_id N/A N/A security_group_ids N/A N/A security_group_ids N/A N/A _security_group_ids N/A N/A __salt__ N/A boto_secgroup.convert_to_group_ids cache_security_group_names vpc_id region key keyid profile N/A N/A N/A security_group_ids extend _security_group_ids N/A cache_security_group_names None N/A config N/A N/A __salt__ N/A boto_elasticache.get_config name region key keyid profile N/A N/A config None N/A N/A msg Failed to retrieve cache cluster info from AWS. N/A N/A ret N/A comment msg N/A N/A ret N/A result None N/A ret N/A N/A N/A config N/A N/A N/A __opts__ N/A test N/A N/A msg N/A N/A Cache cluster {0} is set to be created. format name N/A N/A ret N/A comment msg N/A N/A ret N/A result None N/A ret N/A created N/A N/A __salt__ N/A boto_elasticache.create name name num_cache_nodes num_cache_nodes cache_node_type cache_node_type engine engine replication_group_id replication_group_id engine_version engine_version cache_parameter_group_name cache_parameter_group_name cache_subnet_group_name cache_subnet_group_name cache_security_group_names cache_security_group_names security_group_ids security_group_ids preferred_availability_zone preferred_availability_zone preferred_maintenance_window preferred_maintenance_window port port notification_topic_arn notification_topic_arn auto_minor_version_upgrade auto_minor_version_upgrade wait wait region region key key keyid keyid profile profile N/A created N/A N/A N/A N/A ret N/A changes N/A old None N/A config N/A N/A __salt__ N/A boto_elasticache.get_config name region key keyid profile N/A N/A N/A ret N/A changes N/A new config N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Failed to create {0} cache cluster. format name N/A ret N/A N/A N/A ret N/A comment N/A N/A Cache cluster {0} is present. format name N/A ret N/A subnet_group_present N/A N/A name subnet_ids description tags region key keyid profile N/A None None None None None N/A N/A 
    Ensure ElastiCache subnet group exists.

    .. versionadded:: 2015.8.0

    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.

    description
        Subnet group description.

    tags
        A list of tags.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.
     N/A ret N/A name result comment changes name True N/A N/A exists N/A N/A __salt__ N/A boto_elasticache.subnet_group_exists name name tags tags region region key key keyid keyid profile profile N/A N/A exists N/A N/A N/A __opts__ N/A test N/A N/A N/A ret N/A comment N/A N/A Subnet group {0} is set to be created. format name N/A N/A ret N/A result None N/A ret N/A created N/A N/A __salt__ N/A boto_elasticache.create_subnet_group name name subnet_ids subnet_ids description description tags tags region region key key keyid keyid profile profile N/A N/A created N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Failed to create {0} subnet group. format name N/A ret N/A N/A N/A ret N/A changes N/A old None N/A N/A N/A ret N/A changes N/A new name N/A N/A ret N/A comment N/A N/A Subnet group {0} created. format name N/A ret N/A N/A ret N/A comment Subnet group present. N/A ret N/A absent N/A N/A name wait region key keyid profile N/A True None None None None N/A N/A 
    Ensure the named elasticache cluster is deleted.

    name
        Name of the cache cluster.

    wait
        Boolean. Wait for confirmation from boto that the cluster is in the
        deleting state.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string)
        that contains a dict with region, key and keyid.
     N/A ret N/A name result comment changes name True N/A N/A is_present N/A N/A __salt__ N/A boto_elasticache.exists name region key keyid profile N/A is_present N/A N/A N/A __opts__ N/A test N/A N/A N/A ret N/A comment N/A N/A Cache cluster {0} is set to be removed. format name N/A N/A ret N/A result None N/A ret N/A deleted N/A N/A __salt__ N/A boto_elasticache.delete name wait region key keyid profile N/A deleted N/A N/A N/A N/A ret N/A changes N/A old name N/A N/A N/A ret N/A changes N/A new None N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Failed to delete {0} cache cluster. format name N/A N/A N/A ret N/A comment N/A N/A {0} does not exist in {1}. format name region N/A ret N/A creategroup N/A N/A name primary_cluster_id replication_group_description wait region key keyid profile N/A None None None None None N/A N/A 
    Ensure the a replication group is create.

    name
        Name of replication group

    wait
        Waits for the group to be available

    primary_cluster_id
        Name of the master cache node

    replication_group_description
        Description for the group

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string)
        that contains a dict with region, key and keyid.
     N/A ret N/A name result comment changes name None N/A N/A is_present N/A N/A __salt__ N/A boto_elasticache.group_exists name region key keyid profile N/A N/A is_present N/A N/A N/A __opts__ N/A test N/A N/A N/A ret N/A comment N/A N/A Replication {0} is set to be created. format name N/A N/A ret N/A result None N/A created N/A N/A __salt__ N/A boto_elasticache.create_replication_group name primary_cluster_id replication_group_description wait region key keyid profile N/A created N/A N/A config N/A N/A __salt__ N/A boto_elasticache.describe_replication_group name region key keyid profile N/A N/A N/A ret N/A changes N/A old None N/A N/A N/A ret N/A changes N/A new config N/A N/A ret N/A result True N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Failed to create {0} replication group. format name N/A N/A N/A ret N/A comment N/A N/A {0} replication group exists . format name N/A N/A ret N/A result True N/A ret N/A subnet_group_absent N/A N/A name tags region key keyid profile N/A None None None None None N/A N/A ret N/A name result comment changes name True N/A N/A exists N/A N/A __salt__ N/A boto_elasticache.subnet_group_exists name name tags tags region region key key keyid keyid profile profile N/A N/A exists N/A N/A N/A ret N/A result True N/A N/A ret N/A comment N/A N/A {0} ElastiCache subnet group does not exist. format name N/A ret N/A N/A __opts__ N/A test N/A N/A N/A ret N/A comment N/A N/A ElastiCache subnet group {0} is set to be removed. format name N/A N/A ret N/A result None N/A ret N/A deleted N/A N/A __salt__ N/A boto_elasticache.delete_subnet_group name region key keyid profile N/A N/A deleted N/A N/A N/A ret N/A result False N/A N/A ret N/A comment N/A N/A Failed to delete {0} ElastiCache subnet group. format name N/A ret N/A N/A N/A ret N/A changes N/A old name N/A N/A N/A ret N/A changes N/A new None N/A N/A ret N/A comment N/A N/A ElastiCache subnet group {0} deleted. format name N/A ret N/A