-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support for HCP Groups #787
Conversation
Groups Data Source
* add groups data source * run go generate * remove redundant import name * add check for no inputs
* define group resource * group resource implementation * group resource test coverage * syntax, validation tweaks * add docs - group resource * add docs - group data source * revise schema constraints * cleanup docs/comments * add pre-destroy check to test coverage/update docs * create group before fetching in datasource test coverage
ca6b547
to
33fdfb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding minor doc comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with a local version of the provider using the following terraform file:
terraform {
required_providers {
hcp = {
source = "localhost/providers/hcp"
version = "0.0.1"
}
}
}
provider "hcp" {}
data "hcp_user_principal" "me" {
user_id = <REDACTED_USER_ID>
}
resource "hcp_group" "cool-group" {
display_name = "Cool Group"
description = "Created with Terraform"
}
data "hcp_group" "another-cool-group" {
resource_name = <REDACTED_RESOURCE_NAME>
}
resource "hcp_group_members" "group-members-1" {
group = hcp_group.cool-group.resource_name
members = [
data.hcp_user_principal.me.user_id
]
}
resource "hcp_group_members" "group-members-2" {
group = data.hcp_group.another-cool-group.resource_name
members = [
data.hcp_user_principal.me.user_id
]
}
Before terraform apply

After terraform apply

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubber stamping.
Draft Status
This PR is in a Draft status until we address a blocking bug with the way the Go client wants to use the Update Group API in IAM. See a more detailed write up here: https://docs.google.com/document/d/1iwKzeaQ9ENUmangKSLInPH0tUdqjs0QFpncuOPG4yXU/edit
🛠️ Description
To support TFC customers using terraform to configure their orgs, HCP requires some identity resources to be exposed in the HCP TF Provider like Groups, Group Memberships, Principal Datasource.
This PR adds the following:
🏗️ Acceptance tests
Output from acceptance testing:
This test is failing while we fix the IAM Update Group API
👀 Review Suggestions
Review of this PR would be easiest to review the changes as a whole rather than commit by commit. This is because there are multiple engineers working on this PR and we don't want to rewrite history out from each other. We will squash when it's time to merge.