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

Apigee google_apigee_shared_flow requires org_name instead of org_id #14086

Assignees
Labels

Comments

@georgy-varghese
Copy link

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

Terraform Version: 1.4.2
provider registry.terraform.io/hashicorp/google: v4.58.0

Affected Resource(s)

  • google_apigee_sharedflow

Terraform Configuration Files

  • Using org_id
data "archive_file" "this" {
  type        = "zip"
  source_dir  = "${path.module}/sharedflows/sf-flow"
  output_path = "${path.module}/sharedflows/sf-flow.zip"
}

resource "google_apigee_sharedflow" "sharedflow" {
  name           = "sharedflow"
  org_id         = module.apigee.org_id
  config_bundle  = data.archive_file.this.output_path 
  detect_md5hash = data.archive_file.this.output_md5
}

Note: module.apigee is sourced from here

Output

│   <p><b>404.</b> <ins>That’s an error.</ins>                                                                                                                                                                      
│   <p>The requested URL <code>/v1/organizations/organizations/<org_name>/sharedflows?name=<shareflow_name>&amp;action=import</code> was not found on this server.  <ins>That’s all we know.</ins>
│ 
│ 
│   with google_apigee_sharedflow.pre_flowhook,
│   on apigee-shared-flows.tf line 7, in resource "google_apigee_sharedflow" "sharedflow":              
│    7: resource "google_apigee_sharedflow" "sharedflow" {                                              
│ 

Looking at the code here, it seems it only needs org_name as below.

resource "google_apigee_sharedflow" "sharedflow" {
  name           = "sharedflow"
  org_id         = module.apigee.org_name
  config_bundle  = data.archive_file.this.output_path 
  detect_md5hash = data.archive_file.this.output_md5
}

Debug Output

Panic Output

Expected Behavior

  • Resource should be created using org_id, or
  • Documentation (and probably parameter name) should be updated to org_name

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@edwardmedia edwardmedia self-assigned this Mar 24, 2023
@edwardmedia
Copy link
Contributor

edwardmedia commented Mar 25, 2023

@georgy-varghese here is where org_id defined. Below is a test running every day.

https://github.com/hashicorp/terraform-provider-google/blob/main/google/resource_apigee_sharedflow_test.go#L111

Can you check if the test config works for you?

@georgy-varghese
Copy link
Author

@edwardmedia, thanks for the quick response.

Resource google_project.project.project_id in the test, provides the organization name, which is different to the format in docs and org_id.

  • org_name = <org_name>
    vs
  • org_id = organizations/<org_name>

@edwardmedia
Copy link
Contributor

@georgy-varghese I do see what you mean now. Here is where the api that defines the format of parent, not the org_id. Agreed we need to update the doc to match the reality.

@edwardmedia edwardmedia assigned zli82016 and unassigned edwardmedia Mar 27, 2023
@zli82016
Copy link
Collaborator

zli82016 commented Mar 28, 2023

Hello, @georgy-varghese , can you please list the value of module.apigee.org_id and module.apigee.org_name? Thanks.

I want to double check of the values here.

@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 Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.