Last active
June 12, 2019 20:01
-
-
Save dataclouder/190226409ec8b3f7e983c2b56d38f614 to your computer and use it in GitHub Desktop.
sample terraform config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "vcd" { | |
user = "${var.user}" | |
password = "${var.password}" | |
url = "https://${var.vcd_address}/api" | |
sysorg = "${var.sysorg}" | |
org = "${var.org_name}" | |
allow_unverified_ssl = "true" | |
version = "~> 2.4" | |
} | |
resource "vcd_external_network" "extnetdatacloud" { | |
name = "extnetdatacloud" | |
description = "external net datacloud " | |
vsphere_network { | |
vcenter = "vc1" | |
name = "VM Network" | |
type = "NETWORK" | |
} | |
ip_scope { | |
gateway = "${var.gateway_ip}" | |
netmask = "255.255.224.0" | |
dns1 = "${var.dns}" | |
dns2 = "8.8.4.4" | |
dns_suffix = "datacloud.org" | |
static_ip_pool { | |
start_address = "${var.external_ip_1}" | |
end_address = "${var.external_ip_2}" | |
} | |
} | |
retain_net_info_across_deployments = "false" | |
} | |
resource "vcd_org" "datacloud" { | |
name = "datacloud" | |
full_name = "datacloud" | |
is_enabled = "true" | |
stored_vm_quota = 50 | |
deployed_vm_quota = 50 | |
delete_force = "true" | |
delete_recursive = "true" | |
} | |
resource "vcd_org_vdc" "datacloudvdc" { | |
name = "datacloudvdc" | |
org = "${vcd_org.datacloud.name}" | |
allocation_model = "AllocationVApp" | |
provider_vdc_name = "${var.provider_vdc}" | |
network_pool_name = "${var.provider_vdc}-VXLAN-NP" | |
network_quota = 50 | |
compute_capacity { | |
cpu { | |
limit = 0 | |
} | |
memory { | |
limit = 0 | |
} | |
} | |
storage_profile { | |
name = "*" | |
enabled = true | |
limit = 0 | |
default = true | |
} | |
storage_profile { | |
name = "Development" | |
enabled = true | |
limit = 0 | |
default = false | |
} | |
enabled = true | |
enable_thin_provisioning = true | |
enable_fast_provisioning = true | |
delete_force = true | |
delete_recursive = true | |
} | |
resource "vcd_edgegateway" "gwdatacloud" { | |
org = "${vcd_org.datacloud.name}" | |
vdc = "${vcd_org_vdc.datacloudvdc.name}" | |
name = "gwdatacloud" | |
description = "Datacloud edge gateway" | |
backing_config = "compact" | |
default_gateway = "${vcd_external_network.extnetdatacloud.name}" | |
external_networks = ["${vcd_external_network.extnetdatacloud.name}"] | |
} | |
resource "vcd_catalog" "datacloudcat" { | |
org = "${vcd_org.datacloud.name}" | |
name = "datacloudcat" | |
description = "datacloud catalog" | |
delete_force = "true" | |
delete_recursive = "true" | |
depends_on = ["vcd_org_vdc.datacloudvdc"] | |
} | |
resource "vcd_catalog_item" "photon-hw11" { | |
org = "${vcd_org.datacloud.name}" | |
catalog = "${vcd_catalog.datacloudcat.name}" | |
name = "photon-hw11" | |
description = "Photon hw 11" | |
ova_path = "/path/to/vm/photon-hw11-3.0-26156e2.ova" | |
upload_piece_size = 5 | |
show_upload_progress = "true" | |
} | |
resource "vcd_catalog_media" "test_media" { | |
org = "${vcd_org.datacloud.name}" | |
catalog = "${vcd_catalog.datacloudcat.name}" | |
name = "test_media" | |
description = "test media" | |
media_path = "/path/to/vm/test.iso" | |
upload_piece_size = 5 | |
show_upload_progress = "true" | |
} | |
resource "vcd_network_routed" "netdatacloud" { | |
name = "netdatacloud" | |
org = "${vcd_org.datacloud.name}" | |
vdc = "${vcd_org_vdc.datacloudvdc.name}" | |
edge_gateway = "${vcd_edgegateway.gwdatacloud.name}" | |
gateway = "192.168.2.1" | |
static_ip_pool { | |
start_address = "192.168.2.2" | |
end_address = "192.168.2.100" | |
} | |
} | |
resource "vcd_network_isolated" "netdatacloud2" { | |
name = "netdatacloud2" | |
org = "${vcd_org.datacloud.name}" | |
vdc = "${vcd_org_vdc.datacloudvdc.name}" | |
gateway = "192.168.3.1" | |
static_ip_pool { | |
start_address = "192.168.3.2" | |
end_address = "192.168.3.100" | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sysorg = "System" | |
password = "SOMESECRET" | |
user = "administrator" | |
vcd_address = "vcd.my-private-area.org" | |
org_name = "datacloud" | |
provider_vdc = "vc1-PVDC" | |
dns = "someIP" | |
external_ip_1 = "some static IP" | |
external_ip_2 = "some other static IP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable user {} | |
variable password {} | |
variable sysorg {} | |
variable vcd_address {} | |
variable provider_vdc {} | |
variable org_name {} | |
variable dns {} | |
variable external_ip_1 {} | |
variable external_ip_2 {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment