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_projects data source #1511

Merged
merged 4 commits into from
Oct 31, 2024
Merged

Conversation

netramali
Copy link
Contributor

@netramali netramali commented Oct 30, 2024

Can be used to retrieve all projects in an organization.

Description

Add tfe_projects data source for retrieving organization projects.

image

Testing plan

Create and retrieve projects with the new data source.

Example configuration
resource "tfe_organization" "organization" {
  name  = "random-org"
  email = "[email protected]"
}

resource "tfe_project" "project1" {
  name         = "project1"
  description  = "Project 1"
  organization = tfe_organization.organization.name
}

resource "tfe_project" "project2" {
  name        = "project2"
  description = "Project 2"
  organization = tfe_organization.organization.name
}

resource "tfe_project" "project3" {
  name        = "project3"
  description = "Project 3"
  organization = tfe_organization.organization.name
}

data tfe_projects "all" {
  organization = tfe_organization.organization.name
}

External links

Output from acceptance tests

/opt/homebrew/opt/go/libexec/bin/go tool test2json -t /Users/netra.mali/Library/Caches/JetBrains/GoLand2023.2/tmp/GoLand/___7TestAccTFEProjectsDataSource_basic_in_github_com_hashicorp_terraform_provider_tfe_internal_provider.test -test.v -test.paniconexit0 -test.run ^\QTestAccTFEProjectsDataSource_basic\E$
=== RUN   TestAccTFEProjectsDataSource_basic
2024/10/31 12:58:45 [DEBUG] Configuring client for host "app.staging.terraform.io"
2024/10/31 12:58:45 [WARN] Unable to read CLI config or credentials file /Users/netra.mali/.terraformrc: open /Users/netra.mali/.terraformrc: no such file or directory
2024/10/31 12:58:45 [DEBUG] Service discovery for app.staging.terraform.io at https://app.staging.terraform.io/.well-known/terraform.json
--- PASS: TestAccTFEProjectsDataSource_basic (5.01s)
PASS

Process finished with the exit code 0
/opt/homebrew/opt/go/libexec/bin/go tool test2json -t /Users/netra.mali/Library/Caches/JetBrains/GoLand2023.2/tmp/GoLand/___1TestAccTFEProjectsDataSource_basicNoProjects_in_github_com_hashicorp_terraform_provider_tfe_internal_provider.test -test.v -test.paniconexit0 -test.run ^\QTestAccTFEProjectsDataSource_basicNoProjects\E$
=== RUN   TestAccTFEProjectsDataSource_basicNoProjects
2024/10/31 12:58:20 [DEBUG] Configuring client for host "app.staging.terraform.io"
2024/10/31 12:58:20 [WARN] Unable to read CLI config or credentials file /Users/netra.mali/.terraformrc: open /Users/netra.mali/.terraformrc: no such file or directory
2024/10/31 12:58:20 [DEBUG] Service discovery for app.staging.terraform.io at https://app.staging.terraform.io/.well-known/terraform.json
--- PASS: TestAccTFEProjectsDataSource_basicNoProjects (3.11s)
PASS

Process finished with the exit code 0

@netramali netramali marked this pull request as ready for review October 30, 2024 19:58
@netramali netramali requested a review from a team as a code owner October 30, 2024 19:58
Copy link

hashicorp-cla-app bot commented Oct 31, 2024

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


2 out of 3 committers have signed the CLA.

  • tdevelioglu
  • netramali
  • “Netra

“Netra seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

Copy link
Contributor

@ctrombley ctrombley left a comment

Choose a reason for hiding this comment

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

🚢

@netramali netramali merged commit c61a6b6 into main Oct 31, 2024
4 of 5 checks passed
@netramali netramali deleted the tdevelioglu/add_data_source_projects branch October 31, 2024 17:14
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