-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.tf
63 lines (55 loc) · 1.7 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
data "terraform_remote_state" "network" {
backend = "remote"
config = {
organization = var.org
workspaces = {
name = var.network_workspace
}
}
}
terraform {
required_providers {
vsphere = {
source = "hashicorp/vsphere"
}
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "vsphere" {
# Configuration options
// Requires ENV variable VSPHERE_USER
// Requires ENV variable VSPHERE_PASSWORD
// Requires ENV variable VSPHERE_SERVER
# If you have a self-signed cert
allow_unverified_ssl = true
}
# Deploy VM to On-Premises site
module "demo_vm" {
source = "app.terraform.io/cisco-dcn-ecosystem/demo_vm/vsphere"
version = "0.0.2"
vmware_dvs = data.terraform_remote_state.network.outputs.vmware_vds
vmware_portgroup = data.terraform_remote_state.network.outputs.vmware_portgroup
vm_name = "TF-Wordpress-DB"
db_ip_address = var.db_ip_address
db_gateway = data.terraform_remote_state.network.outputs.db_gateway
}
provider "azurerm" {
features {}
// Requires ENV variable ARM_SUBSCRIPTION_ID
// Requires ENV variable ARM_CLIENT_ID
// Requires ENV variable ARM_CLIENT_SECRET
// Requires ENV variable ARM_TENANT_ID
}
# Deploy VM to Azure site
module "demo-azure" {
source = "app.terraform.io/cisco-dcn-ecosystem/demo-mso/azurerm"
version = "0.0.2"
vm_name = "TF-Wordpress-Web"
db_ip_address = var.db_ip_address
subnet_name = data.terraform_remote_state.network.outputs.azure_subnet_name
virtual_network_name = data.terraform_remote_state.network.outputs.virtual_network_name
vm_resource_group_name = "VMs_WoS_TF-Hybrid_Cloud_VRF_westus"
net_resource_group_name = data.terraform_remote_state.network.outputs.resource_group_name
}