forked from earthly/earthly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
40 lines (28 loc) · 912 Bytes
/
Earthfile
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
VERSION 0.8
prep:
FROM hashicorp/terraform:light
COPY aws/ .
RUN terraform init
localstack:
FROM +prep
ARG AWS_ACCESS_KEY_ID=mock-id
ARG AWS_SECRET_ACCESS_KEY=mock-key
ARG AWS_DEFAULT_REGION=us-east-1
WITH DOCKER --pull localstack/localstack:0.11.5
RUN docker run -d -p 4566:4566 -e SERVICES=s3 --name localstack --network="host" localstack/localstack:0.11.5 && \
terraform apply -auto-approve
END
apply:
FROM +prep
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_DEFAULT_REGION=us-east-1
RUN --push terraform apply -auto-approve
SAVE ARTIFACT terraform.tfstate AS LOCAL aws/terraform.tfstate
SAVE ARTIFACT terraform.tfstate.backup AS LOCAL aws/terraform.tfstate.backup
plan:
FROM +prep
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
ARG AWS_DEFAULT_REGION=us-east-1
RUN terraform plan