Skip to content

Instantly share code, notes, and snippets.

@chiradeep
Created May 18, 2015 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiradeep/c66f0e61774a8f62546d to your computer and use it in GitHub Desktop.
Save chiradeep/c66f0e61774a8f62546d to your computer and use it in GitHub Desktop.
Non-working terraform
provider "cloudstack" {
api_url = "http://localhost:8080/client/api"
api_key = "tZTPtxAfbZfTrIiIDe4XHfZupjlCoVYy3JnIfvlqyxWvHbVJ9TDw8UWxQ_INj6r5NWGglLMYHX4hN33sMuoI1g"
secret_key = "9u1bizzTQrfhnp3Y_Cs-Zu9uiOr-nAmRcN5Eo6Pp8dlbeKgq_V0TqUqhDdDGgrXFqzT8yZ731UUPTPDeFKLzzQ"
}
resource "cloudstack_vpc" "default" {
name = "test-vpc"
display_text = "test-vpc"
cidr = "10.0.0.0/16"
vpc_offering = "Default VPC Offering"
zone = "zone001"
}
resource "cloudstack_network_acl" "default" {
name = "test-acl"
vpc = "test-vpc"
}
resource "cloudstack_network" "subnet-1" {
name = "subnet-1"
display_text = "subnet-1"
cidr = "10.0.10.0/24"
network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks"
#aclid = "${cloudstack_network_acl.default.id}"
zone = "zone001"
vpc = "test-vpc"
}
resource "cloudstack_network" "subnet-2" {
name = "subnet-2"
display_text = "subnet-2"
cidr = "10.0.20.0/24"
network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks"
#aclid = "${cloudstack_network_acl.default.id}"
vpc = "test-vpc"
zone = "zone001"
}
resource "cloudstack_instance" "vm01" {
zone = "zone001"
service_offering = "t1.micro"
template = "CentOS6.5"
name = "vm01-subnet-1"
network = "subnet-1"
}
resource "cloudstack_instance" "vm02" {
zone = "zone001"
service_offering = "t1.micro"
template = "CentOS6.5"
name = "vm02-subnet-2"
network = "subnet-2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment