{"id":25970736,"url":"https://github.com/mmgil/terraform-mgc-network-vpcs","last_synced_at":"2025-06-24T16:40:29.816Z","repository":{"id":279416661,"uuid":"938734160","full_name":"mmgil/terraform-mgc-network-vpcs","owner":"mmgil","description":"Magalu Cloud VPC Module","archived":false,"fork":false,"pushed_at":"2025-02-25T12:35:35.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T13:32:35.840Z","etag":null,"topics":["magalu","magalu-cloud","magalucloud","module","terraform","virtual-private-cloud"],"latest_commit_sha":null,"homepage":"https://m1cloud.com.br","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/mmgil.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}},"created_at":"2025-02-25T12:21:16.000Z","updated_at":"2025-02-25T13:05:14.000Z","dependencies_parsed_at":"2025-02-25T13:32:38.345Z","dependency_job_id":"1a3b968e-554e-4657-a98c-c05b0cf0cfaa","html_url":"https://github.com/mmgil/terraform-mgc-network-vpcs","commit_stats":null,"previous_names":["mmgil/terraform-mgc-network-vpcs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmgil%2Fterraform-mgc-network-vpcs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmgil%2Fterraform-mgc-network-vpcs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmgil%2Fterraform-mgc-network-vpcs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmgil%2Fterraform-mgc-network-vpcs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmgil","download_url":"https://codeload.github.com/mmgil/terraform-mgc-network-vpcs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241935269,"owners_count":20044827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["magalu","magalu-cloud","magalucloud","module","terraform","virtual-private-cloud"],"created_at":"2025-03-04T23:19:30.556Z","updated_at":"2025-03-04T23:19:31.121Z","avatar_url":"https://github.com/mmgil.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# INTRODUCTION\n\n**PROJECT**: IaC (Infrastructure as a Code) with terraform for deploying azure resource group\n\n## What Is Terraform?\n\nTerraform is an infrastructure as code (IaC) tool that allows you to build, change, and version infrastructure safely and efficiently. This includes both low-level components like compute instances, storage, and networking, as well as high-level components like DNS entries and SaaS features.\n\n## What Is MGC Network VPC?\n\nVPC is a virtual network isolated behind of the Magalu Cloud infrastructure. This resource allow you execute yours resources with more security and privacy, with full control over the network environment.\n\n[more](https://docs.magalu.cloud/docs/network/overview)\n\n# NAMING CONVENTIONS\n\nAn effective naming convention consists of resource names from important information about each resource. A good name helps you quickly identify the resource's type, associated workload, environment, and the region hosting it.\n\nIn our environment we adopt the following convention:\n\n| Business Cost Center (any characters) | Environment (3 characters and 1 number) | Azure Region (4 characters) | Resource Type (5 characters max) | Instance (3 characters) |\n| ----------------------------------- | --------------------------------------- | --------------------------- | -------------------------------- | :---------------------: |\n\nEnvironments possibles:\n\n| Name        | Acronym | Description                                         |\n| ----------- | ------- | --------------------------------------------------- |\n| Production  | pro1    | Production Environment                              |\n| Staging     | sta1    | Homologation Environment                            |\n| Development | dev1    | Development Environment                             |\n| Shared      | sha1    | Shared Environment                                  |\n| hub         | hub1    | Transit Environment to network resources            |\n| Spoke       | spk1    | Hub Environment to traffic requests to on-premisses |\n\nMagalu Cloud Region (5 characters) according this table:\n\n| ACRONYM | REGION            |\n| ------- | ----------------- |\n| `brse1`  | `br-se1`         |\n| `brne1`  | `br-ne1`         |\n\nFor example, a virtual machine for a business costcenter called cliente01 for a production workload in the Brasil Sudeste Region might be cliente01-pro1-brse1-prj-001.\n\ncliente01-pro1-brse1-prj-001\n\n# INSTALL TERRAFORM\n\n## Linux\n\n### Ubuntu\n\n```bash\n  curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -\n  sudo apt-add-repository \"deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main\"\n  sudo apt-get update \u0026\u0026 sudo apt-get install terraform\n  terraform version\n```\n\n### CentOS/RHEL/Oracle Linux\n\n```bash\n  sudo yum install -y yum-utils\n  sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo\n  sudo yum -y install terraform\n  terraform version\n```\n\n## Windows\n\n```powershell\n Invoke-WebRequest -Uri https://releases.hashicorp.com/terraform/1.1.9/terraform_1.1.9_windows_amd64.zip -OutFile terraform.zip\n Expand-Archive .\\terraform.zip -DestinationPath C:\\Windows\\System32\\ -Force\n terraform version\n```\n\n# AUTHENTICATING IN HASHICORP ENVIRONMENT\n\nWe are using hashicorp's SAAS to host the service states. By default, Terraform will obtain an API token and save it in plain text in a local CLI configuration file called credentials.tfrc.json. When you run terraform login, it will explain specifically where it intends to save the API token and give you a chance to cancel if the current configuration is not as desired.\n\nYou can get more details about these features from the following links:\n\n[CLI Authentication](https://www.terraform.io/cli/auth)\n\n[terraform login](https://www.terraform.io/cli/commands/login)\n\n[CLI Configuration File](https://www.terraform.io/cli/config/config-file)\n\nYou can find the API Token that has already been generated in the environment in our keepass and configure your CLI as follows:\n\n**In Windows**:\n\n```powershell\n@\"\n{\n  \"credentials\": {\n    \"app.terraform.io\": {\n      \"token\": \"SEE IN THE KEEPASS OR CONSULTE OURS ADMINS\"\n    }\n  }\n}\n\"@ | Set-Content ~\\AppData\\Roaming\\terraform.d\\credentials.tfrc.json\n```\n\n**In Linux**:\n\n```bash\ncat \u003c\u003cEOF | tee ~/.terraform.d/credentials.tfrc.json\n{\n  \"credentials\": {\n    \"app.terraform.io\": {\n      \"token\": \"SEE IN THE KEEPASS OR CONSULTE OURS ADMINS\"\n    }\n  }\n}\nEOF\n```\n\n# AUTHENTICATING IN MAGALU CLOUD\n\nIf workspace in Hashicorp's environment is configured to operate locally, you will need to authenticate to the API of the Magalu Cloud using an API KEY.\n\nYou can more information how to generate this API KEY in [Create API Key](https://docs.magalu.cloud/docs/devops-tools/api-keys/how-to/other-products/create-api-key)\n\nIn our environment we use the credentials as environment variables to autenticate in API of the Magalu Cloud, for example:\n\n**Linux**:\n\n```bash\n  export MGC_API_KEY=\"00000000-0000-0000-0000-000000000000\"\n```\n\n**Windows**:\n\n```powershell\n  $env:MGC_API_KEY=\"00000000-0000-0000-0000-000000000000\"\n```\n\nTo persist environment variables at user level\n\n```powershell\n  [System.Environment]::SetEnvironmentVariable(\"MGC_API_KEY\",\"00000000-0000-0000-0000-000000000000\",\"User\")\n```\n\nTo persist environment variables at machine level\n\n```powershell\n  [System.Environment]::SetEnvironmentVariable(\"MGC_API_KEY\",\"00000000-0000-0000-0000-000000000000\",\"Machine\")\n```\n\n**ATTENTION**: On Linux operating systems it is not possible to persist environment variables\n\nBy declaring these environment variables, terraform will be able to authenticate through this SPN\n\n# MODULE DOCUMENTATION\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_mgc\"\u003e\u003c/a\u003e [mgc](#requirement\\_mgc) | 0.32.2 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_mgc\"\u003e\u003c/a\u003e [mgc](#provider\\_mgc) | 0.32.2 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [mgc_network_subnetpools.subnetpool](https://registry.terraform.io/providers/MagaluCloud/mgc/0.32.2/docs/resources/network_subnetpools) | resource |\n| [mgc_network_vpcs.vpc](https://registry.terraform.io/providers/MagaluCloud/mgc/0.32.2/docs/resources/network_vpcs) | resource |\n| [mgc_network_vpcs_subnets.subnet](https://registry.terraform.io/providers/MagaluCloud/mgc/0.32.2/docs/resources/network_vpcs_subnets) | resource |\n| [mgc_availability_zones.availability_zones](https://registry.terraform.io/providers/MagaluCloud/mgc/0.32.2/docs/data-sources/availability_zones) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_project_name\"\u003e\u003c/a\u003e [project\\_name](#input\\_project\\_name) | [REQUIRED] Name of an existing Project Name | `string` | n/a | yes |\n| \u003ca name=\"input_sequence\"\u003e\u003c/a\u003e [sequence](#input\\_sequence) | [REQUIRED] Sequence to be used on resource naming. | `number` | `1` | no |\n| \u003ca name=\"input_subnet_pools\"\u003e\u003c/a\u003e [subnet\\_pools](#input\\_subnet\\_pools) | [REQUIRED] The address space that is used the virtual network. You can supply more than one address space. CAUTION: Changing the existing address space recalculates all subnets. This action can harm the environment. | \u003cpre\u003emap(\u003cbr\u003e    object(\u003cbr\u003e      {\u003cbr\u003e        ## - REQUIRED - SUBNET POO, ENABLED OR NO.\u003cbr\u003e        enabled = bool\u003cbr\u003e        ## REQUIRED - The description of the subnet pool.\u003cbr\u003e        description = string\u003cbr\u003e        ## OPTIONAL - The CIDR block of the subnet pool\u003cbr\u003e        cidr = optional(string)\u003cbr\u003e        ## REQUIRED - \u003cbr\u003e        type = optional(string)\u003cbr\u003e        ## REQUIRED - VPC\u003cbr\u003e        vpcs = map(\u003cbr\u003e          object(\u003cbr\u003e            {\u003cbr\u003e              enabled     = bool\u003cbr\u003e              description = optional(string)\u003cbr\u003e              ## REQUIRED - Network VPC Subnet\u003cbr\u003e              subnets = map(\u003cbr\u003e                object(\u003cbr\u003e                  {\u003cbr\u003e                    description     = optional(string)\u003cbr\u003e                    enabled         = bool\u003cbr\u003e                    dns_nameservers = optional(list(string))\u003cbr\u003e                    ip_version      = string\u003cbr\u003e                    mask            = number\u003cbr\u003e order           = number\u003cbr\u003e                  }\u003cbr\u003e                )\u003cbr\u003e              )\u003cbr\u003e            }\u003cbr\u003e          )\u003cbr\u003e        )\u003cbr\u003e      }\u003cbr\u003e    )\u003cbr\u003e  )\u003c/pre\u003e | \u003cpre\u003e{\u003cbr\u003e  \"main\": {\u003cbr\u003e    \"cidr\": \"10.0.0.0/16\",\u003cbr\u003e    \"description\": \"Managed by Terraform (M1 Cloud).\",\u003cbr\u003e    \"enabled\": true,\u003cbr\u003e    \"vpcs\": {\u003cbr\u003e      \"default\": {\u003cbr\u003e        \"description\": \"Managed by Terraform.\",\u003cbr\u003e        \"enabled\": true,\u003cbr\u003e        \"subnets\": {\u003cbr\u003e          \"zona1\": {\u003cbr\u003e            \"dns_nameservers\": [\u003cbr\u003e              \"8.8.8.8\",\u003cbr\u003e              \"8.8.4.4\"\u003cbr\u003e            ],\u003cbr\u003e            \"enabled\": true,\u003cbr\u003e            \"ip_version\": \"IPv4\",\u003cbr\u003e            \"mask\": 22,\u003cbr\u003e            \"order\": 1\u003cbr\u003e          }\u003cbr\u003e        }\u003cbr\u003e      }\u003cbr\u003e    }\u003cbr\u003e  }\u003cbr\u003e}\u003c/pre\u003e | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_resources\"\u003e\u003c/a\u003e [resources](#output\\_resources) | n/a |\n\n# DOCUMENTATION\n\nSome of this documentation was generated through terraform-docs using the following command:\n\n```bash\n  docker run --rm --volume \"$(pwd):/terraform-docs\" quay.io/terraform-docs/terraform-docs:0.16.0 markdown /terraform-docs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmgil%2Fterraform-mgc-network-vpcs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmgil%2Fterraform-mgc-network-vpcs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmgil%2Fterraform-mgc-network-vpcs/lists"}