Ephemeral write only attributes (#3171)

Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
Andrei Ciobanu
2025-08-25 13:57:11 +03:00
committed by Christian Mesh
parent cbe16d3a5d
commit 7f76707dd0
29 changed files with 2389 additions and 89 deletions

View File

@@ -51,6 +51,11 @@ func TestConvertSchemaBlocks(t *testing.T) {
Type: []byte(`"number"`),
Required: true,
},
{
Name: "write_only",
Type: []byte(`"number"`),
WriteOnly: true,
},
},
},
&configschema.Block{
@@ -72,6 +77,10 @@ func TestConvertSchemaBlocks(t *testing.T) {
Type: cty.Number,
Required: true,
},
"write_only": {
Type: cty.Number,
WriteOnly: true,
},
},
},
},
@@ -103,6 +112,11 @@ func TestConvertSchemaBlocks(t *testing.T) {
Type: []byte(`"dynamic"`),
Required: true,
},
{
Name: "write_only",
Type: []byte(`"dynamic"`),
WriteOnly: true,
},
},
},
},
@@ -127,6 +141,10 @@ func TestConvertSchemaBlocks(t *testing.T) {
Type: cty.DynamicPseudoType,
Required: true,
},
"write_only": {
Type: cty.DynamicPseudoType,
WriteOnly: true,
},
},
},
},
@@ -223,6 +241,11 @@ func TestConvertProtoSchemaBlocks(t *testing.T) {
Type: []byte(`"number"`),
Required: true,
},
{
Name: "write_only",
Type: []byte(`"number"`),
WriteOnly: true,
},
},
},
&configschema.Block{
@@ -244,6 +267,10 @@ func TestConvertProtoSchemaBlocks(t *testing.T) {
Type: cty.Number,
Required: true,
},
"write_only": {
Type: cty.Number,
WriteOnly: true,
},
},
},
},
@@ -275,6 +302,11 @@ func TestConvertProtoSchemaBlocks(t *testing.T) {
Type: []byte(`"dynamic"`),
Required: true,
},
{
Name: "write_only",
Type: []byte(`"dynamic"`),
WriteOnly: true,
},
},
},
},
@@ -299,6 +331,10 @@ func TestConvertProtoSchemaBlocks(t *testing.T) {
Type: cty.DynamicPseudoType,
Required: true,
},
"write_only": {
Type: cty.DynamicPseudoType,
WriteOnly: true,
},
},
},
},