Skip to content

Commit

Permalink
Chore: Add Sensitive on configuration variables (#156)
Browse files Browse the repository at this point in the history
* Add Sensitive on configuration variables

* Add sensitive in outputs for integration test

Co-authored-by: Omry Hay <[email protected]>
  • Loading branch information
RLRabinowitz and omry-hay committed Oct 24, 2021
1 parent 048f3be commit e92a520
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions env0/data_configuration_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func dataConfigurationVariable() *schema.Resource {
Type: schema.TypeString,
Description: "value stored in the variable",
Computed: true,
Sensitive: true,
},
"is_sensitive": {
Type: schema.TypeBool,
Expand Down
1 change: 1 addition & 0 deletions env0/resource_configuration_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func resourceConfigurationVariable() *schema.Resource {
Type: schema.TypeString,
Description: "value for the configuration variable",
Required: true,
Sensitive: true,
},
"is_sensitive": {
Type: schema.TypeBool,
Expand Down
15 changes: 10 additions & 5 deletions tests/integration/003_configuration_variable/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ data "env0_configuration_variable" "region" {
name = "AWS_DEFAULT_REGION"
}
output "region_value" {
value = data.env0_configuration_variable.region.value
value = data.env0_configuration_variable.region.value
sensitive = true
}
output "region_id" {
value = data.env0_configuration_variable.region.id
Expand All @@ -17,7 +18,8 @@ data "env0_configuration_variable" "region_in_project" {
project_id = data.env0_project.default.id
}
output "region_in_project_value" {
value = data.env0_configuration_variable.region_in_project.value
value = data.env0_configuration_variable.region_in_project.value
sensitive = true
}
output "region_in_project_id" {
value = data.env0_configuration_variable.region_in_project.id
Expand All @@ -33,7 +35,8 @@ data "env0_configuration_variable" "tested1" {
}

output "tested1_value" {
value = data.env0_configuration_variable.tested1.value
value = data.env0_configuration_variable.tested1.value
sensitive = true
}

data "env0_configuration_variable" "tested2" {
Expand All @@ -52,8 +55,10 @@ data "env0_configuration_variable" "tested3" {


output "tested3_enum_1" {
value = data.env0_configuration_variable.tested3.enum[0]
value = data.env0_configuration_variable.tested3.enum[0]
sensitive = true
}
output "tested3_enum_2" {
value = data.env0_configuration_variable.tested3.enum[1]
value = data.env0_configuration_variable.tested3.enum[1]
sensitive = true
}

0 comments on commit e92a520

Please sign in to comment.