mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-22 10:40:39 +00:00
Update DOCS to reflect new way of setting up and configuring the remote/backend
This commit is contained in:
parent
7b13306909
commit
40a5e1af9b
62
DOCS.md
62
DOCS.md
@ -54,19 +54,27 @@ pipeline:
|
|||||||
+ sensitive: true
|
+ sensitive: true
|
||||||
```
|
```
|
||||||
|
|
||||||
Example configuration with state tracked via remote:
|
Example configuration with state tracked via remote. You will need a file
|
||||||
|
that specifies the backend type along with ability to pass options via the `.drone.yml`.
|
||||||
|
|
||||||
|
`backend.tf`
|
||||||
|
```
|
||||||
|
terraform {
|
||||||
|
backend "s3" {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
`.drone.yml`
|
||||||
```diff
|
```diff
|
||||||
pipeline:
|
pipeline:
|
||||||
terraform:
|
terraform:
|
||||||
image: jmccann/drone-terraform:1
|
image: jmccann/drone-terraform:1
|
||||||
plan: false
|
plan: false
|
||||||
+ remote:
|
+ init_options:
|
||||||
+ backend: S3
|
+ backend-config:
|
||||||
+ config:
|
+ - "bucket=my-terraform-config-bucket"
|
||||||
+ bucket: my-terraform-config-bucket
|
+ - "key=tf-states/my-project"
|
||||||
+ key: tf-states/my-project
|
+ - "region=us-east-1"
|
||||||
+ region: us-east-1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You may want to run terraform against internal resources, like an internal
|
You may want to run terraform against internal resources, like an internal
|
||||||
@ -145,12 +153,11 @@ pipeline:
|
|||||||
dev_terraform:
|
dev_terraform:
|
||||||
image: jmccann/drone-terraform:1
|
image: jmccann/drone-terraform:1
|
||||||
plan: false
|
plan: false
|
||||||
remote:
|
init_options:
|
||||||
backend: S3
|
backend_config:
|
||||||
config:
|
- "bucket=my-terraform-config-bucket"
|
||||||
bucket: my-terraform-config-bucket
|
- "key=tf-states/my-project"
|
||||||
key: tf-states/my-project
|
- "region=us-east-1"
|
||||||
region: us-east-1
|
|
||||||
+ secrets:
|
+ secrets:
|
||||||
+ AWS_ACCESS_KEY_ID: DEV_AWS_ACCESS_KEY_ID
|
+ AWS_ACCESS_KEY_ID: DEV_AWS_ACCESS_KEY_ID
|
||||||
+ AWS_SECRET_ACCESS_KEY: DEV_AWS_SECRET_ACCESS_KEY
|
+ AWS_SECRET_ACCESS_KEY: DEV_AWS_SECRET_ACCESS_KEY
|
||||||
@ -158,12 +165,11 @@ pipeline:
|
|||||||
prod_terraform:
|
prod_terraform:
|
||||||
image: jmccann/drone-terraform:1
|
image: jmccann/drone-terraform:1
|
||||||
plan: false
|
plan: false
|
||||||
remote:
|
init_options:
|
||||||
backend: S3
|
backend_config:
|
||||||
config:
|
- "bucket=my-terraform-config-bucket"
|
||||||
bucket: my-terraform-config-bucket
|
- "key=tf-states/my-project"
|
||||||
key: tf-states/my-project
|
- "region=us-east-1"
|
||||||
region: us-east-1
|
|
||||||
+ secrets:
|
+ secrets:
|
||||||
+ AWS_ACCESS_KEY_ID: PROD_AWS_ACCESS_KEY_ID
|
+ AWS_ACCESS_KEY_ID: PROD_AWS_ACCESS_KEY_ID
|
||||||
+ AWS_SECRET_ACCESS_KEY: PROD_AWS_SECRET_ACCESS_KEY
|
+ AWS_SECRET_ACCESS_KEY: PROD_AWS_SECRET_ACCESS_KEY
|
||||||
@ -174,15 +180,19 @@ pipeline:
|
|||||||
plan
|
plan
|
||||||
: if true, calculates a plan but does __NOT__ apply it.
|
: if true, calculates a plan but does __NOT__ apply it.
|
||||||
|
|
||||||
remote
|
init_options
|
||||||
: contains the configuration for the Terraform remote state tracking.
|
: contains the configuration for the Terraform backend.
|
||||||
|
|
||||||
remote.backend
|
init_options.backend-config
|
||||||
: the Terraform remote state backend to use.
|
: This specifies additional configuration to merge for the backend. This can be
|
||||||
|
specified multiple times. Flags specified later in the line override those
|
||||||
|
specified earlier if they conflict.
|
||||||
|
|
||||||
remote.config
|
init_options.lock
|
||||||
: a map of configuration parameters for the remote state backend.
|
: Lock the state file when locking is supported.
|
||||||
Each value is passed as a `-backend-config=<key>=<value>` option.
|
|
||||||
|
init_options.lock-timeout
|
||||||
|
: Duration to retry a state lock.
|
||||||
|
|
||||||
vars
|
vars
|
||||||
: a map of variables to pass to the Terraform `plan` and `apply` commands.
|
: a map of variables to pass to the Terraform `plan` and `apply` commands.
|
||||||
|
Loading…
Reference in New Issue
Block a user