diff options
-rw-r--r-- | terraform/README.md | 3 | ||||
-rw-r--r-- | terraform/conflatorio-docker/backend.tf (renamed from terraform/backend.tf) | 8 | ||||
-rw-r--r-- | terraform/conflatorio-docker/main.tf | 24 | ||||
-rw-r--r-- | terraform/conflatorio-docker/terragrunt.hcl | 3 | ||||
-rw-r--r-- | terraform/terragrunt.hcl | 17 | ||||
-rw-r--r-- | terraform/unifi-controller/backend.tf | 6 | ||||
-rw-r--r-- | terraform/unifi-controller/main.tf | 16 | ||||
-rw-r--r-- | terraform/unifi-controller/terragrunt.hcl | 8 |
8 files changed, 36 insertions, 49 deletions
diff --git a/terraform/README.md b/terraform/README.md index 825cc94..b9a0add 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -1,8 +1,5 @@ # Setup - # Downloads terraform and plugins - make - # Do this in every new terminal source .settings.sh diff --git a/terraform/backend.tf b/terraform/conflatorio-docker/backend.tf index d970fc9..d2de289 100644 --- a/terraform/backend.tf +++ b/terraform/conflatorio-docker/backend.tf @@ -2,11 +2,11 @@ terraform { backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - endpoint = "eu-central-1.linodeobjects.com" - key = "./terraform.tfstate" - region = "eu-central-1" + key = "conflatorio-docker/terraform.tfstate" + skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true - skip_region_validation = true + region = "eu-central-1" + endpoint = "eu-central-1.linodeobjects.com" } } diff --git a/terraform/conflatorio-docker/main.tf b/terraform/conflatorio-docker/main.tf index f4cbb61..8a01be6 100644 --- a/terraform/conflatorio-docker/main.tf +++ b/terraform/conflatorio-docker/main.tf @@ -1,16 +1,6 @@ terraform { required_version = "~> 1.3.5" - backend "s3" { - bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - key = "conflatorio-docker/terraform.tfstate" - region = "eu-central-1" - skip_region_validation = true - skip_credentials_validation = true - skip_metadata_api_check = true - endpoint = "eu-central-1.linodeobjects.com" - } - required_providers { docker = { source = "kreuzwerker/docker" @@ -32,14 +22,6 @@ data "sops_file_entry" "linode_token" { data_key = "linode_token" } -# docker run -d --name ipv6nat --privileged --network host --restart unless-stopped -v /var/run/docker.sock:/var/run/docker.sock:ro robbertkl/ipv6nat - -# resource "docker_network" "bridge6" { -# name = "bridge6" -# ipv6 = true -# -# ipam_options = { -# "com.docker.network.enable_ipv6" = true -# } -# } - +output "foo" { + value = "foo!" +} diff --git a/terraform/conflatorio-docker/terragrunt.hcl b/terraform/conflatorio-docker/terragrunt.hcl new file mode 100644 index 0000000..e147285 --- /dev/null +++ b/terraform/conflatorio-docker/terragrunt.hcl @@ -0,0 +1,3 @@ +include "root" { + path = find_in_parent_folders() +} diff --git a/terraform/terragrunt.hcl b/terraform/terragrunt.hcl index 74d2de9..e7e5f6a 100644 --- a/terraform/terragrunt.hcl +++ b/terraform/terragrunt.hcl @@ -1,16 +1,17 @@ -remote_state { - backend = "s3" - generate = { - path = "backend.tf" - if_exists = "overwrite_terragrunt" - } - config = { +generate "backend" { + path = "backend.tf" + if_exists = "overwrite_terragrunt" + contents = <<EOF +terraform { + backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" key = "${path_relative_to_include()}/terraform.tfstate" - region = "eu-central-1" skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true + region = "eu-central-1" endpoint = "eu-central-1.linodeobjects.com" } } +EOF +} diff --git a/terraform/unifi-controller/backend.tf b/terraform/unifi-controller/backend.tf index af4b54d..5f2d6d0 100644 --- a/terraform/unifi-controller/backend.tf +++ b/terraform/unifi-controller/backend.tf @@ -2,11 +2,11 @@ terraform { backend "s3" { bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - endpoint = "eu-central-1.linodeobjects.com" key = "unifi-controller/terraform.tfstate" - region = "eu-central-1" + skip_region_validation = true skip_credentials_validation = true skip_metadata_api_check = true - skip_region_validation = true + region = "eu-central-1" + endpoint = "eu-central-1.linodeobjects.com" } } diff --git a/terraform/unifi-controller/main.tf b/terraform/unifi-controller/main.tf index 98d559a..e972e38 100644 --- a/terraform/unifi-controller/main.tf +++ b/terraform/unifi-controller/main.tf @@ -1,16 +1,6 @@ terraform { required_version = "~> 1.3.5" - # backend "s3" { - # bucket = "terraform-a6726272-73ff-11ed-8bdd-c79eb8376e05" - # key = "unifi/terraform.tfstate" - # region = "eu-central-1" - # skip_region_validation = true - # skip_credentials_validation = true - # skip_metadata_api_check = true - # endpoint = "eu-central-1.linodeobjects.com" - # } - required_providers { docker = { source = "kreuzwerker/docker" @@ -34,3 +24,9 @@ provider "docker" { locals { domain_name = "unifi.vpn.trygvis.io" } + +variable "foo" {} + +output "bar" { + value = var.foo.value +} diff --git a/terraform/unifi-controller/terragrunt.hcl b/terraform/unifi-controller/terragrunt.hcl index e147285..35c1b74 100644 --- a/terraform/unifi-controller/terragrunt.hcl +++ b/terraform/unifi-controller/terragrunt.hcl @@ -1,3 +1,11 @@ include "root" { path = find_in_parent_folders() } + +dependency "docker" { + config_path = "../conflatorio-docker" +} + +inputs = { + vpc_id = dependency.docker.outputs.foo +} |