-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 726 Bytes
/
Makefile
File metadata and controls
30 lines (24 loc) · 726 Bytes
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
include .env
## Credenciais
ACCESS_KEY=${ACCESS_KEY_ID}
SECRET_ACCESS=${SECRET_ACCESS_KEY}
## Image docker
TERRAFORM_VERSION=1.3.0-alpha20220622
DOCKER_IMAGE=hashicorp/terraform:${TERRAFORM_VERSION}
## Root module
PWD=$$PWD
## Workspace
WORKSPACE=${SET_WORKSPACE}
## Initial
terraform: terraform-workspace
docker run --rm -v ${PWD}:/app -w /app \
-e AWS_ACCESS_KEY_ID=${ACCESS_KEY} \
-e AWS_SECRET_ACCESS_KEY=${SECRET_ACCESS} \
-it --entrypoint "" ${DOCKER_IMAGE} sh
## Set workspace
terraform-workspace:
docker run --rm -v ${PWD}:/app -w /app \
-e AWS_ACCESS_KEY_ID=${ACCESS_KEY} \
-e AWS_SECRET_ACCESS_KEY=${SECRET_ACCESS} \
-d ${DOCKER_IMAGE} workspace select ${WORKSPACE} \
Selected worksplace ${WORKSPACE}