A terraform module used to create TencentCloud VPC, subnet and route entry.
## Getting started
The following resources are included.
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
-[ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-[ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-[ ] [Set up project integrations](https://gitlab.yun.shop/eos-test/tuantuan-aliyun-test-module/-/settings/integrations)
## Collaborate with your team
-[ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-[ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-[ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-[ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
-[ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-[ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-[ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-[ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-[ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
If you have ideas for releases in the future, it is a good idea to list them in the README.
subnet_name="simple-vpc"
subnet_cidrs=["10.0.0.0/24"]
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
destination_cidrs=["1.0.1.0/24"]
next_type=["EIP"]
next_hub=["0"]
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
tags={
module="vpc"
}
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
vpc_tags={
test="vpc"
}
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
subnet_tags={
test="subnet"
}
}
```
## License
For open source projects, say how it is licensed.
## Conditional Creation
This module can create VPC and VPC Subnet.
It is possible to use existing VPC when specify `vpc_id` parameter.
## Inputs
| Name | Description | Type | Default | Required |
| tags | A map of tags to add to all resources. | map(string) | {} | no |
| cpu_core_count | CPU core count used to query supported available zones. | number | 1 | no |
| memory_size | Memory size used to query supported available zones. | number | 2 | no |
| gpu_core_count | GPU core count used to query supported available zones. | number | 0 | no |
| create_vpc | - | bool | true | no |
| vpc_id | The vpc id used to launch resources. | string | "" | no |
| vpc_name | The vpc name used to launch a new vpc when 'vpc_id' is not specified. | string | my-vpc | no |
| vpc_cidr | The cidr block used to launch a new vpc when 'vpc_id' is not specified. | string | 172.16.0.0/16 | no |
| vpc_is_multicast | Specify the vpc is multicast when 'vpc_id' is not specified. | bool | true | no |
| vpc_dns_servers | Specify the vpc dns servers when 'vpc_id' is not specified. | list(string) | [] | no |
| vpc_tags | Additional tags for the vpc. | map(string) | {} | no |
| subnet_name | Specify the subnet name when 'vpc_id' is not specified. | string | subnet | no |
| subnet_cidrs | Specify the subnet cidr blocks when 'vpc_id' is not specified. | list(string) | [] | no |
| subnet_is_multicast | Specify the subnet is multicast when 'vpc_id' is not specified. | bool | true | no |
| subnet_tags | Additional tags for the subnet. | map(string) | {} | no |
| availability_zones | List of available zones to launch resources. | list(string) | [] | no |
| create_route_table | - | bool | true | no |
| route_table_id | The route table id of router table in the specified vpc. | string | "" | no |
| destination_cidrs | List of destination CIDR blocks of router table in the specified VPC. | list(string) | [] | no |
| next_type | List of next hop types of router table in the specified vpc. | list(string) | [] | no |
| next_hub | List of next hop gateway id of router table in the specified vpc. | list(string) | [] | no |
| route_table_tags | Additional tags for the route table. | map(string) | {} | no |
| enable_vpn_gateway | Create a new VPN Gateway resource and attach it to the VPC | bool | false | no |
| vpn_gateway_bandwidth | bandwidth of VPN Gateway | number | 5 | no |
| vpn_gateway_max_connection | Maximum number of connected clients allowed for the SSL VPN gateway. Valid values: [5, 10, 20, 50, 100]. This parameter is only required for SSL VPN gateways. | number | 5 | no |
| vpn_gateway_type | Type of VPN gateway. Valid value: IPSEC, SSL and CCN. | string | IPSEC | no |
| vpn_gateway_availability_zone | The Availability Zone for the VPN Gateway | string | "" | no |
| vpn_gateway_tags | Additional tags for the VPN gateway | map(string) | {} | no |
| manage_network_acl | Should be true to adopt and manage Network ACL for subnets | bool | false | no |
| network_acl_name | Name to be used on Network ACL | string | null | no |
| network_acl_tags | Additional tags for the Network ACL | map(string) | {} | no |
| network_acl_ingress | List of strings of ingress rules to set on the Network ACL, eg: `ACCEPT#0.0.0.0/0#ALL#ALL` | list(string) | null | no |
| network_acl_egress | List of strings of egress rules to set on the Network ACL, eg: `ACCEPT#0.0.0.0/0#ALL#ALL` | list(string) | null | no |
| enable_nat_gateway | Should be true if you want to provision NAT Gateways for vpc. | bool | false | no |
| nat_gateway_bandwidth | bandwidth of NAT Gateway | number | 100 | no |
| nat_gateway_concurrent | concurrency of NAT Gateway | number | 1000000 | no |
| nat_gateway_tags | Additional tags for the NAT gateway | map(string) | {} | no |
| nat_public_ips | List of EIPs to be used for `nat_gateway`, will create an new EIP if not set. | list(string) | [] | no |
| route_entry_id | The ids of route table entry. |
| availability_zones | The availability zones of instance type. |
| tags | The tags of vpc. |
| vpn_gateway_id | The ID of the VPN Gateway |
| vpn_gateway_public_ip_address | The public ip address of the VPN Gateway |
| network_acl_id | The ID of the network ACL |
| nat_gateway_id | The ID of the NAT Gateway |
| nat_public_ips | The EIPs of the NAT Gateway |
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
description="Controls if VPC should be created (it affects almost all resources)"
type=bool
default=true
}
variable"tags"{
description="A map of tags to add to all resources."
type=map(string)
default={}
}
variable"cpu_core_count"{
description="CPU core count used to query supported available zones."
default=1
}
variable"memory_size"{
description="Memory size used to query supported available zones."
default=2
}
variable"gpu_core_count"{
description="GPU core count used to query supported available zones."
default=0
}
variable"vpc_id"{
description="The vpc id used to launch resources."
default=""
}
variable"vpc_name"{
description="The vpc name used to launch a new vpc when 'vpc_id' is not specified."
default="my-vpc"
}
variable"vpc_cidr"{
description="The cidr block used to launch a new vpc when 'vpc_id' is not specified."
default="172.16.0.0/16"
}
variable"vpc_is_multicast"{
description="Specify the vpc is multicast when 'vpc_id' is not specified."
default=true
}
variable"vpc_dns_servers"{
description="Specify the vpc dns servers when 'vpc_id' is not specified."
type=list(string)
default=[]
}
variable"vpc_tags"{
description="Additional tags for the vpc."
type=map(string)
default={}
}
variable"subnet_name"{
description="Specify the subnet name when 'vpc_id' is not specified."
default="subnet"
}
variable"subnet_cidrs"{
description="Specify the subnet cidr blocks when 'vpc_id' is not specified."
type=list(string)
default=[]
}
variable"subnet_is_multicast"{
description="Specify the subnet is multicast when 'vpc_id' is not specified."
default=true
}
variable"subnet_tags"{
description="Additional tags for the subnet."
type=map(string)
default={}
}
variable"availability_zones"{
description="List of available zones to launch resources."
type=list(string)
default=[]
}
variable"create_route_table"{
description="Controls if separate route table for subnets should be created"
type=bool
default=true
}
variable"route_table_id"{
description="The route table id of router table in the specified vpc."
default=""
}
variable"destination_cidrs"{
description="List of destination CIDR blocks of router table in the specified VPC."
type=list(string)
default=[]
}
variable"next_type"{
description="List of next hop types of router table in the specified vpc."
type=list(string)
default=[]
}
variable"next_hub"{
description="List of next hop gateway id of router table in the specified vpc."
type=list(string)
default=[]
}
variable"number_format"{
description="The number format used to output."
default="%02d"
}
variable"route_table_tags"{
description="Additional tags for the route table."
type=map(string)
default={}
}
/* create vpn gateway in vpc */
variable"enable_vpn_gateway"{
description="Should be true if you want to create a new VPN Gateway resource and attach it to the VPC"
type=bool
default=false
}
variable"vpn_gateway_bandwidth"{
description="bandwidth of VPN Gateway"
type=number
default=5
}
variable"vpn_gateway_max_connection"{
description=" Maximum number of connected clients allowed for the SSL VPN gateway. Valid values: [5, 10, 20, 50, 100]. This parameter is only required for SSL VPN gateways."
type=number
default=5
}
variable"vpn_gateway_type"{
description="Type of VPN gateway. Valid value: IPSEC, SSL and CCN."
type=string
default="IPSEC"
}
variable"vpn_gateway_availability_zone"{
description="The Availability Zone for the VPN Gateway"
type=string
default=""
}
variable"vpn_gateway_tags"{
description="Additional tags for the VPN gateway"
type=map(string)
default={}
}
/* enable ACL to subnets */
variable"manage_network_acl"{
description="Should be true to adopt and manage Network ACL for subnets"
type=bool
default=false
}
variable"network_acl_name"{
description="Name to be used on Network ACL"
type=string
default=""
}
variable"network_acl_tags"{
description="Additional tags for the Network ACL"
type=map(string)
default={}
}
variable"network_acl_ingress"{
description="List of strings of ingress rules to set on the Network ACL, eg: `ACCEPT#0.0.0.0/0#ALL#ALL`"
type=list(string)
default=null
}
variable"network_acl_egress"{
description="List of strings of egress rules to set on the Network ACL, eg: `ACCEPT#0.0.0.0/0#ALL#ALL`"
type=list(string)
default=[
"ACCEPT#0.0.0.0/0#ALL#ALL"
]
}
variable"enable_nat_gateway"{
description="Should be true if you want to provision NAT Gateways for vpc."
type=bool
default=false
}
variable"nat_gateway_bandwidth"{
description="bandwidth of NAT Gateway"
type=number
default=100
}
variable"nat_gateway_concurrent"{
description="bandwidth of NAT Gateway"
type=number
default=1000000
}
variable"nat_gateway_tags"{
description="Additional tags for the NAT gateway"
type=map(string)
default={}
}
variable"nat_public_ips"{
description="List of EIPs to be used for `nat_gateway`"