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

Unordered proxy names in API products prevent having empty terraform plan #45

Closed
zkauker opened this issue Nov 14, 2019 · 0 comments · Fixed by #46
Closed

Unordered proxy names in API products prevent having empty terraform plan #45

zkauker opened this issue Nov 14, 2019 · 0 comments · Fixed by #46
Assignees

Comments

@zkauker
Copy link
Contributor

zkauker commented Nov 14, 2019

Hi,

When you query resources from Apigee API the string list properties are not returned in the same order you specify them during creation. If we don't take this into consideration in the resource read operation it might happen that our terraform plan will never be empty.

I'm going to send a PR for this in a few minutes - this should be handled on the same way it happens now with the company resource's api_products attribute.

Terraform Version

Terraform v0.12.13

Affected Resource(s)

apigee_product

Terraform Configuration Files

resource "apigee_product" "foo_product" {
   ...
   api_resources = ["/**", "/dummy-resource"]
   proxies = ["${apigee_api_proxy.tf_helloworld.name}", "${apigee_api_proxy.tf_helloworld_2.name}", "${apigee_api_proxy.tf_helloworld_3.name}"]
   scopes = ["READ", "WRITE"]
   environments = ["test", "prod"]
   ...
}

Expected Behavior

Don't detect change if the elements of these lists are the same and only the order differs.

Actual Behavior

When the order of these elements differ from the order specified during creation a change is detected by terraform on the resource, so the plan can never be empty.

Steps to Reproduce

  1. Create an apigee_product with multiple proxies
  2. terraform apply
  3. terraform plan
  4. The plan should be empty, but it is not.
@zkauker zkauker changed the title Unordered proxy names in API products prevents having empty terraform plan Unordered proxy names in API products prevent having empty terraform plan Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant