You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: terraform/infrastructure/README.md
+35-15Lines changed: 35 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,48 +53,68 @@ $ make build-artifacts
53
53
54
54
### Init your local workspace
55
55
56
-
On the first deployment, you will need to initialise and select your workspace. To do this, run:
56
+
On the first deployment, you will need to initialise and create your workspace. To create a new ephemeral dev workspace, run:
57
57
58
58
```shell
59
59
$ make init
60
60
```
61
61
62
-
If your Terraform provider config changes, you may need to run `make init` again.
62
+
If you want to use an existing workspace, or if you want to use the workspace of a persistent environment, do the following:
63
+
64
+
```shell
65
+
$ make ENV={ENV_NAME} TF_WORKSPACE_NAME={WORKSPACE_NAME} init
66
+
```
67
+
68
+
replacing `{ENV_NAME}` with the environment name (e.g. `dev`, `qa`, `qa-sandbox` etc) and `{WORKSPACE_NAME}` with the name of the workspace you want to use.
69
+
70
+
So, for example, if you want to use the `qa` environment, you'd do you the following:
71
+
72
+
```shell
73
+
$ make ENV=qa TF_WORKSPACE_NAME=qa init
74
+
```
75
+
76
+
If your Terraform provider config changes, you may need to reinitialise your workspace.
63
77
64
78
### Create a Terraform plan
65
79
66
-
To create a Terraform plan:
80
+
To create a Terraform plan for a dev workspace:
67
81
68
82
```shell
69
83
$ make plan
70
84
```
71
85
72
-
### Apply the changes with Terraform
73
-
74
-
To apply your changes:
86
+
To create a Terraform plan for a workspace in another environment:
75
87
76
88
```shell
77
-
$ make apply
89
+
$ make ENV={ENV_NAME} plan
78
90
```
79
91
80
-
## Tear down infrastructure
92
+
replacing `{ENV_NAME}` with the environment name (e.g. `dev`, `qa`, `qa-sandbox` etc).
81
93
82
-
To tear down the infrastructure, you need to use Terraform to destroy the resources in your Terraform workspace.
94
+
### Apply the changes with Terraform
83
95
84
-
To do this, follow these steps:
96
+
To apply your changes to a dev workspace:
85
97
86
-
### Init your local workspace
98
+
```shell
99
+
$ make apply
100
+
```
87
101
88
-
On the first deployment, you will need to initialise and select your workspace. To do this, run:
102
+
To apply your changes to a workspace in another environment:
89
103
90
104
```shell
91
-
$ make init
105
+
$ make ENV={ENV_NAME} apply
92
106
```
93
107
94
-
### Teardown infrastructure
108
+
replacing `{ENV_NAME}` with the environment name (e.g. `dev`, `qa`, `qa-sandbox` etc).
109
+
110
+
## Tear down infrastructure
111
+
112
+
To tear down the infrastructure, you need to use Terraform to destroy the resources in your Terraform workspace.
95
113
96
114
To teardown the infrastructure, do the following:
97
115
98
116
```
99
-
$ make destroy
117
+
$ make ENV={ENV_NAME} TF_WORKSPACE_NAME={WORKSPACE_NAME} init destroy
100
118
```
119
+
120
+
replacing `{ENV_NAME}` with the environment name (e.g. `dev`, `qa`, `qa-sandbox` etc) and `{WORKSPACE_NAME}` with the name of the workspace you want to destroy.
0 commit comments