Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SchemaFunc for some resources with large schemas #32274

Merged
merged 25 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
243c2ee
Start pprof HTTP server.
ewbankkit Jun 23, 2023
2169620
Run 'go mod edit -replace github.com/hashicorp/terraform-plugin-sdk/v…
ewbankkit Jun 23, 2023
39fc99f
wafv2: Implement 'SchemaFunc()'.
ewbankkit Jun 23, 2023
ff98367
quicksight: Implement 'SchemaFunc()'.
ewbankkit Jun 23, 2023
001bc4f
Only do schema checking for transparent tagging if it isn't lazy-loaded.
ewbankkit Jun 23, 2023
59cb145
Revert "quicksight: Implement 'SchemaFunc()'."
ewbankkit Jun 28, 2023
6b0e911
Revert "wafv2: Implement 'SchemaFunc()'."
ewbankkit Jun 28, 2023
aadc8ae
Merge branch 'main' into add-pprof
ewbankkit Jun 28, 2023
25ee796
Merge branch 'main' into add-pprof
ewbankkit Jun 28, 2023
4168ced
Revert "Revert "quicksight: Implement 'SchemaFunc()'.""
ewbankkit Jun 28, 2023
3d37e19
Revert "Revert "wafv2: Implement 'SchemaFunc()'.""
ewbankkit Jun 28, 2023
d448031
OpsWorks Layers: Implement 'SchemaFunc()'.
ewbankkit Jun 28, 2023
c107128
r/aws_medialive_channel: Implement 'SchemaFunc()'.
ewbankkit Jun 28, 2023
c240bec
Merge branch 'main' into add-pprof
ewbankkit Jun 28, 2023
7848409
Revert "Start pprof HTTP server."
ewbankkit Jun 28, 2023
17a6b95
Merge branch 'main' into td-use-SchemaFunc
ewbankkit Jun 29, 2023
c267e7f
Use 'schema.Resource.SchemaMap()' for schema during provider initiali…
ewbankkit Jun 29, 2023
4336047
r/aws_autoscaling_group: Use 'resource.SchemaMap()'.
ewbankkit Jun 30, 2023
e97c28b
r/aws_spot_instance_request: Use 'resource.SchemaMap()'.
ewbankkit Jun 30, 2023
ed06427
ec2_instance_test: Use 'resource.SchemaMap()'.
ewbankkit Jun 30, 2023
d4520ca
waf: Use 'resource.SchemaMap()'.
ewbankkit Jun 30, 2023
be4ba0d
wafregional: Use 'resource.SchemaMap()'.
ewbankkit Jun 30, 2023
ce402ed
Merge branch 'main' into td-use-SchemaFunc
ewbankkit Jun 30, 2023
3dac3ed
Add 'testAccCheckSpotInstanceRequestIDsEqual' and 'testAccCheckSpotIn…
ewbankkit Jun 30, 2023
e52f8fd
r/aws_spot_instance_request: 'tags_all' is not ForceNew.
ewbankkit Jun 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,25 +323,27 @@ func New(ctx context.Context) (*schema.Provider, error) {
interceptors := interceptorItems{}

if v.Tags != nil {
// The resource has opted in to transparent tagging.
// Ensure that the schema look OK.
if v, ok := r.Schema[names.AttrTags]; ok {
if v.Computed {
errs = multierror.Append(errs, fmt.Errorf("`%s` attribute cannot be Computed: %s", names.AttrTags, typeName))
if r.SchemaFunc == nil {
ewbankkit marked this conversation as resolved.
Show resolved Hide resolved
// The resource has opted in to transparent tagging.
// Ensure that the schema look OK.
if v, ok := r.Schema[names.AttrTags]; ok {
if v.Computed {
errs = multierror.Append(errs, fmt.Errorf("`%s` attribute cannot be Computed: %s", names.AttrTags, typeName))
continue
}
} else {
errs = multierror.Append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s", names.AttrTags, typeName))
continue
}
} else {
errs = multierror.Append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s", names.AttrTags, typeName))
continue
}
if v, ok := r.Schema[names.AttrTagsAll]; ok {
if !v.Computed {
errs = multierror.Append(errs, fmt.Errorf("`%s` attribute must be Computed: %s", names.AttrTags, typeName))
if v, ok := r.Schema[names.AttrTagsAll]; ok {
if !v.Computed {
errs = multierror.Append(errs, fmt.Errorf("`%s` attribute must be Computed: %s", names.AttrTags, typeName))
continue
}
} else {
errs = multierror.Append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s", names.AttrTagsAll, typeName))
continue
}
} else {
errs = multierror.Append(errs, fmt.Errorf("no `%s` attribute defined in schema: %s", names.AttrTagsAll, typeName))
continue
}

interceptors = append(interceptors, interceptorItem{
Expand Down
Loading