boto3_cloudfront

Manage CloudFront distributions using boto3.

Renamed from boto_cloudfront to boto3_cloudfront and updated to call the refactored boto3_cloudfront execution module.

Create, update and destroy CloudFront distributions.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

This module uses boto3, which can be installed via package, or pip.

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

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
Manage my_distribution CloudFront distribution:
    boto3_cloudfront.present:
      - name: my_distribution
      - config:
          Comment: 'partial config shown, most parameters elided'
          Enabled: True
      - tags:
          testing_key: testing_value

Added in version 1.0.0.

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

Only load if the boto3_cloudfront execution module is available.

saltext.boto3.states.boto3_cloudfront.present(name, config, tags, region=None, key=None, keyid=None, profile=None)[source]

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.

Example:

Manage my_distribution CloudFront distribution:
    boto3_cloudfront.present:
      - name: my_distribution
      - config:
          Comment: 'partial config shown, most parameters elided'
          Enabled: True
      - tags:
          testing_key: testing_value