-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-providers.tf
68 lines (51 loc) · 1.88 KB
/
01-providers.tf
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
terraform {
/*#
The "backend" block in the "01-providers.tf" must remain commented until the bucket and the DynamoDB table are created.
After all your resources will be created, you will need to replace empty values
for "region" and "bucket" in the "backend" block of the "00-providers.tf" since variables are not allowed in this block.
For "region" you need to specify the region where the S3 bucket and DynamoDB table are located.
You need to use the same value that you have in the "00-variables.tf" for the "region" variable.
For "bucket" you will get its values in the output after the first run of "terraform apply -auto-approve".
After your values are set, you can then uncomment the "backend" block and run again "terraform init" and then "terraform apply -auto-approve".
In this way, the "terraform.tfstate" file will be stored in an S3 bucket and DynamoDB will be used for state locking and consistency checking.
*/
/*#
backend "s3" {
region = ""
bucket = ""
key = "state/terraform.tfstate"
kms_key_id = "alias/terraform-bucket-key-gitlab-1"
dynamodb_table = "dynamodb-terraform-state-lock-gitlab-1"
encrypt = true
}
*/
# Terraform version (replace with yours)
required_version = "1.9.2"
# Terraform providers
required_providers {
aws = {
source = "hashicorp/aws"
# Provider versions (replace with yours)
version = "~> 5.64.0"
}
tls = {
source = "hashicorp/tls"
# Provider versions (replace with yours)
version = "~> 4.0.4"
}
local = {
source = "hashicorp/local"
# Provider versions (replace with yours)
version = "~> 2.5.1"
}
random = {
source = "hashicorp/random"
# Provider versions (replace with yours)
version = "~> 3.6.0"
}
}
}
# Providers region (replace with yours)
provider "aws" {
region = var.region
}