From 952fe43a8680c2ff7d8e05c5591fdfcf7c40dcbb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 21 Mar 2024 16:33:15 -0700 Subject: [PATCH 1/7] Moves plan-time validation of conflicts with `s3_import` to `ConflictsWith` --- internal/service/rds/instance.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 05829884813..70560919474 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -152,6 +152,9 @@ func ResourceInstance() *schema.Resource { Computed: true, ForceNew: true, ValidateFunc: validation.StringInSlice(backupTarget_Values(), false), + ConflictsWith: []string{ + "s3_import", + }, }, "backup_window": { Type: schema.TypeString, @@ -182,6 +185,9 @@ func ResourceInstance() *schema.Resource { Optional: true, Computed: true, ForceNew: true, + ConflictsWith: []string{ + "s3_import", + }, }, "copy_tags_to_snapshot": { Type: schema.TypeBool, @@ -628,6 +634,9 @@ func ResourceInstance() *schema.Resource { Optional: true, Computed: true, ForceNew: true, + ConflictsWith: []string{ + "s3_import", + }, }, "username": { Type: schema.TypeString, @@ -902,15 +911,6 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in if _, ok := d.GetOk("username"); !ok { diags = sdkdiag.AppendErrorf(diags, `"username": required field is not set`) } - if _, ok := d.GetOk("character_set_name"); ok { - diags = sdkdiag.AppendErrorf(diags, `"character_set_name" doesn't work with restores"`) - } - if _, ok := d.GetOk("timezone"); ok { - diags = sdkdiag.AppendErrorf(diags, `"timezone" doesn't work with restores"`) - } - if _, ok := d.GetOk("backup_target"); ok { - diags = sdkdiag.AppendErrorf(diags, `"backup_target" doesn't work with restores"`) - } if diags.HasError() { return diags } From 26f272c8d2d1137f46fa14621d174631d69f9ec5 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 21 Mar 2024 16:34:15 -0700 Subject: [PATCH 2/7] Adds apply-time conflict validation for `character_set_name` --- internal/errs/diag.go | 35 +++++++++++++++++++++++++++++--- internal/service/rds/instance.go | 31 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/internal/errs/diag.go b/internal/errs/diag.go index 220564a0cf7..46b08e3f4fb 100644 --- a/internal/errs/diag.go +++ b/internal/errs/diag.go @@ -74,6 +74,21 @@ func withPath(d diag.Diagnostic, path cty.Path) diag.Diagnostic { return d } +// newAttributeConflictsError is included for use with NewAttributeConflictsWillBeError. +// The typical behavior is covered using the schema ConflictsWith parameter. +func newAttributeConflictsError(path, otherPath cty.Path) diag.Diagnostic { + return NewAttributeErrorDiagnostic( + path, + "Invalid Attribute Combination", + fmt.Sprintf("Attribute %q cannot be specified when %q is specified.", + PathString(path), + PathString(otherPath), + ), + ) +} + +// NewAttributeConflictsWhenError returns an error diagnostic indicating that the attribute at the given path cannot be +// specified when the attribute at otherPath has the given value. func NewAttributeConflictsWhenError(path, otherPath cty.Path, otherValue string) diag.Diagnostic { return NewAttributeErrorDiagnostic( path, @@ -86,18 +101,32 @@ func NewAttributeConflictsWhenError(path, otherPath cty.Path, otherValue string) ) } -func NewAttributeRequiredWhenError(neededPath, path cty.Path, value string) diag.Diagnostic { +// NewAttributeRequiredWhenError returns an error diagnostic indicating that the attribute at neededPath is required when the +// attribute at otherPath has the given value. +func NewAttributeRequiredWhenError(neededPath, otherPath cty.Path, value string) diag.Diagnostic { return NewAttributeErrorDiagnostic( - path, + otherPath, "Invalid Attribute Combination", fmt.Sprintf("Attribute %q must be specified when %q is %q.", PathString(neededPath), - PathString(path), + PathString(otherPath), value, ), ) } +// NewAttributeConflictsWillBeError returns a warning diagnostic indicating that the attribute at the given path cannot be +// specified when the attribute at otherPath is set. +// This is intended to be used for situations where the conflict will become an error in a future release. +func NewAttributeConflictsWillBeError(path, otherPath cty.Path) diag.Diagnostic { + return willBeError( + newAttributeConflictsError(path, otherPath), + ) +} + +// NewAttributeConflictsWhenWillBeError returns a warning diagnostic indicating that the attribute at the given path cannot be +// specified when the attribute at otherPath has the given value. +// This is intended to be used for situations where the conflict will become an error in a future release. func NewAttributeConflictsWhenWillBeError(path, otherPath cty.Path, otherValue string) diag.Diagnostic { return willBeError( NewAttributeConflictsWhenError(path, otherPath, otherValue), diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 70560919474..1036c045255 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -21,6 +21,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" tfawserr_sdkv2 "github.com/hashicorp/aws-sdk-go-base/v2/tfawserr" + "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" @@ -188,6 +189,19 @@ func ResourceInstance() *schema.Resource { ConflictsWith: []string{ "s3_import", }, + DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { + for _, conflictAttr := range []string{ + "replicate_source_db", + // s3_import is handled by the schema ConflictsWith + "snapshot_identifier", + "restore_to_point_in_time", + } { + if _, ok := d.GetOk(conflictAttr); ok { + return true + } + } + return false + }, }, "copy_tags_to_snapshot": { Type: schema.TypeBool, @@ -706,6 +720,23 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in var resourceID string // will be assigned depending on how it is created + if _, ok := d.GetOk("character_set_name"); ok { + charSetPath := cty.GetAttrPath("character_set_name") + for _, conflictAttr := range []string{ + "replicate_source_db", + // s3_import is handled by the schema ConflictsWith + "snapshot_identifier", + "restore_to_point_in_time", + } { + if _, ok := d.GetOk(conflictAttr); ok { + diags = append(diags, errs.NewAttributeConflictsWillBeError( + charSetPath, + cty.GetAttrPath(conflictAttr), + )) + } + } + } + if v, ok := d.GetOk("replicate_source_db"); ok { sourceDBInstanceID := v.(string) input := &rds.CreateDBInstanceReadReplicaInput{ From 682d9918b0e38c35e8dda3a34ba2c09fb3e9a92f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 21 Mar 2024 16:34:38 -0700 Subject: [PATCH 3/7] Adds tests for `character_set_name` on replicas --- internal/service/rds/instance_test.go | 250 ++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index 588e6ae0581..e845ec1cf06 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -2044,6 +2044,95 @@ func TestAccRDSInstance_ReplicateSourceDB_caCertificateIdentifier(t *testing.T) }) } +func TestAccRDSInstance_ReplicateSourceDB_characterSet_Source(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var dbInstance, sourceDbInstance rds.DBInstance + + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + sourceResourceName := "aws_db_instance.source" + resourceName := "aws_db_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.RDSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckInstanceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccInstanceConfig_ReplicateSourceDB_characterSet_Source(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInstanceExists(ctx, sourceResourceName, &sourceDbInstance), + resource.TestCheckResourceAttr(sourceResourceName, "character_set_name", "WE8ISO8859P15"), + testAccCheckInstanceExists(ctx, resourceName, &dbInstance), + resource.TestCheckResourceAttrPair(resourceName, "replicate_source_db", sourceResourceName, "identifier"), + resource.TestCheckResourceAttr(resourceName, "character_set_name", "WE8ISO8859P15"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "final_snapshot_identifier", + "password", + "manage_master_user_password", + "skip_final_snapshot", + "delete_automated_backups", + }, + }, + }, + }) +} + +func TestAccRDSInstance_ReplicateSourceDB_characterSet_Replica(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var dbInstance, sourceDbInstance rds.DBInstance + + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + sourceResourceName := "aws_db_instance.source" + resourceName := "aws_db_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.RDSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckInstanceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccInstanceConfig_ReplicateSourceDB_characterSet_Replica(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInstanceExists(ctx, sourceResourceName, &sourceDbInstance), + resource.TestCheckResourceAttr(sourceResourceName, "character_set_name", "WE8ISO8859P15"), + testAccCheckInstanceExists(ctx, resourceName, &dbInstance), + resource.TestCheckResourceAttrPair(resourceName, "replicate_source_db", sourceResourceName, "identifier"), + resource.TestCheckResourceAttr(resourceName, "character_set_name", "WE8ISO8859P15"), + ), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), + }, + PostApplyPreRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + }, + PostApplyPostRefresh: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), + }, + }, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccRDSInstance_ReplicateSourceDB_replicaMode(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -2191,6 +2280,49 @@ func TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNameEquivale }) } +func TestAccRDSInstance_ReplicateSourceDB_CrossRegion_characterSet(t *testing.T) { + t.Skip("Skipping due to upstream error") + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var dbInstance, sourceDbInstance rds.DBInstance + var providers []*schema.Provider + + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + sourceResourceName := "aws_db_instance.source" + resourceName := "aws_db_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.RDSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), + CheckDestroy: testAccCheckInstanceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccInstanceConfig_ReplicateSourceDB_CrossRegion_CharacterSet(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInstanceExistsWithProvider(ctx, sourceResourceName, &sourceDbInstance, acctest.RegionProviderFunc(acctest.AlternateRegion(), &providers)), + resource.TestCheckResourceAttr(sourceResourceName, "character_set_name", "WE8ISO8859P15"), + testAccCheckInstanceExistsWithProvider(ctx, resourceName, &dbInstance, acctest.RegionProviderFunc(acctest.Region(), &providers)), + resource.TestCheckResourceAttrPair(resourceName, "replicate_source_db", sourceResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "character_set_name", "WE8ISO8859P15"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "password", + }, + }, + }, + }) +} + func TestAccRDSInstance_s3Import(t *testing.T) { acctest.Skip(t, "RestoreDBInstanceFromS3 cannot restore from MySQL version 5.6") @@ -6402,6 +6534,23 @@ func testAccInstanceConfig_orderableClassCustomSQLServerWeb() string { return testAccInstanceConfig_orderableClass("custom-sqlserver-web", "", "gp2") } +func testAccInstanceConfig_orderableClassOracleEnterprise() string { + return fmt.Sprintf(` +data "aws_rds_engine_version" "default" { + engine = %[1]q +} + +data "aws_rds_orderable_db_instance" "test" { + engine = data.aws_rds_engine_version.default.engine + engine_version = data.aws_rds_engine_version.default.version + license_model = %[2]q + storage_type = %[3]q + + preferred_instance_classes = [%[4]s] +} +`, tfrds.InstanceEngineOracleEnterprise, "bring-your-own-license", "gp2", strings.Replace(mainInstanceClasses, "db.t3.small", "frodo", 1)) +} + func testAccInstanceConfig_basic(rName string) string { return acctest.ConfigCompose( testAccInstanceConfig_orderableClassMySQL(), @@ -6971,6 +7120,8 @@ resource "aws_db_instance" "test" { username = "tfacctest" backup_retention_period = 0 + character_set_name = "WE8ISO8859P15" + parameter_group_name = "default.${data.aws_rds_engine_version.default.parameter_group_family}" skip_final_snapshot = true multi_az = false @@ -9599,6 +9750,70 @@ resource "aws_db_instance" "test" { `, rName)) } +func testAccInstanceConfig_ReplicateSourceDB_characterSet_Source(rName string) string { + return acctest.ConfigCompose( + testAccInstanceConfig_orderableClassOracleEnterprise(), + fmt.Sprintf(` +resource "aws_db_instance" "test" { + identifier = %[1]q + replicate_source_db = aws_db_instance.source.identifier + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + skip_final_snapshot = true + apply_immediately = true +} + +resource "aws_db_instance" "source" { + identifier = "%[1]s-source" + allocated_storage = 20 + engine = data.aws_rds_orderable_db_instance.test.engine + engine_version = data.aws_rds_orderable_db_instance.test.engine_version + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + storage_type = data.aws_rds_orderable_db_instance.test.storage_type + db_name = "MAINDB" + username = "oadmin" + password = "avoid-plaintext-passwords" + skip_final_snapshot = true + apply_immediately = true + backup_retention_period = 1 + + character_set_name = "WE8ISO8859P15" +} +`, rName)) +} + +func testAccInstanceConfig_ReplicateSourceDB_characterSet_Replica(rName string) string { + return acctest.ConfigCompose( + testAccInstanceConfig_orderableClassOracleEnterprise(), + fmt.Sprintf(` +resource "aws_db_instance" "test" { + identifier = %[1]q + replicate_source_db = aws_db_instance.source.identifier + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + skip_final_snapshot = true + apply_immediately = true + + character_set_name = "NE8ISO8859P10" +} + +resource "aws_db_instance" "source" { + identifier = "%[1]s-source" + allocated_storage = 20 + engine = data.aws_rds_orderable_db_instance.test.engine + engine_version = data.aws_rds_orderable_db_instance.test.engine_version + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + storage_type = data.aws_rds_orderable_db_instance.test.storage_type + db_name = "MAINDB" + username = "oadmin" + password = "avoid-plaintext-passwords" + skip_final_snapshot = true + apply_immediately = true + backup_retention_period = 1 + + character_set_name = "WE8ISO8859P15" +} +`, rName)) +} + func testAccInstanceConfig_ReplicateSourceDB_replicaMode(rName, replicaMode string) string { return fmt.Sprintf(` data "aws_rds_engine_version" "default" { @@ -9776,6 +9991,41 @@ data "aws_rds_orderable_db_instance" "test" { `, rName, tfrds.InstanceEngineOracleEnterprise, strings.Replace(mainInstanceClasses, "db.t3.small", "frodo", 1), parameters)) } +func testAccInstanceConfig_ReplicateSourceDB_CrossRegion_CharacterSet(rName string) string { + return acctest.ConfigCompose( + acctest.ConfigMultipleRegionProvider(2), + testAccInstanceConfig_orderableClassOracleEnterprise(), fmt.Sprintf(` +resource "aws_db_instance" "test" { + provider = "aws" + + identifier = %[1]q + replicate_source_db = aws_db_instance.source.arn + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + skip_final_snapshot = true + apply_immediately = true +} + +resource "aws_db_instance" "source" { + provider = "awsalternate" + + identifier = "%[1]s-source" + allocated_storage = 20 + engine = data.aws_rds_orderable_db_instance.test.engine + engine_version = data.aws_rds_orderable_db_instance.test.engine_version + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + storage_type = data.aws_rds_orderable_db_instance.test.storage_type + db_name = "MAINDB" + username = "oadmin" + password = "avoid-plaintext-passwords" + skip_final_snapshot = true + apply_immediately = true + backup_retention_period = 1 + + character_set_name = "WE8ISO8859P15" +} +`, rName)) +} + func testAccInstanceConfig_baseMonitoringRole(rName string) string { return fmt.Sprintf(` data "aws_partition" "current" {} From 249fd23541a71cc81de5f26218c4428ab3cf62ea Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 21 Mar 2024 16:48:55 -0700 Subject: [PATCH 4/7] Updates documentation --- website/docs/r/db_instance.html.markdown | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/website/docs/r/db_instance.html.markdown b/website/docs/r/db_instance.html.markdown index f37bf58ba86..2530f640c4a 100644 --- a/website/docs/r/db_instance.html.markdown +++ b/website/docs/r/db_instance.html.markdown @@ -303,10 +303,11 @@ Defaults to true. * `blue_green_update` - (Optional) Enables low-downtime updates using [RDS Blue/Green deployments][blue-green]. See [`blue_green_update`](#blue_green_update) below. * `ca_cert_identifier` - (Optional) The identifier of the CA certificate for the DB instance. -* `character_set_name` - (Optional) The character set name to use for DB -encoding in Oracle and Microsoft SQL instances (collation). This can't be changed. See [Oracle Character Sets -Supported in Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.OracleCharacterSets.html) -or [Server-Level Collation for Microsoft SQL Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.SQLServer.CommonDBATasks.Collation.html) for more information. +* `character_set_name` - (Optional) The character set name to use for DB encoding in Oracle and Microsoft SQL instances (collation). + This can't be changed. + See [Oracle Character Sets Supported in Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.OracleCharacterSets.html) or + [Server-Level Collation for Microsoft SQL Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.SQLServer.CommonDBATasks.Collation.html) for more information. + Cannot be set with `replicate_source_db`, `restore_to_point_in_time`, `s3_import`, or `snapshot_identifier`. * `copy_tags_to_snapshot` – (Optional, boolean) Copy all Instance `tags` to snapshots. Default is `false`. * `custom_iam_instance_profile` - (Optional) The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. * `db_name` - (Optional) The name of the database to create when the DB instance is created. If this parameter is not specified, no database is created in the DB instance. Note that this does not apply for Oracle or SQL Server engines. See the [AWS documentation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/create-db-instance.html) for more details on what applies for those engines. If you are providing an Oracle db name, it needs to be in all upper case. Cannot be specified for a replica. From b99210687ada1b1b960e11418e2de49c6497cd65 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 21 Mar 2024 17:42:55 -0700 Subject: [PATCH 5/7] Removes plan check --- internal/service/rds/instance_test.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index e845ec1cf06..0f7ebabee89 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -2116,18 +2116,6 @@ func TestAccRDSInstance_ReplicateSourceDB_characterSet_Replica(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "replicate_source_db", sourceResourceName, "identifier"), resource.TestCheckResourceAttr(resourceName, "character_set_name", "WE8ISO8859P15"), ), - ConfigPlanChecks: resource.ConfigPlanChecks{ - PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionCreate), - }, - PostApplyPreRefresh: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), - }, - PostApplyPostRefresh: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionReplace), - }, - }, - ExpectNonEmptyPlan: true, }, }, }) From 058bd829c094f7c714dd64289f331726f2680a43 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 21 Mar 2024 17:43:06 -0700 Subject: [PATCH 6/7] Adds CHANGELOG entry --- .changelog/36518.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/36518.txt diff --git a/.changelog/36518.txt b/.changelog/36518.txt new file mode 100644 index 00000000000..c394822277c --- /dev/null +++ b/.changelog/36518.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_db_instance: Adds warning when setting `character_set_name` when `replicate_source_db`, `restore_to_point_in_time`, or `snapshot_identifier` is set +``` From 14e4b87bc967ca69c2d96fede8f834a241bdb5f0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 4 Apr 2024 11:04:55 -0700 Subject: [PATCH 7/7] `terrafmt` --- internal/service/rds/instance_test.go | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index 0f7ebabee89..7945647db6d 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -9743,11 +9743,11 @@ func testAccInstanceConfig_ReplicateSourceDB_characterSet_Source(rName string) s testAccInstanceConfig_orderableClassOracleEnterprise(), fmt.Sprintf(` resource "aws_db_instance" "test" { - identifier = %[1]q - replicate_source_db = aws_db_instance.source.identifier - instance_class = data.aws_rds_orderable_db_instance.test.instance_class - skip_final_snapshot = true - apply_immediately = true + identifier = %[1]q + replicate_source_db = aws_db_instance.source.identifier + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + skip_final_snapshot = true + apply_immediately = true } resource "aws_db_instance" "source" { @@ -9774,11 +9774,11 @@ func testAccInstanceConfig_ReplicateSourceDB_characterSet_Replica(rName string) testAccInstanceConfig_orderableClassOracleEnterprise(), fmt.Sprintf(` resource "aws_db_instance" "test" { - identifier = %[1]q - replicate_source_db = aws_db_instance.source.identifier - instance_class = data.aws_rds_orderable_db_instance.test.instance_class - skip_final_snapshot = true - apply_immediately = true + identifier = %[1]q + replicate_source_db = aws_db_instance.source.identifier + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + skip_final_snapshot = true + apply_immediately = true character_set_name = "NE8ISO8859P10" } @@ -9986,11 +9986,11 @@ func testAccInstanceConfig_ReplicateSourceDB_CrossRegion_CharacterSet(rName stri resource "aws_db_instance" "test" { provider = "aws" - identifier = %[1]q - replicate_source_db = aws_db_instance.source.arn - instance_class = data.aws_rds_orderable_db_instance.test.instance_class - skip_final_snapshot = true - apply_immediately = true + identifier = %[1]q + replicate_source_db = aws_db_instance.source.arn + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + skip_final_snapshot = true + apply_immediately = true } resource "aws_db_instance" "source" {