boto3_cloudfront

Connection module for Amazon CloudFront using boto3.

Renamed from boto_cloudfront to boto3_cloudfront and rewritten to use the boto3 cloudfront client APIs directly via saltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

configuration:

This module accepts explicit CloudFront 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

If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them 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

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

Added in version 1.0.0.

saltext.boto3.modules.boto3_cloudfront.__virtual__()[source]

Only load if boto3 is available.

saltext.boto3.modules.boto3_cloudfront.get_distribution(name, region=None, key=None, keyid=None, profile=None)[source]

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

name (str):

The value of the Name tag of the CloudFront distribution.

region (str, optional):

The AWS region where the CloudFront distribution is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt myminion boto3_cloudfront.get_distribution name=mydistribution profile=awsprofile
saltext.boto3.modules.boto3_cloudfront.export_distributions(region=None, key=None, keyid=None, profile=None)[source]

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

region (str, optional):

The AWS region where the CloudFront distributions are located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_cloudfront.export_distributions --out=txt |             sed "s/local: //" > cloudfront_distributions.sls
saltext.boto3.modules.boto3_cloudfront.create_distribution(name, config, tags=None, region=None, key=None, keyid=None, profile=None)[source]

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

name (str):

The value of the Name tag for the CloudFront distribution.

config (dict):

The configuration for the CloudFront distribution.

tags (dict, optional):

The tags to associate with the CloudFront distribution.

region (str, optional):

The AWS region where the CloudFront distribution is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt myminion boto3_cloudfront.create_distribution name=mydistribution profile=awsprofile             config='{"Comment":"partial configuration","Enabled":true}'
saltext.boto3.modules.boto3_cloudfront.update_distribution(name, config, tags=None, region=None, key=None, keyid=None, profile=None)[source]

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

name (str):

The value of the Name tag for the CloudFront distribution.

config (dict):

The configuration for the CloudFront distribution.

tags (dict, optional):

The tags to associate with the CloudFront distribution.

region (str, optional):

The AWS region where the CloudFront distribution is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

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