terraform-provider-bigip: big_ltm_virtual_server does not work with IPv6 address

This issue was originally opened by @zx1986 as hashicorp/terraform#24747. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Using Kubernetes executor with image hashicorp/terraform:0.12.24 ...
* provider.bigip: version = "~> 1.1"

Terraform Configuration Files

resource "bigip_ltm_virtual_server" "vs" {
   pool        = "/Common/tf_pool_name"
   name        = "/Common/tf_vs_80"
   destination = "aaaa:b034:1001:700:xxxx:xxxx:xxxx:xxxx"
   port        = 80
 }

Debug Output

Crash Output

Error: A port number or service name is missing for "aaaa:b034:1001:700:xxxx:yyyy:zzzz:xxxx:80". Please specify a port number or service name using the syntax 
"aaaa:b034:1001:700:xxxx:yyyy:zzzz:xxxx:80.<port>".

 on main.tf line 53, in resource "bigip_ltm_virtual_server" "vs":
  53: resource "bigip_ltm_virtual_server" "vs" {

Expected Behavior

Create an Virtual Server with IPv6 destination.

Actual Behavior

Apply failed.

Steps to Reproduce

  1. terraform init
  2. terraform apply

Additional Context

@dan-kriz had told: BigIP for ipv6 is expecting the separator for the port to be a dot (.) instead of a colon (:)

References

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15

Most upvoted comments

please verify with v1.2.0, open new issue if u see any issues

@papineni87 oh! thank you! Maybe I should try to use F5Networks/terraform-provider-bigip provider instead the official one. But when this feature will be merge into official provider? It’s mid of 2020 now, I think IPv6 is not a new thing any more …

AS3 is not the Terraform way at all.

@papineni87 F5Networks/terraform-provider-bigip build failed on my Mac …

➜ make build
==> Checking that code complies with gofmt requirements...
go install
# github.com/terraform-providers/terraform-provider-bigip/bigip
bigip/provider.go:130:5: cfg.UserAgent undefined (type *bigip.BigIP has no field or method UserAgent)
bigip/resource_bigip_as3.go:69:25: client.GetTenantList undefined (type *bigip.BigIP has no field or method GetTenantList)
bigip/resource_bigip_as3.go:74:24: client.AddTeemAgent undefined (type *bigip.BigIP has no field or method AddTeemAgent)
bigip/resource_bigip_as3.go:77:34: client.PostAs3Bigip undefined (type *bigip.BigIP has no field or method PostAs3Bigip)
bigip/resource_bigip_as3.go:91:24: client.GetAs3 undefined (type *bigip.BigIP has no field or method GetAs3)
bigip/resource_bigip_as3.go:114:24: client.GetAs3 undefined (type *bigip.BigIP has no field or method GetAs3)
bigip/resource_bigip_as3.go:132:25: client.GetTenantList undefined (type *bigip.BigIP has no field or method GetTenantList)
bigip/resource_bigip_as3.go:139:29: client.TenantDifference undefined (type *bigip.BigIP has no field or method TenantDifference)
bigip/resource_bigip_as3.go:141:18: client.DeleteAs3Bigip undefined (type *bigip.BigIP has no field or method DeleteAs3Bigip)
bigip/resource_bigip_as3.go:151:24: client.AddTeemAgent undefined (type *bigip.BigIP has no field or method AddTeemAgent)
bigip/resource_bigip_as3.go:151:24: too many errors
make: *** [build] Error 2

@zx1986 As AS3 is the primary API for BIG-IP going forward, we are working stabilize more on as3 resource. and we also provided fix for #278

Fixes for Issues #278 and #254 will be available with terraform bigip provider v1.2.0 which will be available for public by May11th.

the AS3 not work too because of resouceBigipAs3Read failed … refs: #254 (comment)

@papineni87 @RavinderReddyF5

@zx1986 As i mentioned in previous comment this issue #254 fixes available in https://github.com/F5Networks/terraform-provider-bigip master branch

Verified issue not seen by building image locally and running. these changes will be available in upcoming release as planned by next week. you can always reach us for any issues you are seeing with provider, we are always help you. please reach us with our slack channel :https://github.com/F5Networks/terraform-provider-bigip#community-help

terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # bigip_as3.as3-example will be created
  + resource "bigip_as3" "as3-example" {
      + as3_json    = jsonencode(
            {
              + action      = "deploy"
              + class       = "AS3"
              + declaration = {
                  + class         = "ADC"
                  + id            = "1baa209b-a558-1131-0719-e97593f7d94b"
                  + label         = "terraform"
                  + remark        = "IPv6 Test"
                  + sample_ipv6   = {
                      + class                  = "Tenant"
                      + defaultRouteDomain     = 0
                      + tf_vs_super_kubernetes = {
                          + class                           = "Application"
                          + serviceMain                     = {
                              + class            = "Service_HTTP"
                              + pool             = "tf_pool_devops_super-kubernetes"
                              + virtualAddresses = [
                                  + "2002::10",
                                  + "2003::10",
                                ]
                            }
                          + template                        = "http"
                          + tf_pool_devops_super-kubernetes = {
                              + class             = "Pool"
                              + loadBalancingMode = "round-robin"
                              + members           = [
                                  + {
                                      + serverAddresses = [
                                          + "192.168.101.108",
                                          + "192.168.101.109",
                                          + "192.168.101.110",
                                          + "192.168.101.111",
                                          + "192.168.101.112",
                                        ]
                                      + servicePort     = 80
                                    },
                                ]
                              + monitors          = [
                                  + "icmp",
                                  + "http",
                                ]
                            }
                        }
                    }
                  + schemaVersion = "3.0.0"
                }
              + persist     = true
            }
        )
      + id          = (known after apply)
      + tenant_list = (known after apply)
      + tenant_name = "as3"
    }

Plan: 1 to add, 0 to change, 0 to destroy.


Warning: "tenant_name": [DEPRECATED] this attribute is no longer in use

  on bigip_as3.tf line 27, in resource "bigip_as3" "as3-example":
  27: resource "bigip_as3"  "as3-example" {


Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

bigip_as3.as3-example: Creating...
bigip_as3.as3-example: Creation complete after 9s [id=sample_ipv6]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.


terraform show

# bigip_as3.as3-example:
resource "bigip_as3" "as3-example" {
    as3_json    = jsonencode(
        {
            action      = "deploy"
            class       = "AS3"
            declaration = {
                class         = "ADC"
                id            = "1baa209b-a558-1131-0719-e97593f7d94b"
                label         = "terraform"
                remark        = "IPv6 Test"
                sample_ipv6   = {
                    class                  = "Tenant"
                    defaultRouteDomain     = 0
                    tf_vs_super_kubernetes = {
                        class                           = "Application"
                        serviceMain                     = {
                            class            = "Service_HTTP"
                            pool             = "tf_pool_devops_super-kubernetes"
                            virtualAddresses = [
                                "2002::10",
                                "2003::10",
                            ]
                        }
                        template                        = "http"
                        tf_pool_devops_super-kubernetes = {
                            class             = "Pool"
                            loadBalancingMode = "round-robin"
                            members           = [
                                {
                                    serverAddresses = [
                                        "192.168.101.108",
                                        "192.168.101.109",
                                        "192.168.101.110",
                                        "192.168.101.111",
                                        "192.168.101.112",
                                    ]
                                    servicePort     = 80
                                },
                            ]
                            monitors          = [
                                "icmp",
                                "http",
                            ]
                        }
                    }
                }
                schemaVersion = "3.0.0"
            }
            persist     = true
        }
    )
    id          = "sample_ipv6"
    tenant_list = "sample_ipv6"
    tenant_name = "as3"
}



terraform destroy

bigip_as3.as3-example: Refreshing state... [id=sample_ipv6]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # bigip_as3.as3-example will be destroyed
  - resource "bigip_as3" "as3-example" {
      - as3_json    = jsonencode(
            {
              - action      = "deploy"
              - class       = "AS3"
              - declaration = {
                  - class         = "ADC"
                  - id            = "1baa209b-a558-1131-0719-e97593f7d94b"
                  - label         = "terraform"
                  - remark        = "IPv6 Test"
                  - sample_ipv6   = {
                      - class                  = "Tenant"
                      - defaultRouteDomain     = 0
                      - tf_vs_super_kubernetes = {
                          - class                           = "Application"
                          - serviceMain                     = {
                              - class            = "Service_HTTP"
                              - pool             = "tf_pool_devops_super-kubernetes"
                              - virtualAddresses = [
                                  - "2002::10",
                                  - "2003::10",
                                ]
                            }
                          - template                        = "http"
                          - tf_pool_devops_super-kubernetes = {
                              - class             = "Pool"
                              - loadBalancingMode = "round-robin"
                              - members           = [
                                  - {
                                      - serverAddresses = [
                                          - "192.168.101.108",
                                          - "192.168.101.109",
                                          - "192.168.101.110",
                                          - "192.168.101.111",
                                          - "192.168.101.112",
                                        ]
                                      - servicePort     = 80
                                    },
                                ]
                              - monitors          = [
                                  - "icmp",
                                  - "http",
                                ]
                            }
                        }
                    }
                  - schemaVersion = "3.0.0"
                }
              - persist     = true
            }
        ) -> null
      - id          = "sample_ipv6" -> null
      - tenant_list = "sample_ipv6" -> null
      - tenant_name = "as3" -> null
    }

Plan: 0 to add, 0 to change, 1 to destroy.


Warning: "tenant_name": [DEPRECATED] this attribute is no longer in use

  on bigip_as3.tf line 27, in resource "bigip_as3" "as3-example":
  27: resource "bigip_as3"  "as3-example" {


Do you really want to destroy all resources?
  Terraform will destroy all your managed infrastructure, as shown above.
  There is no undo. Only 'yes' will be accepted to confirm.

  Enter a value: yes

bigip_as3.as3-example: Destroying... [id=sample_ipv6]
bigip_as3.as3-example: Destruction complete after 5s

Destroy complete! Resources: 1 destroyed.

IPv6 is possible through the AS3 resource currently. I would recommend utilizing this when possible as it has a declarative app/service approach vs per object.

Tracking this via TER-309 internally.