Cloud Stack
Cloud Stack
Use this datasource to get the ID of a template for use in other resources.
» Example Usage
filter {
name = "name"
value = "CentOS 7\\.1"
}
filter {
name = "hypervisor"
value = "KVM"
}
}
» Argument Reference
» Attributes Reference
1
» cloudstack_affinity_group
» Example Usage
» Argument Reference
» Attributes Reference
» Import
2
» cloudstack_disk
Creates a disk volume from a disk offering. This disk volume will be
attached to a virtual machine if the optional parameters are
configured.
» Example Usage
» Argument Reference
3
» Attributes Reference
» Import
Disks can be imported; use <DISK ID> as the import ID. For example:
terraform import cloudstack_disk.default 6f3ee798-d417-4e7a-92bc-95ad41cf1244
When importing into a project you need to prefix the import ID with
the project name:
terraform import cloudstack_disk.default my-project/6f3ee798-d417-4e7a-92bc-95ad41cf1244
» cloudstack_egress_firewall
» Example Usage
rule {
cidr_list = ["10.0.0.0/8"]
protocol = "tcp"
ports = ["80", "1000-2000"]
}
}
» Argument Reference
4
• managed - (Optional) USE WITH CAUTION! If enabled all the
egress firewall rules for this network will be managed by this
resource. This means it will delete all firewall rules that are
not in your config! (defaults false)
• rule - (Optional) Can be specified multiple times. Each rule
block sup- ports fields documented below. If managed = false at
least one rule is required!
• parallelism (Optional) Specifies how much rules will be created
or deleted concurrently. (defaults 2)
The rule block supports:
• cidr_list - (Required) A CIDR list to allow access to the given ports.
• protocol - (Required) The name of the protocol to allow. Valid
options are: tcp, udp and icmp.
• icmp_type - (Optional) The ICMP type to allow. This can only be
speci- fied if the protocol is ICMP.
• icmp_code - (Optional) The ICMP code to allow. This can only be
spec- ified if the protocol is ICMP.
• ports - (Optional) List of ports and/or port ranges to allow.
This can only be specified if the protocol is TCP or UDP.
» Attributes Reference
» cloudstack_firewall
» Example Usage
rule {
cidr_list = ["10.0.0.0/8"]
protocol = "tcp"
ports = ["80", "1000-2000"]
5
}
}
» Argument Reference
» Attributes Reference
» cloudstack_instance
» Argument Reference
7
be created.
• project - (Optional) The name or ID of the project to deploy this
instance to. Changing this forces a new resource to be
created.
8
• zone - (Required) The name or ID of the zone where this
instance will be created. Changing this forces a new resource
to be created.
• start_vm - (Optional) This determines if the instances is started
after it is created (defaults true)
• user_data - (Optional) The user data to provide when
launching the instance. This can be either plain text or
base64 encoded text.
• keypair - (Optional) The name of the SSH key pair that will be
used to access this instance.
• expunge - (Optional) This determines if the instance is
expunged when it is destroyed (defaults false)
» Attributes Reference
» Import
Instances can be imported; use <INSTANCE ID> as the import ID. For example:
terraform import cloudstack_instance.default 5cf69677-7e4b-4bf4-b868-f0b02bb72ee0
When importing into a project you need to prefix the import ID with
the project name:
terraform import cloudstack_instance.default my-project/5cf69677-7e4b-4bf4-b868-f0b02bb72ee
» cloudstack_ipaddress
» Example Usage
resource "cloudstack_ipaddress" "default" {
network_id = "6eb22f91-7454-4107-89f4-36afcdf33021"
}
9
» Argument Reference
» Attributes Reference
» cloudstack_loadbalancer_rule
» Example Usage
» Argument Reference
» Attributes Reference
Creates a network.
» Example Usage
Basic usage:
resource "cloudstack_network" "default" {
name = "test-network"
cidr = "10.0.0.0/16"
network_offering = "Default Network"
zone = "zone-1"
}
» Argument Reference
1
2
• acl_id - (Optional) The ACL ID that should be attached to the
network or none if you do not want to attach an ACL. You can
dynamically attach
1
3
and swap ACL’s, but if you want to detach an attached ACL and
revert to using none, this will force a new resource to be
created. (defaults none)
• project - (Optional) The name or ID of the project to deploy this
instance to. Changing this forces a new resource to be
created.
• source_nat_ip - (Optional) If set to true a public IP will be
associated with the network. This is mainly used when the
network supports the source NAT service which claims the
first associated IP address. This prevents the ability to
manage the IP address as an independent entity.
• zone - (Required) The name or ID of the zone where this
network will be available. Changing this forces a new
resource to be created.
» Attributes Reference
» Import
Networks can be imported; use <NETWORK ID> as the import ID. For example:
terraform import cloudstack_network.default 36619b20-5584-43bf-9a84-e242bacd5582
When importing into a project you need to prefix the import ID with
the project name:
terraform import cloudstack_network.default my-project/36619b20-5584-43bf-9a84-e242bacd5582
» cloudstack_network_acl
» Example Usage
1
5
» Argument Reference
» Attributes Reference
» Import
Network ACLs can be imported; use <NETWORK ACL ID> as the import
ID. For example:
terraform import cloudstack_network_acl.default e8b5982a-1b50-4ea9-9920-6ea2290c7359
When importing into a project you need to prefix the import ID with
the project name:
terraform import cloudstack_network_acl.default my-project/e8b5982a-1b50-4ea9-9920-6ea2290c
» cloudstack_network_acl_rule
» Example Usage
rule {
action = "allow"
1
6
cidr_list = ["10.0.0.0/8"]
protocol = "tcp"
ports = ["80", "1000-2000"]
traffic_type = "ingress"
}
}
» Argument Reference
1
8
» Attributes Reference
» cloudstack_nic
» Example Usage
Basic usage:
resource "cloudstack_nic" "test" {
network_id = "6eb22f91-7454-4107-89f4-36afcdf33021"
ip_address = "192.168.1.1"
virtual_machine_id = "f8141e2f-4e7e-4c63-9362-986c908b7ea7"
}
» Argument Reference
» Attributes Reference
» cloudstack_port_forward
1
9
Creates port forwards.
2
0
» Example Usage
forward {
protocol = "tcp"
private_port = 80
public_port = 8080
virtual_machine_id = "f8141e2f-4e7e-4c63-9362-986c908b7ea7"
}
}
» Argument Reference
» Attributes Reference
2
1
The following attributes are exported:
2
2
• id - The ID of the IP address for which the port forwards are created.
• vm_guest_ip - The IP address of the virtual machine that is used
for the port forwarding rule.
» cloudstack_private_gateway
» Example Usage
» Argument Reference
2
3
» Attributes Reference
» Import
» cloudstack_secondary_ipaddress
» Example Usage
resource "cloudstack_secondary_ipaddress" "default"
{ virtual_machine_id = "server-1"
}
» Argument Reference
» Attributes Reference
2
4
• id - The secondary IP address ID.
• ip_address - The IP address that was acquired and associated.
» cloudstack_security_group
» Example Usage
» Argument Reference
» Attributes Reference
» Import
Authorizes and revokes both ingress and egress rulea for a given security group.
» Example Usage
rule {
cidr_list = ["0.0.0.0/0"]
protocol = "tcp"
ports = ["80", "443"]
}
rule {
cidr_list = ["192.168.0.0/24", "192.168.1.0/25"]
protocol = "tcp"
ports = ["80-90", "443"]
traffic_type = "egress"
user_security_group_list = ["group01", "group02"]
}
}
» Argument Reference
» Attributes Reference
» cloudstack_ssh_keypair
» Example Usage
» Argument Reference
2
8
loaded from a file on disk using the file() function. Changing this
forces a new resource to be created.
• project - (Optional) The name or ID of the project to register
this key to. Changing this forces a new resource to be
created.
» Attributes Reference
» cloudstack_static_nat
» Example Usage
» Argument Reference
3
0
» Attributes Reference
» cloudstack_static_route
» Example Usage
» Argument Reference
» Attributes Reference
» cloudstack_template
3
1
» Example Usage
» Argument Reference
3
2
• password_enabled - (Optional) Set to indicate if the template
should be password enabled (defaults false)
• is_ready_timeout - (Optional) The maximum time in seconds
to wait until the template is ready for use (defaults 300
seconds)
» Attributes Reference
» cloudstack_vpc
Creates a VPC.
» Example Usage
Basic usage:
resource "cloudstack_vpc" "default" {
name = "test-vpc"
cidr = "10.0.0.0/16"
vpc_offering = "Default VPC Offering"
zone = "zone-1"
}
» Argument Reference
3
3
• cidr - (Required) The CIDR block for the VPC. Changing this
forces a new resource to be created.
• vpc_offering - (Required) The name or ID of the VPC offering
to use for this VPC. Changing this forces a new resource to be
created.
• network_domain - (Optional) The default DNS domain for
networks cre- ated in this VPC. Changing this forces a new
resource to be created.
• project - (Optional) The name or ID of the project to deploy this
instance to. Changing this forces a new resource to be
created.
• zone - (Required) The name or ID of the zone where this disk
volume will be available. Changing this forces a new resource
to be created.
» Attributes Reference
» Import
VPCs can be imported; use <VPC ID> as the import ID. For example:
terraform import cloudstack_vpc.default 84b23264-917a-4712-b8bf-cd7604db43b0
When importing into a project you need to prefix the import ID with
the project name:
terraform import cloudstack_vpc.default my-project/84b23264-917a-4712-b8bf-cd7604db43b0
» cloudstack_vpn_gateway
» Example Usage
Basic usage:
resource "cloudstack_vpn_gateway" "default" {
3
4
vpc_id = "f8141e2f-4e7e-4c63-9362-986c908b7ea7"
}
3
5
» Argument Reference
» Attributes Reference
» Import
» cloudstack_vpn_customer_gateway
» Example Usage
Basic usage:
resource "cloudstack_vpn_customer_gateway" "default" {
name = "test-vpc"
cidr = "10.0.0.0/8"
esp_policy = "aes256-sha1;modp1024"
gateway = "192.168.0.1"
ike_policy = "aes256-sha1;modp1024"
ipsec_psk = "terraform"
}
» Argument Reference
» Attributes Reference
» Import
3
7
» cloudstack_vpn_connection
» Example Usage
Basic usage:
resource "cloudstack_vpn_connection" "default" {
customer_gateway_id = "8dab9381-ae73-48b8-9a3d-c460933ef5f7"
vpn_gateway_id = "a7900060-f8a8-44eb-be15-ea54cf499703"
}
» Argument Reference
» Attributes Reference
3
8