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

[vpc_eip_v1] refactoring tags #830

Merged
merged 4 commits into from
Feb 8, 2021
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
15 changes: 13 additions & 2 deletions docs/resources/vpc_eip_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,24 @@ resource "opentelekomcloud_vpc_eip_v1" "eip_1" {

The following arguments are supported:

* `region` - (Optional) The region in which to obtain the V1 Networking client.
If omitted, the `region` argument of the provider is used. Changing this
creates a new service.

* `publicip` - (Required) The elastic IP address object.

* `bandwidth` - (Required) The bandwidth object.

The `publicip` block supports:

* `type` - (Required) The value must be a type supported by [the system](https://docs.otc.t-systems.com/api/eip/eip_api_0001.html#eip_api_0001__en-us_topic_0201534274_table4491214). The value can be `5_bgp` and `5_mailbgp`. Changing this creates a new eip.
* `type` - (Required) The value must be a type supported by [the system](https://docs.otc.t-systems.com/api/eip/eip_api_0001.html#eip_api_0001__en-us_topic_0201534274_table4491214).
The value can be `5_bgp` and `5_mailbgp`. Changing this creates a new eip.

* `ip_address` - (Optional) The value must be a valid IP address in the available
IP address segment. Changing this creates a new eip.

* `port_id` - (Optional) The port id which this eip will associate with. If the value
is "" or this not specified, the eip will be in unbind state.
is `""` or this not specified, the eip will be in unbind state.

The `bandwidth` block supports:

Expand All @@ -54,10 +59,14 @@ The `bandwidth` block supports:
by traffic and this field is specified, then you are charged by traffic for elastic
IP addresses. Changing this creates a new eip.

* `tags` - (Optional) Tags key/value pairs to associate with the eip.

## Attributes Reference

The following attributes are exported:

* `region` - See Argument Reference above.

* `publicip/type` - See Argument Reference above.

* `publicip/ip_address` - See Argument Reference above.
Expand All @@ -72,6 +81,8 @@ The following attributes are exported:

* `bandwidth/charge_mode` - See Argument Reference above.

* `tags` - See Argument Reference above.

## Import

EIPs can be imported using the `id`, e.g.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/jen20/awspolicyequivalence v1.1.0
github.com/jinzhu/copier v0.2.3
github.com/mitchellh/go-homedir v1.1.0
github.com/opentelekomcloud/gophertelekomcloud v0.2.4
github.com/opentelekomcloud/gophertelekomcloud v0.2.5
github.com/unknwon/com v1.0.1
gopkg.in/yaml.v2 v2.4.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/opentelekomcloud/gophertelekomcloud v0.2.4 h1:99NpIf9fR6sn6+WZp8of1es71A76L7F4ECZEx1uTuZc=
github.com/opentelekomcloud/gophertelekomcloud v0.2.4/go.mod h1:pzEP1kduNwv+hrI9R6/DFU/NiX7Kr9NiFjpQ7kJQTsM=
github.com/opentelekomcloud/gophertelekomcloud v0.2.5 h1:jWUbzjOYvk6DfLSsoZebSDNYSZ3ahkjvLy+VUl8JwG0=
github.com/opentelekomcloud/gophertelekomcloud v0.2.5/go.mod h1:pzEP1kduNwv+hrI9R6/DFU/NiX7Kr9NiFjpQ7kJQTsM=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
2 changes: 1 addition & 1 deletion opentelekomcloud/resource_opentelekomcloud_cce_node_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ func resourceCCENodeV3Read(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("error fetching OpenTelekomCloud instance tags: %s", err)
}

tagMap := tagsToMap(resourceTags.Tags)
tagMap := tagsToMap(resourceTags)
// ignore "CCE-Dynamic-Provisioning-Node"
delete(tagMap, "CCE-Dynamic-Provisioning-Node")
if err := d.Set("tags", tagMap); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func resourceDNSPtrRecordV2Read(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error fetching OpenTelekomCloud DNS ptr record tags: %s", err)
}

tagmap := tagsToMap(resourceTags.Tags)
tagmap := tagsToMap(resourceTags)
if err := d.Set("tags", tagmap); err != nil {
return fmt.Errorf("Error saving tags for OpenTelekomCloud DNS ptr record %s: %s", d.Id(), err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func resourceDNSRecordSetV2Read(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("error fetching OpenTelekomCloud DNS record set tags: %s", err)
}

tagmap := tagsToMap(resourceTags.Tags)
tagmap := tagsToMap(resourceTags)
if err := d.Set("tags", tagmap); err != nil {
return fmt.Errorf("error saving tags for OpenTelekomCloud DNS record set %s: %s", recordsetID, err)
}
Expand Down
2 changes: 1 addition & 1 deletion opentelekomcloud/resource_opentelekomcloud_dns_zone_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func resourceDNSZoneV2Read(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error fetching OpenTelekomCloud DNS zone tags: %s", err)
}

tagmap := tagsToMap(resourceTags.Tags)
tagmap := tagsToMap(resourceTags)
if err := d.Set("tags", tagmap); err != nil {
return fmt.Errorf("Error saving tags for OpenTelekomCloud DNS zone %s: %s", d.Id(), err)
}
Expand Down
Loading