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 tfe_teams data source #992

Merged

Conversation

isaacmcollins
Copy link
Contributor

Description

This PR adds a new data source tfe_teams which returns a list of all Team names in an Organization and a map of Team names to their respective IDs.

Closes [#913]

Testing plan

  1. Using the config below:
provider "tfe" {}

resource "tfe_team" "foo" {
  name         = "foo"
  organization = "test-org"
}

resource "tfe_team" "bar" {
  name         = "bar"
  organization = "test-org"
}

data "tfe_teams" "teams" {
  organization = "test-org"
}
  1. Should yield the following results:
names = tolist([
    "foo",
    "bar",
])
ids = tomap({
    "foo" = "foo-id"
    "bar" = "bar-id"
})

External links

Output from acceptance tests

$ TESTARGS="-run TestAccTFEWorkspace" make testacc

...

Copy link
Contributor

@Uk1288 Uk1288 left a comment

Choose a reason for hiding this comment

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

Looking good!

to-do: update CHANGELOG.md to indicate addition of the new datasource

website/docs/d/teams.html.markdown Outdated Show resolved Hide resolved
website/docs/d/teams.html.markdown Show resolved Hide resolved
@Uk1288
Copy link
Contributor

Uk1288 commented Aug 11, 2023

Thanks for making the update, am good to proceed once you resolve the conflict in CHANGELOG.md

Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Nice! I smoke tested with multiple pages of teams and ran the tests locally. 👍

@Uk1288 Uk1288 merged commit 27309d8 into hashicorp:main Aug 14, 2023
11 of 17 checks passed
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