Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
28f4719
new attribute additions (breaks build for existing internal schema at…
austinvalle Feb 24, 2025
c4ad0c5
update internal testing/testschema
austinvalle Feb 24, 2025
2950f20
implement in datasource/schema
austinvalle Feb 24, 2025
f2243ba
implement in ephemeral/schema
austinvalle Feb 24, 2025
057093a
implement in provider/metaschema
austinvalle Feb 24, 2025
2fed091
implement in provider/schema
austinvalle Feb 24, 2025
3c759ec
implement in resource/schema
austinvalle Feb 24, 2025
167b824
add to final internal/testing/testschema
austinvalle Feb 24, 2025
77ef579
get resource identity schema implementation
austinvalle Mar 6, 2025
0f63086
Merge branch 'main' into feat/resource-identity
austinvalle Mar 6, 2025
63dc825
protov6 + tests
austinvalle Mar 6, 2025
f97d278
fix up package docs + build specific TODO comments
austinvalle Mar 6, 2025
5578a7d
spellcheck!
austinvalle Mar 6, 2025
dd0bcbc
Merge branch 'main' into feat/resource-identity
austinvalle Mar 10, 2025
7eba2e7
add tfsdk object
austinvalle Mar 10, 2025
d07f756
ReadResource RPC implementation for v5
austinvalle Mar 12, 2025
e3dd2b6
ReadResource RPC implementation for v6
austinvalle Mar 12, 2025
8873227
protov5 + fwserver implementation for PlanResourceChange
austinvalle Mar 12, 2025
774af73
protov6 implementation of PlanResourceChange
austinvalle Mar 12, 2025
8a90ecb
implement ApplyResourceChange fwserver + protov5
austinvalle Mar 13, 2025
bb07ce6
protov6 implementation of apply resource
austinvalle Mar 14, 2025
df3e558
update go dep
austinvalle Mar 14, 2025
717befd
Merge branch 'main' into feat/resource-identity_data-req-resp
austinvalle Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions datasource/schema/bool_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,15 @@ func (a BoolAttribute) IsWriteOnly() bool {
func (a BoolAttribute) IsSensitive() bool {
return a.Sensitive
}

// IsRequiredForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a BoolAttribute) IsRequiredForImport() bool {
return false
}

// IsOptionalForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a BoolAttribute) IsOptionalForImport() bool {
return false
}
52 changes: 52 additions & 0 deletions datasource/schema/bool_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,55 @@ func TestBoolAttributeIsWriteOnly(t *testing.T) {
})
}
}

func TestBoolAttributeIsRequiredForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.BoolAttribute
expected bool
}{
"not-requiredForImport": {
attribute: schema.BoolAttribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsRequiredForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}

func TestBoolAttributeIsOptionalForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.BoolAttribute
expected bool
}{
"not-optionalForImport": {
attribute: schema.BoolAttribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsOptionalForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}
12 changes: 12 additions & 0 deletions datasource/schema/dynamic_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ func (a DynamicAttribute) IsWriteOnly() bool {
return false
}

// IsRequiredForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a DynamicAttribute) IsRequiredForImport() bool {
return false
}

// IsOptionalForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a DynamicAttribute) IsOptionalForImport() bool {
return false
}

// DynamicValidators returns the Validators field value.
func (a DynamicAttribute) DynamicValidators() []validator.Dynamic {
return a.Validators
Expand Down
52 changes: 52 additions & 0 deletions datasource/schema/dynamic_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,55 @@ func TestDynamicAttributeDynamicValidators(t *testing.T) {
})
}
}

func TestDynamicAttributeIsRequiredForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.DynamicAttribute
expected bool
}{
"not-requiredForImport": {
attribute: schema.DynamicAttribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsRequiredForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}

func TestDynamicAttributeIsOptionalForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.DynamicAttribute
expected bool
}{
"not-optionalForImport": {
attribute: schema.DynamicAttribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsOptionalForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}
12 changes: 12 additions & 0 deletions datasource/schema/float32_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,15 @@ func (a Float32Attribute) IsSensitive() bool {
func (a Float32Attribute) IsWriteOnly() bool {
return false
}

// IsRequiredForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Float32Attribute) IsRequiredForImport() bool {
return false
}

// IsOptionalForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Float32Attribute) IsOptionalForImport() bool {
return false
}
52 changes: 52 additions & 0 deletions datasource/schema/float32_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,55 @@ func TestFloat32AttributeIsWriteOnly(t *testing.T) {
})
}
}

func TestFloat32AttributeIsRequiredForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.Float32Attribute
expected bool
}{
"not-requiredForImport": {
attribute: schema.Float32Attribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsRequiredForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}

func TestFloat32AttributeIsOptionalForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.Float32Attribute
expected bool
}{
"not-optionalForImport": {
attribute: schema.Float32Attribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsOptionalForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}
12 changes: 12 additions & 0 deletions datasource/schema/float64_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,15 @@ func (a Float64Attribute) IsSensitive() bool {
func (a Float64Attribute) IsWriteOnly() bool {
return false
}

// IsRequiredForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Float64Attribute) IsRequiredForImport() bool {
return false
}

// IsOptionalForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Float64Attribute) IsOptionalForImport() bool {
return false
}
52 changes: 52 additions & 0 deletions datasource/schema/float64_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,55 @@ func TestFloat64AttributeIsWriteOnly(t *testing.T) {
})
}
}

func TestFloat64AttributeIsRequiredForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.Float64Attribute
expected bool
}{
"not-requiredForImport": {
attribute: schema.Float64Attribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsRequiredForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}

func TestFloat64AttributeIsOptionalForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.Float64Attribute
expected bool
}{
"not-optionalForImport": {
attribute: schema.Float64Attribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsOptionalForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}
12 changes: 12 additions & 0 deletions datasource/schema/int32_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,15 @@ func (a Int32Attribute) IsSensitive() bool {
func (a Int32Attribute) IsWriteOnly() bool {
return false
}

// IsRequiredForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Int32Attribute) IsRequiredForImport() bool {
return false
}

// IsOptionalForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Int32Attribute) IsOptionalForImport() bool {
return false
}
52 changes: 52 additions & 0 deletions datasource/schema/int32_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,3 +428,55 @@ func TestInt32AttributeIsWriteOnly(t *testing.T) {
})
}
}

func TestInt32AttributeIsRequiredForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.Int32Attribute
expected bool
}{
"not-requiredForImport": {
attribute: schema.Int32Attribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsRequiredForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}

func TestInt32AttributeIsOptionalForImport(t *testing.T) {
t.Parallel()

testCases := map[string]struct {
attribute schema.Int32Attribute
expected bool
}{
"not-optionalForImport": {
attribute: schema.Int32Attribute{},
expected: false,
},
}

for name, testCase := range testCases {
t.Run(name, func(t *testing.T) {
t.Parallel()

got := testCase.attribute.IsOptionalForImport()

if diff := cmp.Diff(got, testCase.expected); diff != "" {
t.Errorf("unexpected difference: %s", diff)
}
})
}
}
12 changes: 12 additions & 0 deletions datasource/schema/int64_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,15 @@ func (a Int64Attribute) IsSensitive() bool {
func (a Int64Attribute) IsWriteOnly() bool {
return false
}

// IsRequiredForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Int64Attribute) IsRequiredForImport() bool {
return false
}

// IsOptionalForImport returns false as this behavior is only relevant
// for managed resource identity schema attributes.
func (a Int64Attribute) IsOptionalForImport() bool {
return false
}
Loading
Loading