forked from ViktorUJ/cks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterragrunt.hcl
49 lines (45 loc) · 1.07 KB
/
terragrunt.hcl
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
locals {
region = "eu-north-1"
backend_region = "eu-north-1"
backend_bucket = "sre-learning-platform-state-backet"
backend_dynamodb_table = "${local.backend_bucket}-lock"
}
generate "backend" {
path = "backend.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
backend "s3" {}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.17.0"
}
}
}
variable "s3_k8s_config" {
default="${local.backend_bucket}"
}
variable "backend_dynamodb_table" {
default="${local.backend_dynamodb_table}"
}
variable "region_cmdb" {
default="${local.backend_region}"
}
EOF
}
remote_state {
backend = "s3"
config = {
bucket = local.backend_bucket
key = "terragrunt${path_relative_to_include()}/terraform.tfstate"
region = local.backend_region
encrypt = true
dynamodb_table = local.backend_dynamodb_table
}
}
inputs = {
region = local.backend_region
backend_bucket=local.backend_bucket
backend_dynamodb_table=local.backend_dynamodb_table
}