Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big-IQ bigip_bigiq_as3 resource - Provider produced inconsistent final plan #957

Open
ghazalehca opened this issue Apr 5, 2024 · 1 comment
Labels
Backlog issue will be tracked by JIRA in backlog bug

Comments

@ghazalehca
Copy link

Environment

  • Application Services Version: 3.41
  • Big IP Provider Version: 1.21.0
  • BIG-IP Version: BIG-IP 17.1.0.2 Build 0.0.2 Point Release 2
  • Big-IQ Version: 8.3.0 Build 0.0.118

Summary

Build Terraform plan is producing inaccurate build plan when state is empty (first time building resource).
image
Take Note of the missing as3_json attribute in the build plan above. This happens when the resource is first created.

If you disregard this and try to deploy, you will get the following error:
image

Note: This does not happen in the bigip_as3 resource. Only bigip_bigiq_as3 resource. (See below the build plan from bigip_as3 resource)
image

Severity: Showstopper, no work-around available.

Steps To Reproduce

After careful trouble-shooting, this occurs when there is a reference to a variable that is only “known after apply”… in this case, it’s calling an external resource (phpipam). the as3_json attribute is not getting the “(known after apply)” indicator in the plan that allows the terraform-apply to process successfully.

See attached main.tf in order to see the implementation…

resource "bigip_bigiq_as3" "tenants" {
  #This isn't really a valid AS3 json body, but it doesn't matter, this just simplifies and illustrates the problem
  as3_json         = "{ \"class\": \"AS3\", \"action\": \"deploy\", \"persist\": true, \"dummy\": ${phpipam_first_free_address.snat_ip_next_address_1["HTTPS_TENANT_1"].ip_address} }"
  bigiq_address    = var.bigiq_ip
  bigiq_user       = var.bigiq_user
  bigiq_password   = var.bigiq_pw
  bigiq_token_auth = false
}

if the as3_json argument above has an external value (from another provider), this problem arises.

You must start from an empty terraform state-file (for that resource). If you try to deploy and fail, it seems the 2nd attempt will work.

  1. Observe the following error response:
    image

Expected Behavior

Expected behavior is already coded correctly in the bigip_as3 resource. It's incorrect in the bigiq_bigip_as3 resource.
image

Actual Behavior

It's all above. but I could reiterate.

Summary
Build Terraform plan is producing inaccurate build plan when state is empty (first time building resource).
image

Note: the missing as3_json attribute in the build plan above.

If you disregard this and try to deploy, you will get the following error:
image

Note: This does not happen in the bigip_as3 resource. Only bigip_bigiq_as3 resource. (See below)

image

Problem
After careful trouble-shooting, this occurs when there is a reference to a variable that is only “known after apply”… in this case, it’s calling an external resource (phpipam). the as3_json attribute is not getting the “(known after apply)” indicator in the plan that allows the terraform-apply to process successfully.

See attached main.tf in order to see the implementation… You must start from an empty terraform state-file (for that resource). If you try to deploy and fail, it seems the 2nd attempt will work.

@ghazalehca ghazalehca added the bug label Apr 5, 2024
@pgouband
Copy link
Collaborator

pgouband commented Apr 8, 2024

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1529.

@pgouband pgouband added the Backlog issue will be tracked by JIRA in backlog label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog issue will be tracked by JIRA in backlog bug
Projects
None yet
Development

No branches or pull requests

2 participants