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

Datasource vcd_catalog_vapp_template not working for shared catalog with local org users #960

Closed
NilsBusche opened this issue Dec 15, 2022 · 7 comments
Assignees
Labels

Comments

@NilsBusche
Copy link
Contributor

Terraform Version

Terraform v1.3.5
on linux_amd64
+ provider registry.terraform.io/vmware/vcd v3.8.1

Affected Resource(s)

  • Data source vcd_catalog_vapp_template

Terraform Configuration Files

data "vcd_catalog" "catalog" {
  org  = "ORG0001"
  name = "catalog-abc"
}

data "vcd_catalog_vapp_template" "vapp_template" {
  org        = "ORG0001"
  catalog_id = data.vcd_catalog.catalog.id
  name       = "template-123"
}

Expected Behavior

The vApp template in the shared catalog should be found and the data source should return its attributes.

Actual Behavior

Error: Unable to find vApp Template: error retrieving Org: error retrieving Org ORG0001: [ENF] entity not found

Steps to Reproduce

  1. terraform apply

User Access rights

The user is a local org user.

Important Factoids

Executing the same with a user with provider access rights works as expected. So it seems an issue related to access rights.

References

@martijnhazebroek
Copy link

+1

Submitted #961 because although it is almost identical the error is not the exact same.

@dataclouder
Copy link
Contributor

Hi @martijnhazebroek
I have submitted PR #972 to fix this issue. Would you be able to build a provider out of this branch and try your use case?

@dataclouder dataclouder added the bug label Jan 9, 2023
@dataclouder
Copy link
Contributor

Fixed and merged to main branch

@martijnhazebroek
Copy link

Hi @martijnhazebroek
I have submitted PR #972 to fix this issue. Would you be able to build a provider out of this branch and try your use case?

Any instructions on how to build for windows_amd64?

@dataclouder
Copy link
Contributor

dataclouder commented Jan 10, 2023

You need to have Go 1.19 installed, go to the top of the repository and run :

cd terraform-provider-vcd
GOOS=windows GOARCH=amd64 go build -o terraform-provider-vcd_v3.8.2

Then copy the resulting executable into

$HOME/.terraform.d/plugins/registry.terraform.io/vmware/vcd/3.8.2/windows_amd64

@martijnhazebroek
Copy link

martijnhazebroek commented Jan 10, 2023

Thank. Tested, and #961 is solved with PR #972 as well.

Btw, to build for Windows:

$version = "3.8.2"

cd terraform-provider-vcd
$env:GOOS = "windows";$env:GOARCH = "amd64";go build -o terraform-provider-vcd_v$version -f

$target = Join-Path $env:AppData "terraform.d\plugins\registry.terraform.io\vmware\vcd\$version\windows_amd64"

New-Item -ItemType Directory -Path $target -Force
Move-Item -Path "terraform-provider-vcd_v$version" -Destination $target -Force

Go can be installed with: winget install GoLang.Go.1.19

@dataclouder
Copy link
Contributor

Thanks for confirming it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants