Skip to content

Commit 6115722

Browse files
authored
Add a version of external resource with sensitive output (geldata#3)
1 parent c40663d commit 6115722

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

internal/provider/provider.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ func New() *schema.Provider {
1010
"external": dataSource(),
1111
},
1212
ResourcesMap: map[string]*schema.Resource{
13-
"external": resourceExternal(),
13+
"external": resourceExternal(false),
14+
"external_sensitive": resourceExternal(true),
1415
},
1516
}
1617
}

internal/provider/resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
88
)
99

10-
func resourceExternal() *schema.Resource {
10+
func resourceExternal(sensitiveResult bool) *schema.Resource {
1111
return &schema.Resource{
1212
// This description is used by the documentation generator and the language server.
1313
Description: "The `external` resource allows an external program implementing a specific protocol " +
@@ -83,6 +83,7 @@ func resourceExternal() *schema.Resource {
8383
Description: "A map of string values returned from the external program.",
8484
Type: schema.TypeMap,
8585
Computed: true,
86+
Sensitive: sensitiveResult,
8687
Elem: &schema.Schema{
8788
Type: schema.TypeString,
8889
},

0 commit comments

Comments
 (0)