salt.modules.boto_cloudfront

Connection module for Amazon CloudFront

New in version 2018.3.0.

depends:

boto3

configuration:

This module accepts explicit AWS credentials but can also utilize IAM roles assigned to the instance through Instance Profiles or it can read them from the ~/.aws/credentials file or from these environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
    iam-roles-for-amazon-ec2.html

http://boto3.readthedocs.io/en/latest/guide/
    configuration.html#guide-configuration

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

cloudfront.keyid: GKTADJGHEIQSXMKKRBJ08H
cloudfront.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

A region may also be specified in the configuration:

cloudfront.region: us-east-1

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

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

myprofile:
    keyid: GKTADJGHEIQSXMKKRBJ08H
    key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
    region: us-east-1
salt.modules.boto_cloudfront.create_distribution(name, config, tags=None, region=None, key=None, keyid=None, profile=None)

Create a CloudFront distribution with the given name, config, and (optionally) tags.

name

Name for the CloudFront distribution

config

Configuration for the distribution

tags

Tags to associate with the distribution

region

Region to connect to

key

Secret key to use

keyid

Access key to use

profile

A dict with region, key, and keyid, or a pillar key (string) that contains such a dict.

CLI Example:

salt myminion boto_cloudfront.create_distribution name=mydistribution profile=awsprofile             config='{"Comment":"partial configuration","Enabled":true}'
salt.modules.boto_cloudfront.export_distributions(region=None, key=None, keyid=None, profile=None)

Get details of all CloudFront distributions. Produces results that can be used to create an SLS file.

CLI Example:

salt-call boto_cloudfront.export_distributions --out=txt |            sed "s/local: //" > cloudfront_distributions.sls
salt.modules.boto_cloudfront.get_distribution(name, region=None, key=None, keyid=None, profile=None)

Get information about a CloudFront distribution (configuration, tags) with a given name.

name

Name of the CloudFront distribution

region

Region to connect to

key

Secret key to use

keyid

Access key to use

profile

A dict with region, key, and keyid, or a pillar key (string) that contains such a dict.

CLI Example:

salt myminion boto_cloudfront.get_distribution name=mydistribution profile=awsprofile
salt.modules.boto_cloudfront.update_distribution(name, config, tags=None, region=None, key=None, keyid=None, profile=None)

Update the config (and optionally tags) for the CloudFront distribution with the given name.

name

Name of the CloudFront distribution

config

Configuration for the distribution

tags

Tags to associate with the distribution

region

Region to connect to

key

Secret key to use

keyid

Access key to use

profile

A dict with region, key, and keyid, or a pillar key (string) that contains such a dict.

CLI Example:

salt myminion boto_cloudfront.update_distribution name=mydistribution profile=awsprofile             config='{"Comment":"partial configuration","Enabled":true}'