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

use computed for company and dev apps #37

Merged
merged 2 commits into from
Nov 5, 2019
Merged

use computed for company and dev apps #37

merged 2 commits into from
Nov 5, 2019

Conversation

zambien
Copy link
Owner

@zambien zambien commented Nov 2, 2019

Since some recent changes Apigee is now returning apps back from the company and dev APIs even when none are passed in. This causes issues when we use company_apps or developer_apps as the plan will come back expecting to make more changes. For example:

resource "apigee_company" "foo_company" {
   name = "foo_company"
}

resource "apigee_company_app" "foo_company_app" {
   name = "foo_company_app_name"
   company_name = "${apigee_company.foo_company.name}"
}

Would result in the following plan afterwards:

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

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # apigee_company.foo_company will be updated in-place
  ~ resource "apigee_company" "foo_company" {
      ~ apps         = [
          - "foo_company_app_name",
        ]
        display_name = "foo_company"
        id           = "04f5741b-50d4-47db-b02d-6daa459b7863"
        name         = "foo_company"
        status       = "active"
    }

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

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

Setting the type to computed solves the problem but assumes that you are doing all of your management of the company or developer in question in terraform.

Prior to merging this I wanted to get some feedback.

@zambien zambien requested a review from zricethezav November 2, 2019 19:43
@zambien zambien added the bug label Nov 2, 2019
@zambien zambien merged commit d334236 into master Nov 5, 2019
@zambien zambien deleted the apps_computed branch November 5, 2019 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant