{"id":50580918,"url":"https://github.com/terraform-ncloud-modules/terraform-ncloud-vpc","last_synced_at":"2026-06-05T02:02:23.447Z","repository":{"id":348532374,"uuid":"526546675","full_name":"terraform-ncloud-modules/terraform-ncloud-vpc","owner":"terraform-ncloud-modules","description":"Terraform module which creates VPC resources on Naver Cloud Platform","archived":false,"fork":false,"pushed_at":"2022-12-13T08:32:30.000Z","size":31,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-01T16:09:29.073Z","etag":null,"topics":["navercloudplatform","ncloud-vpc","ncp","terraform-module","vpc"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/terraform-ncloud-modules/vpc/ncloud","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-ncloud-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-19T09:38:03.000Z","updated_at":"2022-08-22T12:55:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/terraform-ncloud-modules/terraform-ncloud-vpc","commit_stats":null,"previous_names":["terraform-ncloud-modules/terraform-ncloud-vpc"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/terraform-ncloud-modules/terraform-ncloud-vpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ncloud-modules%2Fterraform-ncloud-vpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ncloud-modules%2Fterraform-ncloud-vpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ncloud-modules%2Fterraform-ncloud-vpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ncloud-modules%2Fterraform-ncloud-vpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-ncloud-modules","download_url":"https://codeload.github.com/terraform-ncloud-modules/terraform-ncloud-vpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ncloud-modules%2Fterraform-ncloud-vpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33927313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["navercloudplatform","ncloud-vpc","ncp","terraform-module","vpc"],"created_at":"2026-06-05T02:02:22.795Z","updated_at":"2026-06-05T02:02:23.440Z","avatar_url":"https://github.com/terraform-ncloud-modules.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ncloud VPC Terraform module\n\n## **This version of the module requires Terraform version 1.3.0 or later.**\n\nThis document describes the Terraform module that creates multiple Ncloud VPCs.\n\n## Variable Declaration\n\n### Structure : `variable.tf`\n\nYou need to create `variable.tf` and copy \u0026 paste the variable declaration below.\n\n**You can change the variable name to whatever you want.**\n\n``` hcl\nvariable \"vpcs\" {\n  type = list(object({\n    name            = string\n    ipv4_cidr_block = string                          // cidr block\n\n    subnets = optional(list(object({\n      name        = string\n      usage_type  = optional(string, \"GEN\")           // GEN (default) | LOADB\n      subnet_type = string                            // PUBLIC | PRIVATE, If usage_type is LOADB in the KR region, only PRIVATE is allowed. \n      zone        = string                            // (PUB) KR-1 | KR-2 // (FIN) FKR-1 | FKR-2 // (GOV) KR | KRS\n      subnet      = string                            // cidr block\n      network_acl = optional(string, \"default\")       // default (default) | NetworkAclName, If set \"default\", then \"default Network ACL\" will be set. \n    })), [])\n\n    network_acls = optional(list(object({\n      name           = string                         // if set \"default\", then \"default Network ACL rule\" will be created\n      description    = optional(string, \"\")           // if name is \"default\", then description is ignored\n\n      // The order of writing inbound_rules \u0026 outbound_rules is as follows.\n      // [\n      //   priority(number),                                      // 1-199\n      //   protocol(string),                                      // TCP | UDP | ICMP\n      //   cidr_block(string) | deny_allow_group_name(string),      \n      //   port_number(number) | port_range(string),              // need to enter \"\" if protocol is ICMP\n      //   rule_action(string),                                   // ALLOW | DROP\n      //   description(string)\n      // ]\n      inbound_rules  = optional(list(list(any)), [])\n      outbound_rules = optional(list(list(any)), [])\n    })), [])\n\n    deny_allow_groups = optional(list(object({\n      name        = string\n      description = optional(string, \"\")\n      ip_list     = optional(list(string), [])        // IP address (not CIDR)\n    })), [])\n\n    access_control_groups = optional(list(object({\n      name           = string                         // if set \"default\", then \"default ACG rule\" will be created\n      description    = optional(string, \"\")           // if name is \"default\", then description is ignored\n\n      // The order of writing inbound_rules \u0026 outbound_rules is as follows.\n      // [\n      //   protocol(string),                                      // TCP | UDP | ICMP\n      //   cidr_block(string) | access_control_group_name(string),      \n      //   port_number(number) | port_range(string),              // need to enter \"\" if protocol is ICMP\n      //   description(string)\n      // ]\n      inbound_rules  = optional(list(list(any)), [])\n      outbound_rules = optional(list(list(any)), [])\n    })), [])\n\n    public_route_tables = optional(list(object({\n      name         = string                           \n      description  = optional(string, \"\")             \n      subnet_names = optional(list(string), [])    // All subnets not specified in the separately created route table are automatically associated to the \"default route table\".\n    })), [])\n\n    private_route_tables = optional(list(object({\n      name         = string                           \n      description  = optional(string, \"\")             \n      subnet_names = optional(list(string), [])    // All subnets not specified in the separately created route table are automatically associated to the \"default route table\".\n    })), [])\n\n    nat_gateways = optional(list(object({\n      name        = string\n      zone        = string                            // KR-1 | KR-2\n      route_table = optional(string, \"default\")       // default (default) | RouteTableName, If set \"default\", then \"default Route Table for private Subnet\" will be set.\n    })), [])\n  }))\n  default = []\n}\n\n```\n\n### Example : `terraform.tfvars`\n\nYou can create a `terraform.tfvars` and refer to the sample below to write the variable specification you want.\nFile name can be `terraform.tfvars` or anything ending in `.auto.tfvars`\n\n**It must exactly match the variable name above.**\n\nFirst element creates :\n\n- 1 `VPC` named \"foo\"\n- 2 `Subnets` each for Public \u0026 Private \u0026 Load Balancer\n- 1 `Network ACL` for Load Balnacer Subnets\n- 1 `Deny-Allow Group` for Load Balancer Network ACL\n- 1 `Access Control Group` each for Public \u0026 Private Subnets\n- 1 `NAT Gateways` each for KR-1 \u0026 KR-2 zone\n- 1 `Route Tables` each for KR-1 \u0026 KR-2 zone \n\nSecond element creates :\n\n- 1 `VPC` named \"bar\"\n- 1 `Subnets` each for Public \u0026 Private\n- 1 `Access Control Group` each for Public \u0026 Private Subnets\n- 1 `NAT Gateways` for KR-1 zone\n- 1 `Route Tables` for KR-1 zone\n- `Default Network ACL` \u0026 `Default Access Control Group` declarations  omitted.\n\n``` hcl\nvpcs = [\n\n  {\n    name            = \"vpc-foo\"\n    ipv4_cidr_block = \"10.0.0.0/16\"\n\n    subnets = [\n      {\n        name        = \"sbn-foo-public-1\"\n        usage_type  = \"GEN\"\n        subnet_type = \"PUBLIC\"\n        zone        = \"KR-1\"\n        subnet      = \"10.0.1.0/24\"\n        network_acl = \"default\"\n      },\n      {\n        name        = \"sbn-foo-public-2\"\n        usage_type  = \"GEN\"\n        subnet_type = \"PUBLIC\"\n        zone        = \"KR-2\"\n        subnet      = \"10.0.2.0/24\"\n        network_acl = \"default\"\n      },\n      {\n        name        = \"sbn-foo-private-1\"\n        usage_type  = \"GEN\"\n        subnet_type = \"PRIVATE\"\n        zone        = \"KR-1\"\n        subnet      = \"10.0.3.0/24\"\n        network_acl = \"default\"\n      },\n      {\n        name        = \"sbn-foo-private-2\"\n        usage_type  = \"GEN\"\n        subnet_type = \"PRIVATE\"\n        zone        = \"KR-2\"\n        subnet      = \"10.0.4.0/24\"\n        network_acl = \"default\"\n      },\n      {\n        name        = \"sbn-foo-lb-1\"\n        usage_type  = \"LOADB\"\n        subnet_type = \"PRIVATE\"\n        zone        = \"KR-1\"\n        subnet      = \"10.0.5.0/24\"\n        network_acl = \"nacl-foo-loadbalancer\"\n      },\n      {\n        name        = \"sbn-foo-lb-2\"\n        usage_type  = \"LOADB\"\n        subnet_type = \"PRIVATE\"\n        zone        = \"KR-2\"\n        subnet      = \"10.0.6.0/24\"\n        network_acl = \"nacl-foo-loadbalancer\"\n      }\n    ]\n\n    network_acls = [\n      {\n        name        = \"default\"\n        description = \"Default Network ACL for this VPC\"\n        inbound_rules = []\n        outbound_rules = []\n      },\n      {\n        name        = \"nacl-foo-loadbalancer\"\n        description = \"Network ACL for loadbalaner subnets\"\n        inbound_rules = [\n          [100, \"TCP\", \"dagrp-foo\", 22, \"ALLOW\", \"SSH allow form dagrp-foo\"],\n          [110, \"TCP\", \"0.0.0.0/0\", 22, \"ALLOW\", \"SSH allow form any\"]\n        ]\n        outbound_rules = [\n          [110, \"TCP\", \"0.0.0.0/0\", \"1-65535\", \"ALLOW\", \"All allow to any\"]\n        ]\n      }\n    ]\n\n    deny_allow_groups = [\n      {\n        name        = \"dagrp-foo\"\n        description = \"foo deny allow group\"\n        ip_list     = [\"10.0.0.1\", \"10.0.0.2\"]\n      }\n    ]\n\n    access_control_groups = [\n      {\n        name        = \"default\"\n        description = \"Default ACG for this VPC\"\n        outbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"UDP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"]\n        ]\n      },\n      {\n        name        = \"acg-foo-public\"\n        description = \"ACG for public servers\"\n        inbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", 22, \"SSH allow form any\"]\n        ]\n        outbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"UDP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"]\n        ]\n      },\n      {\n        name        = \"acg-foo-private\"\n        description = \"ACG for private servers\"\n        inbound_rules = [\n          [\"TCP\", \"acg-foo-public\", 22, \"SSH allow form acg-foo-public\"]\n        ]\n        outbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"UDP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"]\n        ]\n      }\n    ]\n\n    public_route_tables = []\n    private_route_tables = [\n      {\n        name         = \"rt-foo-private-1\"\n        description  = \"Route table for Private, LB subnets on KR-1 zone\"\n        subnet_names = [\"sbn-foo-private-1\", \"sbn-foo-lb-1\"]\n      },\n      {\n        name         = \"rt-foo-private-2\"\n        description  = \"Route table for Private, LB subnets on KR-2 zone\"\n        subnet_names = [\"sbn-foo-private-2\", \"sbn-foo-lb-2\"]\n      }\n    ]\n\n    nat_gateways = [\n      {\n        name        = \"nat-gw-foo-1\"\n        zone        = \"KR-1\"\n        route_table = \"rt-foo-private-1\"\n      },\n      {\n        name        = \"nat-gw-foo-2\"\n        zone        = \"KR-2\"\n        route_table = \"rt-foo-private-2\"\n      }\n    ]\n  },\n\n  {\n    name            = \"vpc-bar\"\n    ipv4_cidr_block = \"10.10.0.0/16\"\n\n    subnets = [\n      {\n        name        = \"sbn-bar-public\"\n        usage_type  = \"GEN\"\n        subnet_type = \"PUBLIC\"\n        zone        = \"KR-1\"\n        subnet      = \"10.10.1.0/24\"\n        network_acl = \"default\"\n      },\n      {\n        name        = \"sbn-bar-private\"\n        usage_type  = \"GEN\"\n        subnet_type = \"PRIVATE\"\n        zone        = \"KR-1\"\n        subnet      = \"10.10.2.0/24\"\n        network_acl = \"default\"\n      }\n    ]\n\n\n    access_control_groups = [\n      {\n        name        = \"acg-bar-public\"\n        description = \"ACG for public servers\"\n        inbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", 22, \"SSH allow form any\"]\n        ]\n        outbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"UDP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"ICMP\", \"0.0.0.0/0\", \"\", \"All allow to any\"]\n        ]\n      },\n      {\n        name        = \"acg-bar-private\"\n        description = \"ACG for private servers\"\n        inbound_rules = [\n          [\"TCP\", \"acg-bar-public\", 22, \"SSH allow form acg-bar-public\"]\n        ]\n        outbound_rules = [\n          [\"TCP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"UDP\", \"0.0.0.0/0\", \"1-65535\", \"All allow to any\"],\n          [\"ICMP\", \"0.0.0.0/0\", \"\", \"All allow to any\"]\n        ]\n      }\n    ]\n\n    private_route_tables = [\n      {\n        name         = \"rt-bar-private\"\n        description  = \"Route table for Private, LB subnets on KR-1 zone\"\n        subnet_names = [\"sbn-bar-private\"]\n      }\n    ]\n\n    nat_gateways = [\n      {\n        name        = \"nat-gw-bar\"\n        zone        = \"KR-1\"\n        route_table = \"rt-bar-private\"\n      }\n    ]\n  }\n]\n\n```\n\n## Module Usage\n\n### `main.tf`\n\nMap your `VPC variable name` to a `local VPC variable`. `VPC module` are created using `local VPC variables`. This eliminates the need to change the variable name reference structure in the `VPC module`.\n\n``` hcl\nlocals {\n  vpcs = var.vpcs\n}\n```\n\nThen just copy \u0026 paste the module declaration below.\n\n``` hcl\nmodule \"vpcs\" {\n  source = \"terraform-ncloud-modules/vpc/ncloud\"\n\n  for_each = { for vpc in local.vpcs : vpc.name =\u003e vpc }\n\n  name                  = each.value.name\n  ipv4_cidr_block       = each.value.ipv4_cidr_block\n  subnets               = each.value.subnets\n  network_acls          = each.value.network_acls\n  deny_allow_groups     = each.value.deny_allow_groups\n  access_control_groups = each.value.access_control_groups\n  public_route_tables   = each.value.public_route_tables\n  private_route_tables  = each.value.private_route_tables\n  nat_gateways          = each.value.nat_gateways\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-ncloud-modules%2Fterraform-ncloud-vpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-ncloud-modules%2Fterraform-ncloud-vpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-ncloud-modules%2Fterraform-ncloud-vpc/lists"}