Skip to content

alibabacloud-automation/terraform-alicloud-vpc-bastionhost

Repository files navigation

Terraform module which creating VPC and bastion host on Alibaba Cloud

terraform-alicloud-vpc-bastionhost

English | 简体中文

This module is used to create VPC and bastion host on Alibaba Cloud under Alibaba Cloud.

These types of resources are supported:

Usage

data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "default" {
  vpc_name   = "TerraformTest"
  cidr_block = "172.16.0.0/12"
}

resource "alicloud_security_group" "default" {
  vpc_id = alicloud_vpc.default.id
  name   = "TerraformTest"
}

resource "alicloud_vswitch" "default" {
  vpc_id     = alicloud_vpc.default.id
  cidr_block = cidrsubnet(alicloud_vpc.default.cidr_block, 8, 4)
  zone_id    = data.alicloud_zones.default.zones[0].id
}

locals {
  zone_id = data.alicloud_zones.default.ids[length(data.alicloud_zones.default.ids) - 1]
}

module "example" {
  source               = "terraform-alicloud-modules/vpc-bastionhost/alicloud"
  vswtich_id           = alicloud_vswitch.default.id
  security_group_ids   = [alicloud_security_group.default.id]
  bastion_license_code = "bhah_ent_50_asset"
}

Notes

  • This module using AccessKey and SecretKey are from profile and shared_credentials_file. If you have not set them yet, please install aliyun-cli and configure it.

Requirements

Name Version
terraform > = 0.13.0
alicloud > = 1.110.0

Providers

Name Version
alicloud > = 1.110.0

Submit Issues

If you have any problems when using this module, please opening a provider issue and let us know.

Note: There does not recommend opening an issue on this repo.

Authors

Created and maintained by Alibaba Cloud Terraform Team([email protected])

License

MIT Licensed. See LICENSE for full details.

Reference