Skip to content

Commit

Permalink
provider/openstack: extend docs with info about fixed ips and make fi…
Browse files Browse the repository at this point in the history
…xed ips attrs required
  • Loading branch information
Kirill Shirinkin committed Nov 5, 2015
1 parent b19ba7a commit 69f06c1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ func TestAccNetworkingV2Network_fullstack(t *testing.T) {
admin_state_up = "true"
security_groups = ["${openstack_compute_secgroup_v2.foo.id}"]
depends_on = ["openstack_networking_subnet_v2.foo"]
fixed_ips {
"subnet_id" = "008ba151-0b8c-4a67-98b5-0d2b87666062"
"ip_address" = "172.24.4.2"
}
}
resource "openstack_compute_instance_v2" "foo" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ func resourceNetworkingPortV2() *schema.Resource {
Schema: map[string]*schema.Schema{
"subnet_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Required: true,
},
"ip_address": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Required: true,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestAccNetworkingV2Port_basic(t *testing.T) {
admin_state_up = "true"
fixed_ips {
ip_address = "192.168.0.0"
subnet_id = "008ba151-0b8c-4a67-98b5-0d2b87666062"
}
}`, region, region)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ resource "openstack_networking_port_v2" "port_1" {
admin_state_up = "true"
security_groups = ["${openstack_compute_secgroup_v2.secgroup_1.id}"]
depends_on = ["openstack_networking_subnet_v2.subnet_1"]
fixed_ips {
"subnet_id" = "008ba151-0b8c-4a67-98b5-0d2b87666062"
"ip_address" = "172.24.4.2"
}
}
resource "openstack_compute_instance_v2" "instance_1" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ The following arguments are supported:
* `device_id` - (Optional) The ID of the device attached to the port. Changing this
creates a new port.

* `fixed_ips` - (Optional) An array of desired IPs for this port.


The `fixed_ips` block supports:

* `subnet_id` - (Required) Subnet in which to allocate IP address for
this port.

* `ip_address` - (Required) IP address desired in the subnet for this
port.

## Attributes Reference

The following attributes are exported:
Expand Down

0 comments on commit 69f06c1

Please sign in to comment.