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

Feature Request: Add capability to tolerate existing node #84

Open RavinderReddyF5 opened 4 years ago

RavinderReddyF5 commented 4 years ago

Issue by theseao Monday Feb 04, 2019 at 17:51 GMT Originally opened as https://github.com/terraform-providers/terraform-provider-bigip/issues/53


Hello

Is it possible to add capability to the bigip_ltm_node resource to not error out (ignore) when encountering an existing node?

Thanks

RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Monday Feb 04, 2019 at 21:24 GMT


The general behavior in Terraform is that existing resource (created outside of Terraform) should be imported into the state, the error here is actually coming from F5 itself as the same resource you try to provision via Terraform already exists.

If you use terraform import, you can add that node to your state and terraform won't try to provision it again.

RavinderReddyF5 commented 4 years ago

Comment by theseao Monday Feb 04, 2019 at 22:28 GMT


Hello. Understood on both counts.

The scenario we are attempting to address is: a new, single terraform apply of a complete environment with multiple virtual servers that each use the same node or nodes. When the loop for the second virtual server executes, the node is redundant, having been already created during the initial loop.

Upon receiving the “node exists” error from the F5, the code execution terminates. Ideally, we’d address this by using some if/then logic in the TF code that simply skips the node resource after the first loop, but to our knowledge this functionality isn’t yet available.

We have a workaround which simply references a source control branch with the node resource code omitted for creation of subsequent virtual servers. But that’s awkward, at best, and not very sustainable. Thus, our question whether it’s possible to add the capability for the terraform apply to continue despite the node exists error. (Or any other ideas how to address.)

Thank you

From: Danny Kulchinsky notifications@github.com Sent: Monday, February 04, 2019 1:24 PM To: terraform-providers/terraform-provider-bigip terraform-provider-bigip@noreply.github.com Cc: Chris Olsen Chris.Olsen@pgn.com; Author author@noreply.github.com Subject: Re: [terraform-providers/terraform-provider-bigip] Feature Request: Add capability to tolerate existing node (#53)

Please take care when opening links, attachments or responding to this email as it originated outside of PGE.

The general behavior in Terraform is that existing resource (created outside of Terraform) should be imported into the state, the error here is actually coming from F5 itself as the same resource you try to provision via Terraform already exists.

If you use terraform import, you can add that node to your state and terraform won't try to provision it again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/terraform-providers/terraform-provider-bigip/issues/53#issuecomment-460418377, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqvUfpKWziLcqSfNXSPcOgBTLE1_Qjzaks5vKKT8gaJpZM4ahtmp.

RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Monday Feb 04, 2019 at 22:49 GMT


It would be easier to understand if you can share your terraform configuration for the relevant bigip resources.

in general, this shouldn't happen - the nodes resource should be created once and later referenced in all the relevant pools (virtual servers don't reference nodes by the way)

On Mon, 4 Feb 2019 at 17:28, theseao notifications@github.com wrote:

Hello. Understood on both counts.

The scenario we are attempting to address is: a new, single terraform apply of a complete environment with multiple virtual servers that each use the same node or nodes. When the loop for the second virtual server executes, the node is redundant, having been already created during the initial loop.

Upon receiving the “node exists” error from the F5, the code execution terminates. Ideally, we’d address this by using some if/then logic in the TF code that simply skips the node resource after the first loop, but to our knowledge this functionality isn’t yet available.

We have a workaround which simply references a source control branch with the node resource code omitted for creation of subsequent virtual servers. But that’s awkward, at best, and not very sustainable. Thus, our question whether it’s possible to add the capability for the terraform apply to continue despite the node exists error. (Or any other ideas how to address.)

Thank you

From: Danny Kulchinsky notifications@github.com Sent: Monday, February 04, 2019 1:24 PM To: terraform-providers/terraform-provider-bigip < terraform-provider-bigip@noreply.github.com> Cc: Chris Olsen Chris.Olsen@pgn.com; Author author@noreply.github.com Subject: Re: [terraform-providers/terraform-provider-bigip] Feature Request: Add capability to tolerate existing node (#53)

Please take care when opening links, attachments or responding to this email as it originated outside of PGE.

The general behavior in Terraform is that existing resource (created outside of Terraform) should be imported into the state, the error here is actually coming from F5 itself as the same resource you try to provision via Terraform already exists.

If you use terraform import, you can add that node to your state and terraform won't try to provision it again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/terraform-providers/terraform-provider-bigip/issues/53#issuecomment-460418377>, or mute the thread< https://github.com/notifications/unsubscribe-auth/AqvUfpKWziLcqSfNXSPcOgBTLE1_Qjzaks5vKKT8gaJpZM4ahtmp>.

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