Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redevelop the VPC module upgrade to Terraform 0.12 #28

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ If you have any problems when using this module, please opening a [provider issu

Authors
-------
Created and maintained by He Guimin(@xiaozhu36 heguimin36@163.com)
Created and maintained by:
- He Guimin(@xiaozhu36 heguimin36@163.com)
- Brian Mori (@brianmori)

License
----
Expand Down
18 changes: 0 additions & 18 deletions examples/complete/README.md

This file was deleted.

52 changes: 0 additions & 52 deletions examples/complete/main.tf

This file was deleted.

45 changes: 0 additions & 45 deletions examples/complete/outputs.tf

This file was deleted.

11 changes: 11 additions & 0 deletions examples/shared-owner/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module "vpc" {

source = "../../../terraform-modules/github-terraform-alicloud-vpc"
vpc_name = "vpc-standalone"
vpc_cidr = "172.18.0.0/16"

create_nat_gateway = true

route_table_description = "Route description"

}
25 changes: 25 additions & 0 deletions examples/shared-participant/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module "vpc" {

source = "../../../terraform-modules/github-terraform-alicloud-vpc"

create_vpc = false
vpc_id = "abc-123"

route_table_description = "Route description"

vswitches = {
aze = {
name = "subnet-1",
cidr_block = "172.18.2.0/24",
availability_zone = "cn-shanghai-g",
description = ""
},
azf = {
name = "subnet-2",
cidr_block = "172.18.0.0/24",
availability_zone = "cn-shanghai-e",
description = ""
}
}

}
27 changes: 27 additions & 0 deletions examples/standalone/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module "vpc" {

source = "../../../terraform-modules/github-terraform-alicloud-vpc"
vpc_name = "vpc-standalone"
vpc_cidr = "172.18.0.0/16"

create_nat_gateway = true
associate_nat_gateway = true

route_table_description = "Route description"

vswitches = {
aze = {
name = "subnet-1",
cidr_block = "172.18.2.0/24",
availability_zone = "cn-shanghai-g",
description = ""
},
azf = {
name = "subnet-2",
cidr_block = "172.18.0.0/24",
availability_zone = "cn-shanghai-e",
description = ""
}
}

}
28 changes: 0 additions & 28 deletions examples/use-default-vpc/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions examples/use-default-vpc/main.tf

This file was deleted.

21 changes: 0 additions & 21 deletions examples/use-default-vpc/outputs.tf

This file was deleted.

18 changes: 0 additions & 18 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,18 +0,0 @@
locals {
route_table_id = var.vpc_id == "" ? concat(alicloud_vpc.vpc.*.route_table_id, [""])[0] : data.alicloud_route_tables.this.ids.0

# Get ID of created Security Group
this_vpc_id = var.vpc_id != "" ? var.vpc_id : concat(alicloud_vpc.vpc.*.id, [""])[0]
# Whether to create other resources in which the vpc
create_sub_resources = var.vpc_id != "" || var.create ? true : false
this_vpc_cidr_block = local.this_vpc_id == "" ? "" : concat(data.alicloud_vpcs.this.vpcs.*.cidr_block, [""])[0]
this_vpc_name = local.this_vpc_id == "" ? "" : concat(data.alicloud_vpcs.this.vpcs.*.vpc_name, [""])[0]
}

data "alicloud_route_tables" "this" {
vpc_id = local.this_vpc_id
}

data "alicloud_vpcs" "this" {
ids = var.vpc_id != "" ? [var.vpc_id] : null
}
Loading