Skip to content

Commit

Permalink
provider/openstack: Rename provider to loadbalancer_provider
Browse files Browse the repository at this point in the history
This commit renames provider to loadbalancer_provider in the
openstack_lb_loadbalancer_v2 resource.

It also changes security_group_ids to Computed so default
security groups are added to the state correctly.
  • Loading branch information
jtopjian committed Feb 24, 2017
1 parent 49cca8d commit 3b18512
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func resourceLoadBalancerV2() *schema.Resource {
ForceNew: true,
},

"provider": &schema.Schema{
"loadbalancer_provider": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
Expand All @@ -85,6 +85,7 @@ func resourceLoadBalancerV2() *schema.Resource {
"security_group_ids": &schema.Schema{
Type: schema.TypeSet,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
Expand All @@ -108,7 +109,7 @@ func resourceLoadBalancerV2Create(d *schema.ResourceData, meta interface{}) erro
VipAddress: d.Get("vip_address").(string),
AdminStateUp: &adminStateUp,
Flavor: d.Get("flavor").(string),
Provider: d.Get("provider").(string),
Provider: d.Get("loadbalancer_provider").(string),
}

log.Printf("[DEBUG] Create Options: %#v", createOpts)
Expand Down Expand Up @@ -168,7 +169,7 @@ func resourceLoadBalancerV2Read(d *schema.ResourceData, meta interface{}) error
d.Set("vip_port_id", lb.VipPortID)
d.Set("admin_state_up", lb.AdminStateUp)
d.Set("flavor", lb.Flavor)
d.Set("provider", lb.Provider)
d.Set("loadbalancer_provider", lb.Provider)

// Get any security groups on the VIP Port
if lb.VipPortID != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ resource "openstack_networking_subnet_v2" "subnet_1" {
resource "openstack_lb_loadbalancer_v2" "loadbalancer_1" {
name = "loadbalancer_1"
loadbalancer_provider = "haproxy"
vip_subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
}
`
Expand All @@ -209,6 +210,7 @@ resource "openstack_networking_subnet_v2" "subnet_1" {
resource "openstack_lb_loadbalancer_v2" "loadbalancer_1" {
name = "loadbalancer_1_updated"
loadbalancer_provider = "haproxy"
admin_state_up = "true"
vip_subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The following arguments are supported:
* `flavor` - (Optional) The UUID of a flavor. Changing this creates a new
loadbalancer.

* `provider` - (Optional) The name of the provider. Changing this creates a new
* `loadbalancer_provider` - (Optional) The name of the provider. Changing this creates a new
loadbalancer.

* `security_group_ids` - (Optional) A list of security group IDs to apply to the
Expand All @@ -69,6 +69,6 @@ The following attributes are exported:
* `vip_address` - See Argument Reference above.
* `admin_state_up` - See Argument Reference above.
* `flavor` - See Argument Reference above.
* `provider` - See Argument Reference above.
* `loadbalancer_provider` - See Argument Reference above.
* `security_group_ids` - See Argument Reference above.
* `vip_port_id` - The Port ID of the Load Balancer IP.

0 comments on commit 3b18512

Please sign in to comment.