Skip to content

Commit 47c06ec

Browse files
committed
Bumping terraform-plugin-framework to 0.17 (#112)
1 parent c55b96f commit 47c06ec

File tree

5 files changed

+153
-181
lines changed

5 files changed

+153
-181
lines changed

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ go 1.18
44

55
require (
66
github.com/hashicorp/terraform-plugin-docs v0.13.0
7-
github.com/hashicorp/terraform-plugin-framework v0.15.0
8-
github.com/hashicorp/terraform-plugin-framework-validators v0.5.0
9-
github.com/hashicorp/terraform-plugin-go v0.14.1
7+
github.com/hashicorp/terraform-plugin-framework v0.17.0
8+
github.com/hashicorp/terraform-plugin-framework-validators v0.7.0
9+
github.com/hashicorp/terraform-plugin-go v0.14.2
1010
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
1111
)
1212

@@ -38,7 +38,7 @@ require (
3838
github.com/hashicorp/terraform-exec v0.17.3 // indirect
3939
github.com/hashicorp/terraform-json v0.14.0 // indirect
4040
github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect
41-
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect
41+
github.com/hashicorp/terraform-registry-address v0.1.0 // indirect
4242
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
4343
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
4444
github.com/huandu/xstrings v1.3.2 // indirect
@@ -61,11 +61,11 @@ require (
6161
github.com/vmihailenco/tagparser v0.1.2 // indirect
6262
github.com/zclconf/go-cty v1.12.1 // indirect
6363
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
64-
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
65-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
66-
golang.org/x/text v0.3.7 // indirect
64+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
65+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
66+
golang.org/x/text v0.4.0 // indirect
6767
google.golang.org/appengine v1.6.7 // indirect
6868
google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
69-
google.golang.org/grpc v1.50.1 // indirect
69+
google.golang.org/grpc v1.51.0 // indirect
7070
google.golang.org/protobuf v1.28.1 // indirect
7171
)

go.sum

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,18 @@ github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e
120120
github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM=
121121
github.com/hashicorp/terraform-plugin-docs v0.13.0 h1:6e+VIWsVGb6jYJewfzq2ok2smPzZrt1Wlm9koLeKazY=
122122
github.com/hashicorp/terraform-plugin-docs v0.13.0/go.mod h1:W0oCmHAjIlTHBbvtppWHe8fLfZ2BznQbuv8+UD8OucQ=
123-
github.com/hashicorp/terraform-plugin-framework v0.15.0 h1:6f4UY2yfp5UsSX9JhUA6RSptjd+ojStBGWA4jrPhB6Q=
124-
github.com/hashicorp/terraform-plugin-framework v0.15.0/go.mod h1:wcZdk4+Uef6Ng+BiBJjGAcIPlIs5bhlEV/TA1k6Xkq8=
125-
github.com/hashicorp/terraform-plugin-framework-validators v0.5.0 h1:eD79idhnJOBajkUMEbm0c8dOyOb/F49STbUEVojT6F4=
126-
github.com/hashicorp/terraform-plugin-framework-validators v0.5.0/go.mod h1:NfGgclDM3FZqvNVppPKE2aHI1JAyT002ypPRya7ch3I=
127-
github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H29tczAwrB0z9Zek=
128-
github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ=
123+
github.com/hashicorp/terraform-plugin-framework v0.17.0 h1:0KUOY/oe1GPLFqaXnKDnd1rhCrnUtt8pV9wGEwNUFlU=
124+
github.com/hashicorp/terraform-plugin-framework v0.17.0/go.mod h1:FV97t2BZOARkL7NNlsc/N25c84MyeSSz72uPp7Vq1lg=
125+
github.com/hashicorp/terraform-plugin-framework-validators v0.7.0 h1:tIYOMNmEMQIc6mwun8nX3e5U3TkgZg1TpXRlBEBQHwY=
126+
github.com/hashicorp/terraform-plugin-framework-validators v0.7.0/go.mod h1:e1RKREyEVdd3FK8Jfgz8L/ThQgcJKLb4ZJxNzsuIH0A=
127+
github.com/hashicorp/terraform-plugin-go v0.14.2 h1:rhsVEOGCnY04msNymSvbUsXfRLKh9znXZmHlf5e8mhE=
128+
github.com/hashicorp/terraform-plugin-go v0.14.2/go.mod h1:Q12UjumPNGiFsZffxOsA40Tlz1WVXt2Evh865Zj0+UA=
129129
github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs=
130130
github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
131131
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM=
132132
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw=
133-
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg=
134-
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI=
133+
github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U=
134+
github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A=
135135
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
136136
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
137137
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ=
@@ -185,7 +185,6 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
185185
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
186186
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
187187
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
188-
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758=
189188
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
190189
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
191190
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -261,8 +260,8 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL
261260
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
262261
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
263262
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
264-
golang.org/x/net v0.0.0-20220708220712-1185a9018129 h1:vucSRfWwTsoXro7P+3Cjlr6flUMtzCwzlvkxEQtHHB0=
265-
golang.org/x/net v0.0.0-20220708220712-1185a9018129/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
263+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
264+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
266265
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
267266
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
268267
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -286,15 +285,15 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
286285
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
287286
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
288287
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
289-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
290-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
288+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
289+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
291290
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
292291
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
293292
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
294293
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
295294
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
296-
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
297-
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
295+
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
296+
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
298297
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
299298
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
300299
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@@ -314,8 +313,8 @@ google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6D
314313
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
315314
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
316315
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
317-
google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY=
318-
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
316+
google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U=
317+
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
319318
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
320319
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
321320
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

internal/provider/data_source_archive_file.go

Lines changed: 52 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import (
1111
"os"
1212
"path"
1313

14-
"github.com/hashicorp/terraform-plugin-framework-validators/schemavalidator"
14+
"github.com/hashicorp/terraform-plugin-framework-validators/setvalidator"
15+
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1516
"github.com/hashicorp/terraform-plugin-framework/datasource"
16-
"github.com/hashicorp/terraform-plugin-framework/diag"
17+
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
1718
fwpath "github.com/hashicorp/terraform-plugin-framework/path"
18-
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
19+
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
1920
"github.com/hashicorp/terraform-plugin-framework/types"
2021
)
2122

@@ -27,140 +28,125 @@ func NewArchiveFileDataSource() datasource.DataSource {
2728

2829
type archiveFileDataSource struct{}
2930

30-
func (d *archiveFileDataSource) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
31-
return tfsdk.Schema{
31+
func (d *archiveFileDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) {
32+
resp.Schema = schema.Schema{
3233
Description: "Generates an archive from content, a file, or directory of files.",
33-
Blocks: map[string]tfsdk.Block{
34-
"source": {
34+
Blocks: map[string]schema.Block{
35+
"source": schema.SetNestedBlock{
3536
Description: "Specifies attributes of a single source file to include into the archive.",
36-
Attributes: map[string]tfsdk.Attribute{
37-
"content": {
38-
Description: "Add this content to the archive with `filename` as the filename.",
39-
Type: types.StringType,
40-
Required: true,
41-
Validators: []tfsdk.AttributeValidator{
42-
schemavalidator.ConflictsWith(
43-
fwpath.MatchRoot("source_file"),
44-
fwpath.MatchRoot("source_dir"),
45-
fwpath.MatchRoot("source_content"),
46-
fwpath.MatchRoot("source_content_filename"),
47-
),
37+
NestedObject: schema.NestedBlockObject{
38+
Attributes: map[string]schema.Attribute{
39+
"content": schema.StringAttribute{
40+
Description: "Add this content to the archive with `filename` as the filename.",
41+
Required: true,
42+
Validators: []validator.String{
43+
stringvalidator.ConflictsWith(
44+
fwpath.MatchRoot("source_file"),
45+
fwpath.MatchRoot("source_dir"),
46+
fwpath.MatchRoot("source_content"),
47+
fwpath.MatchRoot("source_content_filename"),
48+
),
49+
},
50+
},
51+
"filename": schema.StringAttribute{
52+
Description: "Set this as the filename when declaring a `source`.",
53+
Required: true,
4854
},
49-
},
50-
"filename": {
51-
Description: "Set this as the filename when declaring a `source`.",
52-
Type: types.StringType,
53-
Required: true,
5455
},
5556
},
56-
NestingMode: tfsdk.BlockNestingModeSet,
5757
},
5858
},
59-
Attributes: map[string]tfsdk.Attribute{
60-
"id": {
59+
Attributes: map[string]schema.Attribute{
60+
"id": schema.StringAttribute{
6161
Description: "The sha1 checksum hash of the output.",
62-
Type: types.StringType,
6362
Computed: true,
6463
},
65-
"type": {
64+
"type": schema.StringAttribute{
6665
Description: "The type of archive to generate. NOTE: `zip` is supported.",
67-
Type: types.StringType,
6866
Required: true,
6967
},
70-
"source_content": {
68+
"source_content": schema.StringAttribute{
7169
Description: "Add only this content to the archive with `source_content_filename` as the filename.",
72-
Type: types.StringType,
7370
Optional: true,
74-
Validators: []tfsdk.AttributeValidator{
75-
schemavalidator.ConflictsWith(
71+
Validators: []validator.String{
72+
stringvalidator.ConflictsWith(
7673
fwpath.MatchRoot("source_file"),
7774
fwpath.MatchRoot("source_dir"),
7875
),
7976
},
8077
},
81-
"source_content_filename": {
78+
"source_content_filename": schema.StringAttribute{
8279
Description: "Set this as the filename when using `source_content`.",
83-
Type: types.StringType,
8480
Optional: true,
85-
Validators: []tfsdk.AttributeValidator{
86-
schemavalidator.ConflictsWith(
81+
Validators: []validator.String{
82+
stringvalidator.ConflictsWith(
8783
fwpath.MatchRoot("source_file"),
8884
fwpath.MatchRoot("source_dir"),
8985
),
9086
},
9187
},
92-
"source_file": {
88+
"source_file": schema.StringAttribute{
9389
Description: "Package this file into the archive.",
94-
Type: types.StringType,
9590
Optional: true,
96-
Validators: []tfsdk.AttributeValidator{
97-
schemavalidator.ConflictsWith(
91+
Validators: []validator.String{
92+
stringvalidator.ConflictsWith(
9893
fwpath.MatchRoot("source_dir"),
9994
fwpath.MatchRoot("source_content"),
10095
fwpath.MatchRoot("source_content_filename"),
10196
),
10297
},
10398
},
104-
"source_dir": {
99+
"source_dir": schema.StringAttribute{
105100
Description: "Package entire contents of this directory into the archive.",
106-
Type: types.StringType,
107101
Optional: true,
108-
Validators: []tfsdk.AttributeValidator{
109-
schemavalidator.ConflictsWith(
102+
Validators: []validator.String{
103+
stringvalidator.ConflictsWith(
110104
fwpath.MatchRoot("source_file"),
111105
fwpath.MatchRoot("source_content"),
112106
fwpath.MatchRoot("source_content_filename"),
113107
),
114108
},
115109
},
116-
"excludes": {
110+
"excludes": schema.SetAttribute{
117111
Description: "Specify files to ignore when reading the `source_dir`.",
118-
Type: types.SetType{
119-
ElemType: types.StringType,
120-
},
121-
Optional: true,
122-
Validators: []tfsdk.AttributeValidator{
123-
schemavalidator.ConflictsWith(
112+
ElementType: types.StringType,
113+
Optional: true,
114+
Validators: []validator.Set{
115+
setvalidator.ConflictsWith(
124116
fwpath.MatchRoot("source_file"),
125117
fwpath.MatchRoot("source_content"),
126118
fwpath.MatchRoot("source_content_filename"),
127119
),
128120
},
129121
},
130-
"output_path": {
122+
"output_path": schema.StringAttribute{
131123
Description: "The output of the archive file.",
132-
Type: types.StringType,
133124
Required: true,
134125
},
135-
"output_size": {
126+
"output_size": schema.Int64Attribute{
136127
Description: "The byte size of the output archive file.",
137-
Type: types.Int64Type,
138128
Computed: true,
139129
},
140-
"output_sha": {
130+
"output_sha": schema.StringAttribute{
141131
Description: "The SHA1 checksum of output archive file.",
142-
Type: types.StringType,
143132
Computed: true,
144133
},
145-
"output_base64sha256": {
134+
"output_base64sha256": schema.StringAttribute{
146135
Description: "The base64-encoded SHA256 checksum of output archive file.",
147-
Type: types.StringType,
148136
Computed: true,
149137
},
150-
"output_md5": {
138+
"output_md5": schema.StringAttribute{
151139
Description: "The MD5 checksum of output archive file.",
152-
Type: types.StringType,
153140
Computed: true,
154141
},
155-
"output_file_mode": {
142+
"output_file_mode": schema.StringAttribute{
156143
Description: "String that specifies the octal file mode for all archived files. For example: `\"0666\"`. " +
157144
"Setting this will ensure that cross platform usage of this module will not vary the modes of archived " +
158145
"files (and ultimately checksums) resulting in more deterministic behavior.",
159-
Type: types.StringType,
160146
Optional: true,
161147
},
162148
},
163-
}, nil
149+
}
164150
}
165151

166152
func archive(ctx context.Context, model fileModel) error {

internal/provider/provider.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import (
44
"context"
55

66
"github.com/hashicorp/terraform-plugin-framework/datasource"
7-
"github.com/hashicorp/terraform-plugin-framework/diag"
87
"github.com/hashicorp/terraform-plugin-framework/provider"
98
"github.com/hashicorp/terraform-plugin-framework/resource"
10-
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
119
)
1210

1311
func New() provider.Provider {
@@ -18,8 +16,7 @@ var _ provider.Provider = (*archiveProvider)(nil)
1816

1917
type archiveProvider struct{}
2018

21-
func (p *archiveProvider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
22-
return tfsdk.Schema{}, nil
19+
func (p *archiveProvider) Schema(context.Context, provider.SchemaRequest, *provider.SchemaResponse) {
2320
}
2421

2522
func (p *archiveProvider) Configure(context.Context, provider.ConfigureRequest, *provider.ConfigureResponse) {

0 commit comments

Comments
 (0)