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

Add Group Resource #772

Merged

Conversation

JolisaBrownHashiCorp
Copy link
Contributor

@JolisaBrownHashiCorp JolisaBrownHashiCorp commented Mar 1, 2024

πŸ› οΈ Description

This PR includes changes to implement a groups resource and test coverage. This implementation is dependent on IAM sdk upgrades to grpc-gateway 2 in this PR.

πŸ”— Relevant Links

Jira 🎟️ : Resource: Group - HCPIE-1022

πŸ—οΈ Acceptance tests

  • [ ❌ ] Are there any feature flags that are required to use this functionality?
  • [βœ… ] Have you added an acceptance test for the functionality being added?
  • [βœ… ] Have you run the acceptance tests on this branch?

This implementation is dependent on IAM sdk updates under review in this PR. To test these changes on PRDE, point your local cloud-iam build to the implementation of the checked out branch f-gateway.

Next ensure that an organization level HCP_CLIENT_ID and HCP_CLIENT_SECRET are set in your PRDE environment, as well as the HCP_API_ADDRESS, HCP_AUTH_URL, HCP_PROJECT_ID, and HCP_OAUTH_CLIENT_ID. Set the environment variable HCP_API_TLS to disabled.
Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccGroupResource'     
==> Checking that code complies with gofmt requirements...
golangci-lint run --config ./golangci-config.yml 
TF_ACC=1 go test ./internal/... -v -run=TestAccGroupResource -timeout 360m -parallel=10
?   	github.com/hashicorp/terraform-provider-hcp/internal/clients/iampolicy	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/clients/packerv1	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/clients/packerv2	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/acctest	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/customtypes	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/clients	0.545s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/consul	0.534s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/hcpvalidator	0.496s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/input	0.493s [no tests to run]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/modifiers	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/configbuilder/packerconfig	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testcheck	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/testutils/testclient	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/base	[no test files]
?   	github.com/hashicorp/terraform-provider-hcp/internal/provider/packer/utils/location	[no test files]
=== RUN   TestAccGroupResource
--- PASS: TestAccGroupResource (6.23s)
...

Copy link
Contributor

@itsjaspermilan itsjaspermilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Left some comments for you to take a look at πŸ™‚

internal/provider/iam/resource_group.go Outdated Show resolved Hide resolved
internal/provider/iam/resource_group.go Outdated Show resolved Hide resolved
internal/provider/iam/resource_group.go Outdated Show resolved Hide resolved
internal/provider/iam/resource_group.go Outdated Show resolved Hide resolved
docs/resources/group.md Outdated Show resolved Hide resolved
docs/resources/group.md Outdated Show resolved Hide resolved
docs/resources/group.md Outdated Show resolved Hide resolved
internal/provider/iam/resource_group.go Outdated Show resolved Hide resolved
internal/provider/iam/resource_group.go Outdated Show resolved Hide resolved
Copy link
Contributor

@itsjaspermilan itsjaspermilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this!

internal/provider/iam/resource_group.go Show resolved Hide resolved
examples/resources/hcp_group/resource.tf Outdated Show resolved Hide resolved
@JolisaBrownHashiCorp JolisaBrownHashiCorp changed the title Groups Resource Add Group Resource Mar 13, 2024
@JolisaBrownHashiCorp JolisaBrownHashiCorp merged commit 7ad89d1 into iam-groups-resources-hcpie-1016 Mar 13, 2024
5 checks passed
@JolisaBrownHashiCorp JolisaBrownHashiCorp deleted the group-resource-hcpie-1022 branch March 13, 2024 16:51
squaresurf pushed a commit that referenced this pull request Mar 14, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants