Skip to content

Commit f0f8be6

Browse files
Merge remote-tracking branch 'origin/main' into feature/rate-limiting-provider
2 parents efb3e5c + 1037571 commit f0f8be6

8 files changed

Lines changed: 10 additions & 8 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kind: Fixed
2+
body: Fix ImportState using non-existent "id" attribute path — all resources use "uid" as their identifier, causing a State Write Error on any import operation

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/hashicorp/terraform-plugin-docs v0.9.0
1010
github.com/hashicorp/terraform-plugin-framework v0.8.1-0.20220531184835-f0051665855e
1111
github.com/hashicorp/terraform-plugin-go v0.9.1
12-
github.com/labd/contentstack-go-sdk v0.1.0
12+
github.com/labd/contentstack-go-sdk v0.1.1
1313
github.com/stretchr/testify v1.7.2
1414
)
1515

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
166166
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
167167
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
168168
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
169-
github.com/labd/contentstack-go-sdk v0.1.0 h1:lxBbGBkIlileNn2+VrVG6XP776Llxy9i4THPBA01xTU=
170-
github.com/labd/contentstack-go-sdk v0.1.0/go.mod h1:J17aqV8NOcmFfkkotnAljlt6Ctwlu21Ieeo/0BPLNtg=
169+
github.com/labd/contentstack-go-sdk v0.1.1 h1:iTPzeyFxax4+cnBf3PKBeUPoxrIIsuV59WiWG5TmdXI=
170+
github.com/labd/contentstack-go-sdk v0.1.1/go.mod h1:J17aqV8NOcmFfkkotnAljlt6Ctwlu21Ieeo/0BPLNtg=
171171
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
172172
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
173173
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=

internal/provider/resource_content_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (r resourceContentType) Update(ctx context.Context, req tfsdk.UpdateResourc
181181
}
182182

183183
func (r resourceContentType) ImportState(ctx context.Context, req tfsdk.ImportResourceStateRequest, resp *tfsdk.ImportResourceStateResponse) {
184-
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("id"), req, resp)
184+
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("uid"), req, resp)
185185
}
186186

187187
func NewContentTypeData(field *management.ContentType) *ContentTypeData {

internal/provider/resource_environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (r resourceEnvironment) Update(ctx context.Context, req tfsdk.UpdateResourc
186186
}
187187

188188
func (r resourceEnvironment) ImportState(ctx context.Context, req tfsdk.ImportResourceStateRequest, resp *tfsdk.ImportResourceStateResponse) {
189-
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("id"), req, resp)
189+
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("uid"), req, resp)
190190
}
191191

192192
func NewEnvironmentData(environment *management.Environment) *EnvironmentData {

internal/provider/resource_global_field.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (r resourceGlobalField) Update(ctx context.Context, req tfsdk.UpdateResourc
182182
}
183183

184184
func (r resourceGlobalField) ImportState(ctx context.Context, req tfsdk.ImportResourceStateRequest, resp *tfsdk.ImportResourceStateResponse) {
185-
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("id"), req, resp)
185+
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("uid"), req, resp)
186186
}
187187

188188
func NewGlobalFieldData(field *management.GlobalField) *GlobalFieldData {

internal/provider/resource_locale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (r resourceLocale) Update(ctx context.Context, req tfsdk.UpdateResourceRequ
179179
}
180180

181181
func (r resourceLocale) ImportState(ctx context.Context, req tfsdk.ImportResourceStateRequest, resp *tfsdk.ImportResourceStateResponse) {
182-
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("id"), req, resp)
182+
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("uid"), req, resp)
183183
}
184184

185185
func NewLocaleData(field *management.Locale) *LocaleData {

internal/provider/resource_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (r resourceWebhook) Update(ctx context.Context, req tfsdk.UpdateResourceReq
270270
}
271271

272272
func (r resourceWebhook) ImportState(ctx context.Context, req tfsdk.ImportResourceStateRequest, resp *tfsdk.ImportResourceStateResponse) {
273-
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("id"), req, resp)
273+
tfsdk.ResourceImportStatePassthroughID(ctx, tftypes.NewAttributePath().WithAttributeName("uid"), req, resp)
274274
}
275275

276276
func NewWebhookData(webhook *management.WebHook) *WebhookData {

0 commit comments

Comments
 (0)