Giter VIP home page Giter VIP logo

Comments (6)

dannyk81 avatar dannyk81 commented on June 1, 2024 1

Yeah, importing for that resource doesn't work I'm afraid.

since it requires a unique method for querying for the membership based on the provided ID.

It shouldn't be too difficult to add, let me try and test something and I'll get back to you.

from terraform-provider-bigip.

DavidGamba avatar DavidGamba commented on June 1, 2024 1

Awesome! That worked 😄 👍 Thanks so much!

terraform import bigip_ltm_pool_attachment.datahub_na-memo_8080--hub-na-memo-tst-01-50v-awstst-pason-com '{"pool": "/Common/datahub_na-memo_8080", "node": "/Common/hub-na-memo-tst-01-50v.awstst.pason.com:8080"}'
bigip_ltm_pool_attachment.datahub_na-memo_8080--hub-na-memo-tst-01-50v-awstst-pason-com: Importing from ID "{\"pool\": \"/Common/datahub_na-memo_8080\", \"node\": \"/Common/hub-na-memo-tst-01-50v.awstst.pason.com:8080\"}"...
bigip_ltm_pool_attachment.datahub_na-memo_8080--hub-na-memo-tst-01-50v-awstst-pason-com: Import complete!
  Imported bigip_ltm_pool_attachment (ID: /Common/datahub_na-memo_8080-/Common/hub-na-memo-tst-01-50v.awstst.pason.com:8080)
bigip_ltm_pool_attachment.datahub_na-memo_8080--hub-na-memo-tst-01-50v-awstst-pason-com: Refreshing state... (ID: /Common/datahub_na-memo_8080-/Common/hu...-memo-tst-01-50v.awstst.pason.com:8080)

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

Any idea when you guys will be releasing a new version of the plugin? I haven't setup my CI environment to use any custom Terraform plugins 😛

It would be great if the docs get updated as well, in particular since this import requires that json format.

from terraform-provider-bigip.

DavidGamba avatar DavidGamba commented on June 1, 2024

When I pull the state from a test pool attachment, I can see that it is using <pool_name>-<node_name>:<port>

                "bigip_ltm_pool_attachment.dgamba-test-pool--dgamba-test-node-1": {
                    "type": "bigip_ltm_pool_attachment",
                    "depends_on": [
                        "bigip_ltm_node.dgamba-test-node-1",
                        "bigip_ltm_pool.dgamba-test-pool"
                    ],
                    "primary": {
                        "id": "/Common/dgamba-test-pool-/Common/dgamba-test-node-1:8080",
                        "attributes": {
                            "id": "/Common/dgamba-test-pool-/Common/dgamba-test-node-1:8080",
                            "node": "/Common/dgamba-test-node-1:8080",
                            "pool": "/Common/dgamba-test-pool"
                        },
                        "meta": {},
                        "tainted": false
                    },
                    "deposed": [],
                    "provider": "provider.bigip"
                },

But importing that way fails...

from terraform-provider-bigip.

dannyk81 avatar dannyk81 commented on June 1, 2024

@DavidGamba give this a try: https://github.com/terraform-providers/terraform-provider-bigip/pull/84

Since the id is a pseudo generated string from two attributes, you need to provide the pool and node as a json input for the import command:

$ terraform import bigip_ltm_pool_attachment.test_attach1 '{"pool": "/Common/test_pool1", "node": "/Common/test_node1:80"}'

Note that pool must be full path (including the partition) and node is full path with the port number.

seems to work well for me:

bigip_ltm_pool_attachment.test_attach1: Importing from ID "{\"pool\": \"/Common/test_pool1\", \"node\": \"/Common/test_node1:80\"}"...
bigip_ltm_pool_attachment.test_attach1: Import complete!
  Imported bigip_ltm_pool_attachment (ID: /Common/test_pool1-/Common/test_node1:80)
bigip_ltm_pool_attachment.test_attach1: Refreshing state... (ID: /Common/test_pool1-/Common/test_node1:80)

Import successful!

terraform show:

bigip_ltm_node.test_node1:
  id = /Common/test_node1
  address = 11.11.11.11
  connection_limit = 0
  dynamic_ratio = 1
  monitor = default
  name = /Common/test_node1
  rate_limit = disabled
  state = user-up
bigip_ltm_pool.test_pool1:
  id = /Common/test_pool1
  allow_nat = yes
  allow_snat = yes
  load_balancing_mode = round-robin
  monitors.# = 1
  monitors.0 = 
  name = /Common/test_pool1
  reselect_tries = 0
  service_down_action = none
  slow_ramp_time = 10
bigip_ltm_pool_attachment.test_attach1:
  id = /Common/test_pool1-/Common/test_node1:80
  node = /Common/test_node1:80
  pool = /Common/test_pool1

from terraform-provider-bigip.

dannyk81 avatar dannyk81 commented on June 1, 2024

Glad that worked out for you @DavidGamba! regarding a release, to be honest I'm waiting for one myself 😅 I'm also using a private build for quite a while now...

@scshitole when can we have a 0.12.1 release? there are a lot of changes pending and it's a PITA to keep maintaining a custom build all the time...

from terraform-provider-bigip.

dannyk81 avatar dannyk81 commented on June 1, 2024

regarding docs, I'll submit a separate PR since that needs to go to the website-stable branch

from terraform-provider-bigip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.