Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
aws-cloudfront: topmonks/aws-cloudfront@1.0.0
Use aws-cloudfront
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
distribution_id | The distribution's id. | Yes | - | string |
paths | The space-separated paths to be invalidated. | Yes | - | string |
aws-access-key-id | aws access key id override | No | AWS_ACCESS_KEY_ID | env_var_name |
aws-secret-access-key | aws secret access key override | No | AWS_SECRET_ACCESS_KEY | env_var_name |
aws-region | aws region override | No | AWS_REGION | env_var_name |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: >
Integrate Amazon AWS Cloudfront with your CircleCI CI/CD pipeline easily with the aws-cloudfront orb.
display:
home_url: https://aws.amazon.com/cloudfront/
source_url: https://github.com/topmonks/circleci
orbs:
aws-cli: circleci/aws-cli@1.2.1
commands:
invalidate:
parameters:
distribution_id:
type: string
description: The distribution's id.
paths:
type: string
description: The space-separated paths to be invalidated.
aws-access-key-id:
type: env_var_name
description: aws access key id override
default: AWS_ACCESS_KEY_ID
aws-secret-access-key:
type: env_var_name
description: aws secret access key override
default: AWS_SECRET_ACCESS_KEY
aws-region:
type: env_var_name
description: aws region override
default: AWS_REGION
steps:
- aws-cli/setup:
aws-access-key-id: << parameters.aws-access-key-id >>
aws-secret-access-key: << parameters.aws-secret-access-key >>
aws-region: << parameters.aws-region >>
- run:
name: Invalidate Cloudfront distribution << parameters.distribution_id >>
command: |
aws cloudfront create-invalidation --distribution-id=<< parameters.distribution_id >> --paths=<< parameters.paths >>