this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(infra): move legacy module to Terragrunt

+159 -55
+4 -1
Makefile
··· 47 47 cd test/e2e && go test 48 48 49 49 fmt: 50 - yamlfmt --exclude cluster/roles/secrets/vars/main.yml . 50 + yamlfmt \ 51 + --exclude cluster/roles/secrets/vars/main.yml \ 52 + --exclude infra/*/secrets.yaml \ 53 + . 51 54 terragrunt hcl format 52 55 tofu fmt -recursive 53 56 cd controller && go fmt ./...
+5 -5
infra/main.tf infra/modules/legacy/main.tf
··· 1 1 module "base" { 2 - source = "./modules/base" 3 - tenancy_id = var.oracle_cloud.tenancy_ocid 2 + source = "../base" 3 + tenancy_id = var.tenancy_ocid 4 4 compartment_name = var.compartment_name 5 5 compartment_description = var.compartment_description 6 6 } 7 7 8 8 module "network" { 9 - source = "./modules/network" 9 + source = "../network" 10 10 compartment_id = module.base.compartment_id 11 11 } 12 12 ··· 21 21 } 22 22 23 23 module "instance" { 24 - source = "./modules/instance" 24 + source = "../instance" 25 25 compartment_id = module.base.compartment_id 26 26 display_name = "cloudlab" 27 27 subnet_id = module.network.subnet_id ··· 36 36 } 37 37 38 38 resource "local_file" "inventory" { 39 - filename = "${path.root}/../cluster/inventory.yml" 39 + filename = "${path.root}/inventory.yml" 40 40 file_permission = "0644" 41 41 content = yamlencode({ 42 42 k3s = {
+16
infra/modules/legacy/variables.tf
··· 1 + variable "tenancy_ocid" { 2 + description = "The ID of the tenancy (same with the root compartment ID)" 3 + type = string 4 + } 5 + 6 + variable "compartment_name" { 7 + description = "Name of the compartment where to create all resources" 8 + type = string 9 + default = "cloudlab" 10 + } 11 + 12 + variable "compartment_description" { 13 + description = "Description of the compartment where to create all resources" 14 + type = string 15 + default = "Cloudlab Project" 16 + }
+10
infra/modules/legacy/versions.tf
··· 1 + terraform { 2 + required_version = "~> 1.5" 3 + 4 + required_providers { 5 + oci = { 6 + source = "hashicorp/oci" 7 + version = "~> 6.0" 8 + } 9 + } 10 + }
infra/outputs.tf infra/modules/legacy/outputs.tf
infra/production/oracle/ap-sydney-1/terragrunt.stack.hcl

This is a binary file and will not be displayed.

+76
infra/production/oracle/legacy/.terraform.lock.hcl
··· 1 + # This file is maintained automatically by "tofu init". 2 + # Manual edits may be lost in future updates. 3 + 4 + provider "registry.opentofu.org/hashicorp/http" { 5 + version = "3.5.0" 6 + hashes = [ 7 + "h1:eClUBisXme48lqiUl3U2+H2a2mzDawS9biqfkd9synw=", 8 + "zh:0a2b33494eec6a91a183629cf217e073be063624c5d3f70870456ddb478308e9", 9 + "zh:180f40124fa01b98b3d2f79128646b151818e09d6a1a9ca08e0b032a0b1e9cb1", 10 + "zh:3e29e1de149dc10bf78620526c7cb8c62cd76087f5630dfaba0e93cda1f3aa7b", 11 + "zh:4420950200cf86042ec940d0e2c9b7c89966bf556bf8038ba36217eae663bca5", 12 + "zh:5d1f7d02109b2e2dca7ec626e5563ee765583792d0fd64081286f16f9433bd0d", 13 + "zh:8500b138d338b1994c4206aa577b5c44e1d7260825babcf43245a7075bfa52a5", 14 + "zh:b42165a6c4cfb22825938272d12b676e4a6946ac4e750f85df870c947685df2d", 15 + "zh:b919bf3ee8e3b01051a0da3433b443a925e272893d3724ee8fc0f666ec7012c9", 16 + "zh:d13b81ea6755cae785b3e11634936cdff2dc1ec009dc9610d8e3c7eb32f42e69", 17 + "zh:f1c9d2eb1a6b618ae77ad86649679241bd8d6aacec06d0a68d86f748687f4eb3", 18 + ] 19 + } 20 + 21 + provider "registry.opentofu.org/hashicorp/local" { 22 + version = "2.5.3" 23 + hashes = [ 24 + "h1:31Clmfoe7hzkcdgwuhUuGuPGfeG2Ksk+YWcJgzBTN7M=", 25 + "zh:32e1d4b0595cea6cda4ca256195c162772ddff25594ab4008731a2ec7be230bf", 26 + "zh:48c390af0c87df994ec9796f04ec2582bcac581fb81ed6bb58e0671da1c17991", 27 + "zh:4be7289c969218a57b40902e2f359914f8d35a7f97b439140cb711aa21e494bd", 28 + "zh:4cf958e631e99ed6c8b522c9b22e1f1b568c0bdadb01dd002ca7dffb1c927764", 29 + "zh:7a0132c0faca4c4c96aa70808effd6817e28712bf5a39881666ac377b4250acf", 30 + "zh:7d60de08fac427fb045e4590d1b921b6778498eee9eb16f78c64d4c577bde096", 31 + "zh:91003bee5981e99ec3925ce2f452a5f743827f9d0e131a86613549c1464796f0", 32 + "zh:9fe2fe75977c8149e2515fb30c6cc6cfd57b225d4ce592c570d81a3831d7ffa3", 33 + "zh:e210e6be54933ce93e03d0994e520ba289aa01b2c1f70e77afb8f2ee796b0fe3", 34 + "zh:e8793e5f9422f2b31a804e51806595f335b827c9a38db18766960464566f21d5", 35 + ] 36 + } 37 + 38 + provider "registry.opentofu.org/hashicorp/oci" { 39 + version = "6.37.0" 40 + constraints = "~> 6.0" 41 + hashes = [ 42 + "h1:S3gkcr6ZMGmrU0SQencNQ+j2L2DkOgi+InVKAVOWZWI=", 43 + "zh:2b1ba7863e162f3f2e5929c6a43db6b0d44bb24032bf7d1b4fe27c36e39d512f", 44 + "zh:2d2ccd7eaab45c0b35a52b7dd6e315a38a9e32d72827003194786dbae8004240", 45 + "zh:3e3017f035fac18114e0b1d29c72430958054def0f800c22d36e1144d0c76422", 46 + "zh:504eb43e31cead3c4ff9b3649b51b62e59f91cb94f622e7df110f31bb95daf20", 47 + "zh:86e2ad61fa0c56a7e17b28ac79558ffd462cd086dd2f62b79988596792aa45c8", 48 + "zh:92436cd5326a587e8fa927bee2d42800ff9ef93a782ccbea5c6ebd11e06cf786", 49 + "zh:94aa72b19bbf5ccc4778c9154d615444184d63e782ded54741e18969ab00cb61", 50 + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", 51 + "zh:b8d7e2d181acda6b8836071610fd292cc5c8ef659cfb92aac33bd6bfda71c24f", 52 + "zh:ccb95a6b390f4b161532e9b14708a6cb989ca2fc51f1ae00eae9db4dd7ca70d4", 53 + "zh:d385763af4eda8aa6bf906773b461efce4cab82670826d990fdd5e05fb8a2afa", 54 + "zh:df0cd594595c16b33b1215543853f5e3671d16e665090b3f48f19ff288029dd4", 55 + "zh:e5266e51a70ae31af36a3b58707f77c4189c956ec6f982fcce8aafcec36de3d7", 56 + "zh:e5da4389063cddf4e7424ce0df1c218c1508672b45470d66adc81c52d5ccf46d", 57 + "zh:e608694f226bb18cd93128b8dac910127cdf457f7baf37e472d0d18b531e9f84", 58 + ] 59 + } 60 + 61 + provider "registry.opentofu.org/hashicorp/tls" { 62 + version = "4.1.0" 63 + hashes = [ 64 + "h1:yNZuPWUgw6Ik2huf9lhsuCGONWo2rsY1MfeceT0BQpw=", 65 + "zh:187a99f0d236fd92da224e2f026c4ca8f1dcbf2b5cddc8e6896801bacfab0d73", 66 + "zh:61a32a01cc46f382014dcf7aff5bcac61fe97bd69d3ccb51c801e9437ecdb9ce", 67 + "zh:683ba18baa2cc336ff83f061b5e4569e2cd7c4a097b53a2d80bb0a26be2fc59a", 68 + "zh:85c7640ea13dcf5ae5f7f3abbf2f21e4b93ce7f333ffee5b4a6acd6b5fe71223", 69 + "zh:882f2c5214fd6d280a500acfd560925a71030ef70e10d11fa2b94815b58ae9b6", 70 + "zh:97cb5e0b81b8687870a6b8a16e9a9cfe546e2fdb7534bdd8302eda0d66393f78", 71 + "zh:c0a0110b15ce45140036fe5bf5a44cb822c2f55b30ff2770faf37d7c3cae3b5e", 72 + "zh:d98c1c63fd0c76704fd7be38c316c305a2c95f3215330f2fb1e6b0b7081bf8e9", 73 + "zh:e703a7adf220ac436f8ebfd06529de865b965fcfc461c7ef7b71afa0de04c8e9", 74 + "zh:e93e241150cd438a0708679cb4aa7976742fde02f4c1725cfdefc405c4eeca1a", 75 + ] 76 + }
+12
infra/production/oracle/legacy/terragrunt.hcl
··· 1 + include "root" { 2 + path = find_in_parent_folders("root.hcl") 3 + expose = true 4 + } 5 + 6 + terraform { 7 + source = "../../../modules//legacy" 8 + } 9 + 10 + inputs = { 11 + tenancy_ocid = include.root.locals.secrets.oracle_tenancy_ocid 12 + }
+36
infra/production/oracle/root.hcl
··· 1 + locals { 2 + secrets = yamldecode(sops_decrypt_file(find_in_parent_folders("secrets.yaml"))) 3 + } 4 + 5 + generate "backend" { 6 + path = "backend.tf" 7 + if_exists = "overwrite_terragrunt" 8 + contents = <<EOF 9 + terraform { 10 + backend "remote" { 11 + hostname = "app.terraform.io" 12 + organization = "khuedoan" 13 + 14 + workspaces { 15 + name = "cloudlab" 16 + } 17 + } 18 + } 19 + EOF 20 + } 21 + 22 + generate "provider" { 23 + path = "provider.tf" 24 + if_exists = "overwrite_terragrunt" 25 + contents = <<EOF 26 + provider "oci" { 27 + tenancy_ocid = "${local.secrets.oracle_tenancy_ocid}" 28 + user_ocid = "${local.secrets.oracle_user_ocid}" 29 + fingerprint = "${local.secrets.oracle_fingerprint}" 30 + private_key = <<EOT 31 + ${local.secrets.oracle_private_key} 32 + EOT 33 + region = "${local.secrets.oracle_region}" 34 + } 35 + EOF 36 + }
-22
infra/variables.tf
··· 1 - variable "oracle_cloud" { 2 - description = "Oracle Cloud configuration" 3 - type = object({ 4 - tenancy_ocid = string 5 - user_ocid = string 6 - fingerprint = string 7 - private_key = string 8 - region = string 9 - }) 10 - } 11 - 12 - variable "compartment_name" { 13 - description = "Name of the compartment where to create all resources" 14 - type = string 15 - default = "cloudlab" 16 - } 17 - 18 - variable "compartment_description" { 19 - description = "Description of the compartment where to create all resources" 20 - type = string 21 - default = "Cloudlab Project" 22 - }
-27
infra/versions.tf
··· 1 - terraform { 2 - required_version = "~> 1.5" 3 - 4 - backend "remote" { 5 - hostname = "app.terraform.io" 6 - organization = "khuedoan" 7 - 8 - workspaces { 9 - name = "cloudlab" 10 - } 11 - } 12 - 13 - required_providers { 14 - oci = { 15 - source = "hashicorp/oci" 16 - version = "~> 6.0" 17 - } 18 - } 19 - } 20 - 21 - provider "oci" { 22 - tenancy_ocid = var.oracle_cloud.tenancy_ocid 23 - user_ocid = var.oracle_cloud.user_ocid 24 - fingerprint = var.oracle_cloud.fingerprint 25 - private_key = var.oracle_cloud.private_key 26 - region = var.oracle_cloud.region 27 - }