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 nonsensitive_values field to tfe_outputs #711

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

Uk1288
Copy link
Contributor

@Uk1288 Uk1288 commented Dec 7, 2022

Description

Added nonsensitive_values attribute to tfe_outputs datasource to allow retrieving the current non-sensitive outputs of a given workspace.

Remember to:

Testing plan

  1. Create a workspace that has both sensitive and non-sensitive outputs
  2. Use tfe_outputs datasource like below to attempt to retrieve outputs
data "tfe_outputs" "example" {
  organization = "org"
  workspace = "prod-app"
}

output "example" {
  value = data.tfe_outputs.example.values.foo
}
  1. Retrieval should error unless you use the nonsensitive function
  2. After these changes, use nonsensitive_values to retrieve all non-sensitive values. For instance if a workspace has non-sensitive output value foo
data "tfe_outputs" "example" {
  organization = "org"
  workspace = "prod-app"
}

output "example" {
  value = data.tfe_outputs.example.nonsensitive_values.foo
}

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See TESTS.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTFEOutputs" make testacc

=== RUN   TestAccTFEOutputs
--- PASS: TestAccTFEOutputs (18.51s)
=== RUN   TestAccTFEOutputs_ReadAllNonSensitiveValues
--- PASS: TestAccTFEOutputs_ReadAllNonSensitiveValues (17.74s)
=== RUN   TestAccTFEOutputs_emptyOutputs
--- PASS: TestAccTFEOutputs_emptyOutputs (13.29s)
PASS
ok  

Doc Preview:

Screen Shot 2022-12-07 at 12 19 12 PM

Screen Shot 2022-12-07 at 12 19 20 PM

@Uk1288 Uk1288 requested a review from a team as a code owner December 7, 2022 14:35
@Uk1288 Uk1288 force-pushed the uk1288-add-nonsensitive_values-field-to-outputs branch from 41f720d to 60ff514 Compare December 7, 2022 14:39
@brandonc brandonc linked an issue Dec 7, 2022 that may be closed by this pull request
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.

It works!

@Uk1288 Uk1288 merged commit 3043dae into main Dec 8, 2022
@Uk1288 Uk1288 deleted the uk1288-add-nonsensitive_values-field-to-outputs branch December 8, 2022 17:12
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.

tfe_nonsensitive_outputs data source
2 participants