2014-12-10 22:20:52 +01:00
|
|
|
---
|
|
|
|
layout: "cloudstack"
|
|
|
|
page_title: "CloudStack: cloudstack_network"
|
|
|
|
sidebar_current: "docs-cloudstack-resource-network"
|
|
|
|
description: |-
|
|
|
|
Creates a network.
|
|
|
|
---
|
|
|
|
|
2017-04-10 18:15:08 +02:00
|
|
|
# cloudstack_network
|
2014-12-10 22:20:52 +01:00
|
|
|
|
|
|
|
Creates a network.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
Basic usage:
|
|
|
|
|
2017-04-10 18:15:08 +02:00
|
|
|
```hcl
|
2014-12-10 22:20:52 +01:00
|
|
|
resource "cloudstack_network" "default" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "test-network"
|
|
|
|
cidr = "10.0.0.0/16"
|
|
|
|
network_offering = "Default Network"
|
|
|
|
zone = "zone-1"
|
2014-12-10 22:20:52 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) The name of the network.
|
|
|
|
|
|
|
|
* `display_text` - (Optional) The display text of the network.
|
|
|
|
|
|
|
|
* `cidr` - (Required) The CIDR block for the network. Changing this forces a new
|
|
|
|
resource to be created.
|
|
|
|
|
2016-07-06 11:28:13 +02:00
|
|
|
* `gateway` - (Optional) Gateway that will be provided to the instances in this
|
|
|
|
network. Defaults to the first usable IP in the range.
|
|
|
|
|
2016-12-12 10:06:42 +01:00
|
|
|
* `startip` - (Optional) Start of the IP block that will be available on the
|
2016-01-15 21:26:26 +01:00
|
|
|
network. Defaults to the second available IP in the range.
|
2016-01-15 05:58:33 +01:00
|
|
|
|
2016-12-12 10:06:42 +01:00
|
|
|
* `endip` - (Optional) End of the IP block that will be available on the
|
2016-01-15 21:26:26 +01:00
|
|
|
network. Defaults to the last available IP in the range.
|
2016-01-15 05:58:33 +01:00
|
|
|
|
2016-12-12 10:06:42 +01:00
|
|
|
* `network_domain` - (Optional) DNS domain for the network.
|
|
|
|
|
2015-04-29 11:21:37 +02:00
|
|
|
* `network_offering` - (Required) The name or ID of the network offering to use
|
|
|
|
for this network.
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2016-01-15 05:58:33 +01:00
|
|
|
* `vlan` - (Optional) The VLAN number (1-4095) the network will use. This might be
|
2016-12-12 10:06:42 +01:00
|
|
|
required by the Network Offering if specifyVlan=true is set. Only the ROOT
|
2016-01-21 16:52:27 +01:00
|
|
|
admin can set this value.
|
2016-01-15 05:58:33 +01:00
|
|
|
|
2016-06-25 19:42:01 +02:00
|
|
|
* `vpc_id` - (Optional) The VPC ID in which to create this network. Changing
|
2014-12-10 22:20:52 +01:00
|
|
|
this forces a new resource to be created.
|
|
|
|
|
2016-06-24 13:27:05 +02:00
|
|
|
* `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 and
|
|
|
|
swap ACL's, but if you want to detach an attached ACL and revert to using
|
2016-06-25 19:42:01 +02:00
|
|
|
`none`, this will force a new resource to be created. (defaults `none`)
|
2014-12-10 22:20:52 +01:00
|
|
|
|
2015-08-21 16:59:35 +02:00
|
|
|
* `project` - (Optional) The name or ID of the project to deploy this
|
|
|
|
instance to. Changing this forces a new resource to be created.
|
|
|
|
|
2016-03-16 13:15:57 +01:00
|
|
|
* `zone` - (Required) The name or ID of the zone where this network will be
|
2014-12-10 22:20:52 +01:00
|
|
|
available. Changing this forces a new resource to be created.
|
|
|
|
|
2016-12-12 10:06:42 +01:00
|
|
|
* `tags` - (Optional) A mapping of tags to assign to the resource.
|
2016-01-19 18:41:18 +01:00
|
|
|
|
2014-12-10 22:20:52 +01:00
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the network.
|
|
|
|
* `display_text` - The display text of the network.
|
2016-12-12 10:06:42 +01:00
|
|
|
* `network_domain` - DNS domain for the network.
|