Skip to content

Commit

Permalink
Deprecate compute_floatingip APIs (#1708)
Browse files Browse the repository at this point in the history
Deprecate `compute_floatingip` APIs

Summary of the Pull Request
Deprecate resource/opentelekomcloud_floatingip_v2
Deprecate resource/opentelekomcloud_floatingip_associate_v2
Resolves: #1643
PR Checklist

 Refers to: #1643
 Documentation updated.
 Release notes added.

Reviewed-by: Anton Kachurin <katchuring@gmail.com>
Reviewed-by: Vladimir Vshivkov <None>
  • Loading branch information
lego963 committed Apr 25, 2022
1 parent 82b6f8d commit d25aac7
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/resources/compute_floatingip_associate_v2.md
Expand Up @@ -7,6 +7,10 @@ subcategory: "Elastic Cloud Server (ECS)"
Associate a floating IP to an instance. This can be used instead of the
`floating_ip` options in `opentelekomcloud_compute_instance_v2`.

~>
Floating IP compute APIs are marked as discarded in [help center](https://docs.otc.t-systems.com/en-us/api/ecs/en-us_topic_0065817682.html).
Please use `resource/opentelekomcloud_networking_floatingip_associate_v2`

## Example Usage

### Automatically detect the correct network
Expand Down
4 changes: 4 additions & 0 deletions docs/resources/compute_floatingip_v2.md
Expand Up @@ -13,6 +13,10 @@ Floating IPs created with this module will have a bandwidth of 1000Mbit/s,
for manually specifying the bandwidth please use the
[`opentelekomcloud_vpc_eip_v1`](vpc_eip_v1.md) module.

~>
Floating IP compute APIs are marked as discarded in [help center](https://docs.otc.t-systems.com/en-us/api/ecs/en-us_topic_0065817682.html).
Please use `resource/opentelekomcloud_networking_floatingip_v2` or `resource/opentelekomcloud_vpc_eip_v1`.


## Example Usage

Expand Down
31 changes: 31 additions & 0 deletions docs/resources/networking_floatingip_associate_v2.md
Expand Up @@ -10,6 +10,8 @@ where you have a pre-allocated floating IP or are unable to use the

## Example Usage

### Basic FloatingIP associate

```hcl
resource "opentelekomcloud_networking_port_v2" "port_1" {
network_id = "a5bbd213-e1d3-49b6-aed1-9df60ea94b9a"
Expand All @@ -21,6 +23,35 @@ resource "opentelekomcloud_networking_floatingip_associate_v2" "fip_1" {
}
```

### Associate an instance with `port_id`

```hcl
variable "keypair" {}
variable "image_id" {}
variable "network_name" {}
resource "opentelekomcloud_networking_floatingip_v2" "this" {
pool = "admin_external_net"
}
resource "opentelekomcloud_compute_instance_v2" "this" {
name = "example-instance"
image_id = var.image_id
flavor_id = "s2.large.4"
key_pair = var.keypair
security_groups = ["default"]
network {
name = var.network_name
}
}
resource "opentelekomcloud_networking_floatingip_associate_v2" "this" {
floating_ip = opentelekomcloud_networking_floatingip_v2.this.address
port_id = opentelekomcloud_compute_instance_v2.this.network.0.port_id
}
```

## Argument Reference

The following arguments are supported:
Expand Down
Expand Up @@ -24,10 +24,13 @@ func ResourceComputeFloatingIPAssociateV2() *schema.Resource {
CreateContext: resourceComputeFloatingIPAssociateV2Create,
ReadContext: resourceComputeFloatingIPAssociateV2Read,
DeleteContext: resourceComputeFloatingIPAssociateV2Delete,

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

DeprecationMessage: "Please use `opentelekomcloud_networking_floatingip_associate_v2` resource instead.",

Schema: map[string]*schema.Schema{
"region": {
Type: schema.TypeString,
Expand Down
Expand Up @@ -28,6 +28,8 @@ func ResourceComputeFloatingIPV2() *schema.Resource {
StateContext: schema.ImportStatePassthroughContext,
},

DeprecationMessage: "Please use `opentelekomcloud_networking_floatingip_v2` or `opentelekomcloud_vpc_eip_v1` resources instead",

Schema: map[string]*schema.Schema{
"region": {
Type: schema.TypeString,
Expand Down
4 changes: 4 additions & 0 deletions releasenotes/notes/compute-floatingips-59c3c84cc13731e1.yaml
@@ -0,0 +1,4 @@
---
deprecations:
- |
**[ECS]** ``resource/opentelekomcloud_compute_floatingip_v2`` and ``resource/opentelekomcloud_compute_floatingip_associate_v2`` APIs are marked as discarded in `documentation <https://docs.otc.t-systems.com/en-us/api/ecs/en-us_topic_0065817682.html>`__ (`#1708 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/1708>`__)

0 comments on commit d25aac7

Please sign in to comment.