Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eip_id argument to cce_node #380

Merged
merged 1 commit into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions huaweicloud/resource_huaweicloud_cce_node_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,19 @@ func resourceCCENodeV3() *schema.Resource {
}},
},
"eip_ids": {
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
ConflictsWith: []string{"eip_id"},
Deprecated: "use eip_id instead",
},
"eip_id": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ConflictsWith: []string{"eip_ids"},
},
"eip_count": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -280,6 +288,9 @@ func resourceCCERootVolume(d *schema.ResourceData) nodes.VolumeSpec {
return nics
}
func resourceCCEEipIDs(d *schema.ResourceData) []string {
if v, ok := d.GetOk("eip_id"); ok {
return []string{v.(string)}
}
rawID := d.Get("eip_ids").(*schema.Set)
id := make([]string, rawID.Len())
for i, raw := range rawID.List() {
Expand Down
2 changes: 1 addition & 1 deletion huaweicloud/resource_huaweicloud_cce_node_v3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ resource "huaweicloud_cce_node_v3" "test" {
}

// Assign existing EIP
eip_ids = [huaweicloud_vpc_eip_v1.test.id]
eip_id = huaweicloud_vpc_eip_v1.test.id
}
`, testAccCCENodeV3_Base(rName), rName)
}
7 changes: 4 additions & 3 deletions website/docs/r/cce_node_v3.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ description: |-
Add a node to a container cluster.
---


# huaweicloud_cce_node_v3
Add a node to a container cluster.

Expand Down Expand Up @@ -61,10 +60,12 @@ The following arguments are supported:

* `subnet_id` - (Optional) The ID of the subnet to which the NIC belongs. Changing this parameter will create a new resource.

* `eip_ids` - (Optional) List of existing elastic IP IDs. Changing this parameter will create a new resource.
* `eip_id` - (Optional) The ID of the EIP. Changing this parameter will create a new resource.

* `eip_ids` - (Deprecated) This has been deprecated, use eip_id instead. List of existing elastic IP IDs. Changing this parameter will create a new resource.

**Note:**
If the eip_ids parameter is configured, you do not need to configure the bandwidth parameters: iptype, bandwidth_charge_mode, bandwidth_size and share_type.
If the eip_id parameter is configured, you do not need to configure the bandwidth parameters: iptype, bandwidth_charge_mode, bandwidth_size and share_type.

* `iptype` - (Optional) Elastic IP type. Default is 5_bgp. Changing this parameter will create a new resource.

Expand Down