RavinderReddyF5 / terraform-provider-bigip-version0.12

Terraform resources that can configure F5 BIGIP products
Mozilla Public License 2.0
0 stars 0 forks source link

[CLOSED] bigip_ltm_snat missing functionality #66

Open RavinderReddyF5 opened 4 years ago

RavinderReddyF5 commented 4 years ago

Issue by pkustner Friday Jan 04, 2019 at 19:58 GMT Originally opened as https://github.com/terraform-providers/terraform-provider-bigip/issues/35


within web interface, there is the ability to not only enable/disable snat on ALL VLANS, but to specify which VLAN/Tunnel. I have a very old outbound rule that I'm trying to replicate. My original rule looks like this inside of an scf file.

ltm snat /Common/outbound { origins { 0.0.0.0/0 { } } snatpool /Common/out vlans { /Common/internal } vlans-enabled }

But the closest I can get in this provider is

resource "bigip_ltm_snat" "outbound" { name = "outbound" origins = {name = "0.0.0.0"} snatpool = "/Common/out" vlansdisabled = false }

Any chance on the additional functionality?

RavinderReddyF5 commented 4 years ago

Comment by scshitole Friday Jan 04, 2019 at 22:45 GMT


@pkustner this is what i am getting if i excute

ltm snat outbound {
    origins {
        0.0.0.0/0 { }
    }
    snatpool /Common/out
}

after running
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_ltm_snat.outbound
      id:             <computed>
      name:           "outbound"
      origins.#:      "1"
      origins.0.name: "0.0.0.0"
      snatpool:       "/Common/out"
      vlansdisabled:  "false"

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

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_ltm_snat.outbound: Creating...
  name:           "" => "outbound"
  origins.#:      "0" => "1"
  origins.0.name: "" => "0.0.0.0"
  snatpool:       "" => "/Common/out"
  vlansdisabled:  "" => "false"
bigip_ltm_snat.outbound: Creation complete after 0s (ID: outbound)

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

are which field you need from image image

RavinderReddyF5 commented 4 years ago

Comment by scshitole Friday Jan 04, 2019 at 22:47 GMT


@pkustner so basically you are asking to add vlan list ?

RavinderReddyF5 commented 4 years ago

Comment by pkustner Saturday Jan 05, 2019 at 15:21 GMT


yes

On Fri, Jan 4, 2019, 2:47 PM Sanjay shitole <notifications@github.com wrote:

@pkustner https://github.com/pkustner so basically you are asking to add vlan list ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terraform-providers/terraform-provider-bigip/issues/35#issuecomment-451591775, or mute the thread https://github.com/notifications/unsubscribe-auth/Ap99xHDlQImE8zVXtNf_QI5PNLp5Ibwyks5u_9oTgaJpZM4ZsceO .

RavinderReddyF5 commented 4 years ago

Comment by scshitole Wednesday Jan 09, 2019 at 19:53 GMT


@pkustner fix is in

cat master.tf 
provider "bigip" {
  address = "10.192.74.68"
  username = "admin"
  password = "admin"
}

resource "bigip_ltm_snat" "test-snat" {
 name = "test-snat"
 translation = "/Common/136.1.1.1"
 origins = { name = "2.2.2.2" }
 origins = { name = "3.3.3.3" }
 vlansdisabled = true
 autolasthop = "default"
 mirror = "disabled"
 partition = "Common"
 full_path = "/Common/test-snat"
 vlans = ["test-vlan"]
}
SJC-ML-00028512:terraform-provider-bigip shitole$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

bigip_ltm_snat.test-snat: Refreshing state... (ID: test-snat`)

------------------------------------------------------------------------

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_ltm_snat.test-snat
      id:               <computed>
      autolasthop:      "default"
      full_path:        "/Common/test-snat"
      mirror:           "disabled"
      name:             "test-snat"
      origins.#:        "2"
      origins.0.name:   "2.2.2.2"
      origins.1.name:   "3.3.3.3"
      partition:        "Common"
      translation:      "/Common/136.1.1.1"
      vlans.#:          "1"
      vlans.2119867841: "test-vlan"
      vlansdisabled:    "true"

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

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

SJC-ML-00028512:terraform-provider-bigip shitole$ terraform apply
bigip_ltm_snat.test-snat: Refreshing state... (ID: test-snat`)

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_ltm_snat.test-snat
      id:               <computed>
      autolasthop:      "default"
      full_path:        "/Common/test-snat"
      mirror:           "disabled"
      name:             "test-snat"
      origins.#:        "2"
      origins.0.name:   "2.2.2.2"
      origins.1.name:   "3.3.3.3"
      partition:        "Common"
      translation:      "/Common/136.1.1.1"
      vlans.#:          "1"
      vlans.2119867841: "test-vlan"
      vlansdisabled:    "true"

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

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_ltm_snat.test-snat: Creating...
  autolasthop:      "" => "default"
  full_path:        "" => "/Common/test-snat"
  mirror:           "" => "disabled"
  name:             "" => "test-snat"
  origins.#:        "0" => "2"
  origins.0.name:   "" => "2.2.2.2"
  origins.1.name:   "" => "3.3.3.3"
  partition:        "" => "Common"
  translation:      "" => "/Common/136.1.1.1"
  vlans.#:          "0" => "1"
  vlans.2119867841: "" => "test-vlan"
  vlansdisabled:    "" => "true"
bigip_ltm_snat.test-snat: Creation complete after 0s (ID: test-snat)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
SJC-ML-00028512:terraform-provider-bigip shitole$ terraform destroy
bigip_ltm_snat.test-snat: Refreshing state... (ID: test-snat)

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_ltm_snat.test-snat

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

Do you really want to destroy?
  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_ltm_snat.test-snat: Destroying... (ID: test-snat)
bigip_ltm_snat.test-snat: Destruction complete after 0s

Destroy complete! Resources: 1 destroyed.
SJC-ML-00028512:terraform-provider-bigip shitole$