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

Adding Data Sources support to some Resources #311

Open
alirezarpi opened this issue Dec 28, 2022 · 1 comment
Open

Adding Data Sources support to some Resources #311

alirezarpi opened this issue Dec 28, 2022 · 1 comment
Labels

Comments

@alirezarpi
Copy link

alirezarpi commented Dec 28, 2022

Hi there,

It would be nice if boundary terraform provide supports data, so like this scenario when they're needed at first we can provide them.

Terraform Version

Terraform v1.3.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/boundary v1.1.2
+ provider registry.terraform.io/hashicorp/random v3.4.3

Your version of Terraform is out of date! The latest version
is 1.3.6. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

Please list the resources as a list, for example:

  • boundary_user
  • boundary_group

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

data "boundary_user" "admin_user" {
  filter {
    name   = "Name"
    values = ["admin"]
  }
}
data "boundary_user" "terraform_user" {
  filter {
    name   = "Name"
    values = ["terraform"]
  }
}

resource "boundary_role" "my_new_org_admin" {
  name           = "new_org_admin"
  scope_id       = boundary_scope.global.id
  grant_scope_id = boundary_scope.my_new_org.id
  grant_strings  = ["id=*;type=*;actions=*"]
  principal_ids  = [data.boundary_user.admin_user.id, data.boundary_user.terraform_user.id]
}

Debug Output

None.

Panic Output

Non

Expected Behavior

It should give me the users data so I can include the IDs in the next resource.

Actual Behavior

Error: Invalid data source
│
│   on 02-scopes.tf line 14, in data "boundary_user" "admin_user":
│   14: data "boundary_user" "admin_user" {
│
│ The provider hashicorp/boundary does not support data source "boundary_user".
│
│ Did you intend to use the managed resource type "boundary_user"? If so, declare this using a "resource" block instead of a "data" block.
╵
╷
│ Error: Invalid data source
│
│   on 02-scopes.tf line 20, in data "boundary_user" "terraform_user":
│   20: data "boundary_user" "terraform_user" {
│
│ The provider hashicorp/boundary does not support data source "boundary_user".
│
│ Did you intend to use the managed resource type "boundary_user"? If so, declare this using a "resource" block instead of a "data" block.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

None

References

None

@psekar psekar added the triage label Jan 11, 2023
@patoarvizu
Copy link

I would also be interested in a boundary_worker data source. The use case is to be able to discover the managed HCP workers to more easily configure multi-hop configurations.

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