-
Notifications
You must be signed in to change notification settings - Fork 4
/
terragrunt.hcl
54 lines (49 loc) · 956 Bytes
/
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
50
51
52
53
54
locals {
aws_region = "eu-west-1"
stack_name = replace(path_relative_to_include(), "/", "-")
}
remote_state {
backend = "s3"
generate = {
path = "backend.tf"
if_exists = "overwrite_terragrunt"
}
config = {
encrypt = true
bucket = "terraform-tuto-backend-mp"
key = "${local.stack_name}.tfstate"
region = local.aws_region
}
}
generate "provider" {
path = "versions.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.17"
}
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 3.0"
}
}
}
provider "cloudflare" {}
provider "aws" {
region = "${local.aws_region}"
default_tags {
tags = {
managed-by = "terraform"
stack = "${local.stack_name}"
}
}
}
EOF
}
inputs = {
aws_region = local.aws_region
stack_name = local.stack_name
}