Skip to content

Commit e92a520

Browse files
Chore: Add Sensitive on configuration variables (#156)
* Add Sensitive on configuration variables * Add sensitive in outputs for integration test Co-authored-by: Omry Hay <[email protected]>
1 parent 048f3be commit e92a520

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

env0/data_configuration_variable.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func dataConfigurationVariable() *schema.Resource {
7171
Type: schema.TypeString,
7272
Description: "value stored in the variable",
7373
Computed: true,
74+
Sensitive: true,
7475
},
7576
"is_sensitive": {
7677
Type: schema.TypeBool,

env0/resource_configuration_variable.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func resourceConfigurationVariable() *schema.Resource {
3636
Type: schema.TypeString,
3737
Description: "value for the configuration variable",
3838
Required: true,
39+
Sensitive: true,
3940
},
4041
"is_sensitive": {
4142
Type: schema.TypeBool,

tests/integration/003_configuration_variable/main.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ data "env0_configuration_variable" "region" {
22
name = "AWS_DEFAULT_REGION"
33
}
44
output "region_value" {
5-
value = data.env0_configuration_variable.region.value
5+
value = data.env0_configuration_variable.region.value
6+
sensitive = true
67
}
78
output "region_id" {
89
value = data.env0_configuration_variable.region.id
@@ -17,7 +18,8 @@ data "env0_configuration_variable" "region_in_project" {
1718
project_id = data.env0_project.default.id
1819
}
1920
output "region_in_project_value" {
20-
value = data.env0_configuration_variable.region_in_project.value
21+
value = data.env0_configuration_variable.region_in_project.value
22+
sensitive = true
2123
}
2224
output "region_in_project_id" {
2325
value = data.env0_configuration_variable.region_in_project.id
@@ -33,7 +35,8 @@ data "env0_configuration_variable" "tested1" {
3335
}
3436

3537
output "tested1_value" {
36-
value = data.env0_configuration_variable.tested1.value
38+
value = data.env0_configuration_variable.tested1.value
39+
sensitive = true
3740
}
3841

3942
data "env0_configuration_variable" "tested2" {
@@ -52,8 +55,10 @@ data "env0_configuration_variable" "tested3" {
5255

5356

5457
output "tested3_enum_1" {
55-
value = data.env0_configuration_variable.tested3.enum[0]
58+
value = data.env0_configuration_variable.tested3.enum[0]
59+
sensitive = true
5660
}
5761
output "tested3_enum_2" {
58-
value = data.env0_configuration_variable.tested3.enum[1]
62+
value = data.env0_configuration_variable.tested3.enum[1]
63+
sensitive = true
5964
}

0 commit comments

Comments
 (0)