Skip to content

Commit 653b53e

Browse files
add isDynamicType to value shim
1 parent 70974d6 commit 653b53e

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

pkg/valueshim/cty.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ func (t ctyTypeShim) IsObjectType() bool {
155155
return t.ty().IsObjectType()
156156
}
157157

158+
func (t ctyTypeShim) IsDynamicType() bool {
159+
return t.ty().Equals(cty.DynamicPseudoType)
160+
}
161+
158162
func (t ctyTypeShim) AttributeType(name string) (Type, bool) {
159163
tt := t.ty()
160164
if !tt.IsObjectType() {

pkg/valueshim/hcty.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ func (t hctyTypeShim) IsObjectType() bool {
154154
return t.ty().IsObjectType()
155155
}
156156

157+
func (t hctyTypeShim) IsDynamicType() bool {
158+
return t.ty().Equals(cty.DynamicPseudoType)
159+
}
160+
157161
func (t hctyTypeShim) AttributeType(name string) (Type, bool) {
158162
tt := t.ty()
159163
if !tt.IsObjectType() {

pkg/valueshim/shim.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ type Type interface {
5757
IsMapType() bool
5858
IsSetType() bool
5959
IsObjectType() bool
60+
IsDynamicType() bool
6061
AttributeType(name string) (Type, bool)
6162
ElementType() (Type, bool)
6263
GoString() string

pkg/valueshim/tfvalue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ func (t tTypeShim) IsObjectType() bool {
192192
return t.ty().Is(tftypes.Object{})
193193
}
194194

195+
func (t tTypeShim) IsDynamicType() bool {
196+
return t.ty().Is(tftypes.DynamicPseudoType)
197+
}
198+
195199
func (t tTypeShim) GoString() string {
196200
return t.ty().String()
197201
}

0 commit comments

Comments
 (0)