@@ -16,17 +16,13 @@ import (
1616 "github.com/hashicorp/terraform-plugin-framework/resource"
1717 "github.com/hashicorp/terraform-plugin-framework/resource/schema"
1818 "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
19- "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
20- "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
21- "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
22- "github.com/hashicorp/terraform-plugin-framework/schema/validator"
2319 "github.com/hashicorp/terraform-plugin-framework/types"
2420 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
2521 "github.com/hashicorp/terraform-provider-aws/internal/errs"
2622 "github.com/hashicorp/terraform-provider-aws/internal/errs/fwdiag"
2723 "github.com/hashicorp/terraform-provider-aws/internal/framework"
2824 fwflex "github.com/hashicorp/terraform-provider-aws/internal/framework/flex"
29- fwvalidators "github.com/hashicorp/terraform-provider-aws/internal/framework/validators "
25+ quicksightschema "github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema "
3026 "github.com/hashicorp/terraform-provider-aws/internal/tfresource"
3127 "github.com/hashicorp/terraform-provider-aws/names"
3228)
@@ -55,25 +51,8 @@ type accountSettingsResource struct {
5551func (r * accountSettingsResource ) Schema (ctx context.Context , request resource.SchemaRequest , response * resource.SchemaResponse ) {
5652 response .Schema = schema.Schema {
5753 Attributes : map [string ]schema.Attribute {
58- names .AttrAWSAccountID : schema.StringAttribute {
59- Optional : true ,
60- Computed : true ,
61- Validators : []validator.String {
62- fwvalidators .AWSAccountID (),
63- },
64- PlanModifiers : []planmodifier.String {
65- stringplanmodifier .UseStateForUnknown (),
66- stringplanmodifier .RequiresReplace (),
67- },
68- },
69- "default_namespace" : schema.StringAttribute {
70- Optional : true ,
71- Computed : true ,
72- Default : stringdefault .StaticString ("default" ),
73- PlanModifiers : []planmodifier.String {
74- stringplanmodifier .RequiresReplace (),
75- },
76- },
54+ names .AttrAWSAccountID : quicksightschema .AWSAccountIDAttribute (),
55+ "default_namespace" : quicksightschema .NamespaceAttribute (),
7756 "termination_protection_enabled" : schema.BoolAttribute {
7857 Optional : true ,
7958 Computed : true ,
@@ -95,7 +74,9 @@ func (r *accountSettingsResource) Create(ctx context.Context, request resource.C
9574 if response .Diagnostics .HasError () {
9675 return
9776 }
98- data .AWSAccountID = types .StringValue (r .Meta ().AccountID (ctx ))
77+ if data .AWSAccountID .IsUnknown () {
78+ data .AWSAccountID = fwflex .StringValueToFramework (ctx , r .Meta ().AccountID (ctx ))
79+ }
9980
10081 conn := r .Meta ().QuickSightClient (ctx )
10182
0 commit comments