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

Terraform state it's not in line with the code when using eval orgs when creating google_apigee_instance #9324

Comments

@cosmin-constantin-oprea-db
Copy link

cosmin-constantin-oprea-db commented Jun 8, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

0.13.3

Affected Resource(s)

google_apigee_instance

Terraform Configuration Files

resource "google_apigee_instance" "apigee" {
      name                     = name
      location                 = location
      org_id                   = org_id
      disk_encryption_key_name = cryptokey
      display_name             = name
}

Expected Behavior

When the plan was triggered without any change to the google_apigee_instance resource, nothing should force the replacement of the instance.

Actual Behavior

The resource gets replaced every time when a new plan is triggered without any change to impact the resouce because it gets created by default in SLASH_23 range.

Some debug here:

Step #1 - "terraform-plan":   # google_apigee_instance.apigee must be replaced
Step #1 - "terraform-plan": -/+ resource "google_apigee_instance" "apigee" {
Step #1 - "terraform-plan":         disk_encryption_key_name = "disk_encrytion_key_name"
Step #1 - "terraform-plan":         display_name             = "display_name"
Step #1 - "terraform-plan":        host                     = "host"
Step #1 - "terraform-plan":        id                       = "id" -> 
Step #1 - "terraform-plan":         location                 = "location"
Step #1 - "terraform-plan":         name                     = "name"
Step #1 - "terraform-plan":         org_id                   = "org_id"
Step #1 - "terraform-plan":       - peering_cidr_range       = "SLASH_23" -> null # forces replacement
Step #1 - "terraform-plan":        port                     = "port"
Step #1 - "terraform-plan":     }

Steps to Reproduce

Create an apigee instance with eval oraganization, create apigee instance, retry plan as many times as you would want and you'll have the apigee instance recreated.

@edwardmedia
Copy link
Contributor

@cosmin-constantin-oprea-db below is what its api doc specifies about the peering_cidr_range. Are you Evaluation organizations? You may set SLASH_23 for the field in your config to avoid this. Does this make sense?

Optional. Size of the CIDR block range that will be reserved by the instance. PAID organizations support SLASH_16 to SLASH_20 and defaults to SLASH_16. Evaluation organizations support only SLASH_23.

@cosmin-constantin-oprea-db
Copy link
Author

@cosmin-constantin-oprea-db below is what its api doc specifies about the peering_cidr_range. Are you Evaluation organizations? You may set SLASH_23 for the field in your config to avoid this. Does this make sense?

Optional. Size of the CIDR block range that will be reserved by the instance. PAID organizations support SLASH_16 to SLASH_20 and defaults to SLASH_16. Evaluation organizations support only SLASH_23.

@edwardmedia I already tried that, but you will see that this is not possible: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/apigee_instance

peering_cidr_range - (Optional) The size of the CIDR block range that will be reserved by the instance. Possible values are SLASH_16 and SLASH_20.

@edwardmedia
Copy link
Contributor

@cosmin-constantin-oprea-db I see what you meant. Let me add the support for SLASH_23.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.