diff --git a/.changelog/37708.txt b/.changelog/37708.txt new file mode 100644 index 000000000000..bd064669db03 --- /dev/null +++ b/.changelog/37708.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/aws_db_instance: Add `engine_lifecycle_support` argument +``` + +```release-note:enhancement +resource/aws_rds_cluster: Add `engine_lifecycle_support` argument +``` + +```release-note:enhancement +resource/aws_rds_global_cluster: Add `engine_lifecycle_support` argument +``` \ No newline at end of file diff --git a/internal/service/rds/cluster.go b/internal/service/rds/cluster.go index 5939cf460245..2a2ad3bc96bf 100644 --- a/internal/service/rds/cluster.go +++ b/internal/service/rds/cluster.go @@ -228,12 +228,18 @@ func ResourceCluster() *schema.Resource { validation.StringInSlice(ClusterEngine_Values(), false), ), }, + "engine_lifecycle_support": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(engineLifecycleSupport_Values(), false), + }, "engine_mode": { Type: schema.TypeString, Optional: true, ForceNew: true, - Default: EngineModeProvisioned, - ValidateFunc: validation.StringInSlice(EngineMode_Values(), false), + Default: engineModeProvisioned, + ValidateFunc: validation.StringInSlice(engineMode_Values(), false), }, names.AttrEngineVersion: { Type: schema.TypeString, @@ -648,6 +654,10 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int input.EnableCloudwatchLogsExports = flex.ExpandStringSet(v.(*schema.Set)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk(names.AttrEngineVersion); ok { input.EngineVersion = aws.String(v.(string)) } @@ -774,6 +784,10 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int input.EnableCloudwatchLogsExports = flex.ExpandStringSet(v.(*schema.Set)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk(names.AttrEngineVersion); ok { input.EngineVersion = aws.String(v.(string)) } @@ -1040,6 +1054,10 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int input.EnableCloudwatchLogsExports = flex.ExpandStringSet(v.(*schema.Set)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk(names.AttrEngineVersion); ok { input.EngineVersion = aws.String(v.(string)) } @@ -1222,6 +1240,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter d.Set("enable_http_endpoint", dbc.HttpEndpointEnabled) d.Set(names.AttrEndpoint, dbc.Endpoint) d.Set(names.AttrEngine, dbc.Engine) + d.Set("engine_lifecycle_support", dbc.EngineLifecycleSupport) d.Set("engine_mode", dbc.EngineMode) clusterSetResourceDataEngineVersionFromCluster(d, dbc) d.Set(names.AttrHostedZoneID, dbc.HostedZoneId) @@ -1284,7 +1303,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter // Fetch and save Global Cluster if engine mode global d.Set("global_cluster_identifier", "") - if aws.StringValue(dbc.EngineMode) == EngineModeGlobal || aws.StringValue(dbc.EngineMode) == EngineModeProvisioned { + if aws.StringValue(dbc.EngineMode) == engineModeGlobal || aws.StringValue(dbc.EngineMode) == engineModeProvisioned { globalCluster, err := FindGlobalClusterByDBClusterARN(ctx, conn, aws.StringValue(dbc.DBClusterArn)) if err == nil { diff --git a/internal/service/rds/cluster_migrate.go b/internal/service/rds/cluster_migrate.go index 89ecf9a30e75..66c8c7c24ad6 100644 --- a/internal/service/rds/cluster_migrate.go +++ b/internal/service/rds/cluster_migrate.go @@ -143,7 +143,7 @@ func resourceClusterResourceV0() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, - Default: EngineModeProvisioned, + Default: engineModeProvisioned, }, names.AttrEngineVersion: { Type: schema.TypeString, diff --git a/internal/service/rds/cluster_test.go b/internal/service/rds/cluster_test.go index 499a95e723dc..8087b8a694bd 100644 --- a/internal/service/rds/cluster_test.go +++ b/internal/service/rds/cluster_test.go @@ -1387,6 +1387,7 @@ func TestAccRDSCluster_engineVersion(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName, &dbCluster), resource.TestCheckResourceAttr(resourceName, names.AttrEngine, tfrds.ClusterEngineAuroraPostgreSQL), + resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support"), resource.TestCheckResourceAttrPair(resourceName, names.AttrEngineVersion, dataSourceName, names.AttrVersion), ), }, @@ -2609,6 +2610,34 @@ func TestAccRDSCluster_NoDeleteAutomatedBackups(t *testing.T) { }) } +func TestAccRDSCluster_engineLifecycleSupport_disabled(t *testing.T) { + ctx := acctest.Context(t) + var dbCluster rds.DBCluster + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_rds_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.RDSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckClusterDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccClusterConfig_engineLifecycleSupport_disabled(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckClusterExists(ctx, resourceName, &dbCluster), + acctest.CheckResourceAttrRegionalARN(resourceName, names.AttrARN, "rds", fmt.Sprintf("cluster:%s", rName)), + resource.TestCheckResourceAttr(resourceName, "backtrack_window", acctest.Ct0), + resource.TestCheckResourceAttr(resourceName, names.AttrClusterIdentifier, rName), + resource.TestCheckResourceAttr(resourceName, names.AttrEngine, tfrds.ClusterEngineAuroraPostgreSQL), + resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support-disabled"), + ), + }, + testAccClusterImportStep(resourceName), + }, + }) +} + func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { return testAccCheckClusterDestroyWithProvider(ctx)(s, acctest.Provider) @@ -5223,3 +5252,17 @@ resource "aws_rds_cluster" "test" { } `, rName) } + +func testAccClusterConfig_engineLifecycleSupport_disabled(rName string) string { + return fmt.Sprintf(` +resource "aws_rds_cluster" "test" { + cluster_identifier = %[1]q + database_name = "test" + engine = %[2]q + master_username = "tfacctest" + master_password = "avoid-plaintext-passwords" + skip_final_snapshot = true + engine_lifecycle_support = "open-source-rds-extended-support-disabled" +} +`, rName, tfrds.ClusterEngineAuroraPostgreSQL) +} diff --git a/internal/service/rds/consts.go b/internal/service/rds/consts.go index 1d3d708af964..fe7e53652715 100644 --- a/internal/service/rds/consts.go +++ b/internal/service/rds/consts.go @@ -158,34 +158,46 @@ func ClusterInstanceEngine_Values() []string { } const ( - GlobalClusterEngineAurora = "aurora" - GlobalClusterEngineAuroraMySQL = "aurora-mysql" - GlobalClusterEngineAuroraPostgreSQL = "aurora-postgresql" + globalClusterEngineAurora = "aurora" + globalClusterEngineAuroraMySQL = "aurora-mysql" + globalClusterEngineAuroraPostgreSQL = "aurora-postgresql" ) -func GlobalClusterEngine_Values() []string { +func globalClusterEngine_Values() []string { return []string{ - GlobalClusterEngineAurora, - GlobalClusterEngineAuroraMySQL, - GlobalClusterEngineAuroraPostgreSQL, + globalClusterEngineAurora, + globalClusterEngineAuroraMySQL, + globalClusterEngineAuroraPostgreSQL, } } const ( - EngineModeGlobal = "global" - EngineModeMultiMaster = "multimaster" - EngineModeParallelQuery = "parallelquery" - EngineModeProvisioned = "provisioned" - EngineModeServerless = "serverless" + engineModeGlobal = "global" + engineModeMultiMaster = "multimaster" + engineModeParallelQuery = "parallelquery" + engineModeProvisioned = "provisioned" + engineModeServerless = "serverless" ) -func EngineMode_Values() []string { +func engineMode_Values() []string { return []string{ - EngineModeGlobal, - EngineModeMultiMaster, - EngineModeParallelQuery, - EngineModeProvisioned, - EngineModeServerless, + engineModeGlobal, + engineModeMultiMaster, + engineModeParallelQuery, + engineModeProvisioned, + engineModeServerless, + } +} + +const ( + engineLifecycleSupport = "open-source-rds-extended-support" + engineLifecycleSupportDisabled = "open-source-rds-extended-support-disabled" +) + +func engineLifecycleSupport_Values() []string { + return []string{ + engineLifecycleSupport, + engineLifecycleSupportDisabled, } } diff --git a/internal/service/rds/global_cluster.go b/internal/service/rds/global_cluster.go index 26f9e54c0e83..56b08ce80395 100644 --- a/internal/service/rds/global_cluster.go +++ b/internal/service/rds/global_cluster.go @@ -64,7 +64,13 @@ func ResourceGlobalCluster() *schema.Resource { Computed: true, ForceNew: true, ConflictsWith: []string{"source_db_cluster_identifier"}, - ValidateFunc: validation.StringInSlice(GlobalClusterEngine_Values(), false), + ValidateFunc: validation.StringInSlice(globalClusterEngine_Values(), false), + }, + "engine_lifecycle_support": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(engineLifecycleSupport_Values(), false), }, names.AttrEngineVersion: { Type: schema.TypeString, @@ -144,6 +150,10 @@ func resourceGlobalClusterCreate(ctx context.Context, d *schema.ResourceData, me input.Engine = aws.String(v.(string)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk(names.AttrEngineVersion); ok { input.EngineVersion = aws.String(v.(string)) } @@ -160,7 +170,7 @@ func resourceGlobalClusterCreate(ctx context.Context, d *schema.ResourceData, me // since we cannot have Engine default after adding SourceDBClusterIdentifier: // InvalidParameterValue: When creating standalone global cluster, value for engineName should be specified if input.Engine == nil && input.SourceDBClusterIdentifier == nil { - input.Engine = aws.String(GlobalClusterEngineAurora) + input.Engine = aws.String(globalClusterEngineAurora) } output, err := conn.CreateGlobalClusterWithContext(ctx, input) @@ -198,6 +208,7 @@ func resourceGlobalClusterRead(ctx context.Context, d *schema.ResourceData, meta d.Set(names.AttrDatabaseName, globalCluster.DatabaseName) d.Set(names.AttrDeletionProtection, globalCluster.DeletionProtection) d.Set(names.AttrEngine, globalCluster.Engine) + d.Set("engine_lifecycle_support", globalCluster.EngineLifecycleSupport) d.Set("global_cluster_identifier", globalCluster.GlobalClusterIdentifier) if err := d.Set("global_cluster_members", flattenGlobalClusterMembers(globalCluster.GlobalClusterMembers)); err != nil { return sdkdiag.AppendErrorf(diags, "setting global_cluster_members: %s", err) diff --git a/internal/service/rds/global_cluster_test.go b/internal/service/rds/global_cluster_test.go index c9eb09b4653a..6b131a36f918 100644 --- a/internal/service/rds/global_cluster_test.go +++ b/internal/service/rds/global_cluster_test.go @@ -119,6 +119,7 @@ func TestAccRDSGlobalCluster_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, names.AttrDatabaseName, ""), resource.TestCheckResourceAttr(resourceName, names.AttrDeletionProtection, acctest.CtFalse), resource.TestCheckResourceAttr(resourceName, names.AttrEngine, "aurora-postgresql"), + resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support"), resource.TestCheckResourceAttrSet(resourceName, names.AttrEngineVersion), resource.TestCheckResourceAttr(resourceName, "global_cluster_identifier", rName), resource.TestMatchResourceAttr(resourceName, "global_cluster_resource_id", regexache.MustCompile(`cluster-.+`)), @@ -230,6 +231,38 @@ func TestAccRDSGlobalCluster_deletionProtection(t *testing.T) { }) } +func TestAccRDSGlobalCluster_engineLifecycleSupport_disabled(t *testing.T) { + ctx := acctest.Context(t) + var globalCluster1 rds.GlobalCluster + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_rds_global_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.RDSServiceID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGlobalClusterConfig_engineLifecycleSupport_disabled(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckGlobalClusterExists(ctx, resourceName, &globalCluster1), + acctest.CheckResourceAttrGlobalARN(resourceName, names.AttrARN, "rds", fmt.Sprintf("global-cluster:%s", rName)), + resource.TestCheckResourceAttr(resourceName, names.AttrDatabaseName, ""), + resource.TestCheckResourceAttr(resourceName, names.AttrEngine, "aurora-postgresql"), + resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support-disabled"), + resource.TestCheckResourceAttrSet(resourceName, names.AttrEngineVersion), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccRDSGlobalCluster_EngineVersion_updateMinor(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -675,6 +708,16 @@ resource "aws_rds_global_cluster" "test" { `, deletionProtection, rName) } +func testAccGlobalClusterConfig_engineLifecycleSupport_disabled(rName string) string { + return fmt.Sprintf(` +resource "aws_rds_global_cluster" "test" { + global_cluster_identifier = %[1]q + engine = "aurora-postgresql" + engine_lifecycle_support = "open-source-rds-extended-support-disabled" +} +`, rName) +} + func testAccGlobalClusterConfig_engineVersion(rName, engine string) string { return fmt.Sprintf(` data "aws_rds_engine_version" "default" { diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 99c3ae6edf53..0c8f681b7595 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -308,6 +308,12 @@ func ResourceInstance() *schema.Resource { return strings.ToLower(value) }, }, + "engine_lifecycle_support": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(engineLifecycleSupport_Values(), false), + }, names.AttrEngineVersion: { Type: schema.TypeString, Optional: true, @@ -1000,6 +1006,10 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in input.DedicatedLogVolume = aws.Bool(v.(bool)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk("iam_database_authentication_enabled"); ok { input.EnableIAMDatabaseAuthentication = aws.Bool(v.(bool)) } @@ -1215,6 +1225,10 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in input.Engine = aws.String(engine) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk(names.AttrEngineVersion); ok { modifyDbInstanceInput.EngineVersion = aws.String(v.(string)) requiresModifyDbInstance = true @@ -1464,6 +1478,10 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in input.Engine = aws.String(v.(string)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk("iam_database_authentication_enabled"); ok { input.EnableIAMDatabaseAuthentication = aws.Bool(v.(bool)) } @@ -1649,6 +1667,10 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in input.EnableCloudwatchLogsExports = flex.ExpandStringSet(v.(*schema.Set)) } + if v, ok := d.GetOk("engine_lifecycle_support"); ok { + input.EngineLifecycleSupport = aws.String(v.(string)) + } + if v, ok := d.GetOk("iam_database_authentication_enabled"); ok { input.EnableIAMDatabaseAuthentication = aws.Bool(v.(bool)) } @@ -1886,6 +1908,7 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta inte } d.Set("enabled_cloudwatch_logs_exports", aws.StringValueSlice(v.EnabledCloudwatchLogsExports)) d.Set(names.AttrEngine, v.Engine) + d.Set("engine_lifecycle_support", v.EngineLifecycleSupport) d.Set("iam_database_authentication_enabled", v.IAMDatabaseAuthenticationEnabled) d.Set(names.AttrIdentifier, v.DBInstanceIdentifier) d.Set("identifier_prefix", create.NamePrefixFromName(aws.StringValue(v.DBInstanceIdentifier))) diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index af96848f9b83..e41a8e8f2b74 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -213,6 +213,50 @@ func TestAccRDSInstance_disappears(t *testing.T) { }) } +func TestAccRDSInstance_engineLifecycleSupport_disabled(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var v rds.DBInstance + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + 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: testAccCheckDBInstanceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccInstanceConfig_engineLifecycleSupport_disabled(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckDBInstanceExists(ctx, resourceName, &v), + testAccCheckInstanceAttributes(&v), + acctest.MatchResourceAttrRegionalARN(resourceName, names.AttrARN, "rds", regexache.MustCompile(`db:.+`)), + resource.TestCheckResourceAttr(resourceName, names.AttrEngine, tfrds.InstanceEngineMySQL), + resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support-disabled"), + resource.TestCheckResourceAttrSet(resourceName, names.AttrEngineVersion), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + names.AttrApplyImmediately, + names.AttrFinalSnapshotIdentifier, + names.AttrPassword, + "manage_master_user_password", + "skip_final_snapshot", + "delete_automated_backups", + }, + }, + }, + }) +} + func TestAccRDSInstance_Versions_onlyMajor(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -6740,6 +6784,31 @@ resource "aws_db_instance" "test" { `) } +func testAccInstanceConfig_engineLifecycleSupport_disabled(rName string) string { + return acctest.ConfigCompose( + testAccInstanceConfig_orderableClassMySQL(), + fmt.Sprintf(` +resource "aws_db_instance" "test" { + identifier = %[1]q + allocated_storage = 10 + backup_retention_period = 0 + engine = data.aws_rds_orderable_db_instance.test.engine + engine_version = data.aws_rds_orderable_db_instance.test.engine_version + engine_lifecycle_support = "open-source-rds-extended-support-disabled" + instance_class = data.aws_rds_orderable_db_instance.test.instance_class + db_name = "test" + parameter_group_name = "default.${data.aws_rds_engine_version.default.parameter_group_family}" + skip_final_snapshot = true + password = "avoid-plaintext-passwords" + username = "tfacctest" + # Maintenance Window is stored in lower case in the API, though not strictly + # documented. Terraform will downcase this to match (as opposed to throw a + # validation error). + maintenance_window = "Fri:09:00-Fri:09:30" +} +`, rName)) +} + func testAccInstanceConfig_majorVersionOnly(rName string) string { return acctest.ConfigCompose( testAccInstanceConfig_orderableClassMySQL(), diff --git a/internal/service/rds/sweep.go b/internal/service/rds/sweep.go index 23218d07aa46..9a88e4e66098 100644 --- a/internal/service/rds/sweep.go +++ b/internal/service/rds/sweep.go @@ -238,7 +238,7 @@ func sweepClusters(region string) error { d.Set(names.AttrDeletionProtection, false) d.Set("skip_final_snapshot", true) - if engineMode := aws.StringValue(v.EngineMode); engineMode == EngineModeGlobal || engineMode == EngineModeProvisioned { + if engineMode := aws.StringValue(v.EngineMode); engineMode == engineModeGlobal || engineMode == engineModeProvisioned { globalCluster, err := FindGlobalClusterByDBClusterARN(ctx, conn, arn) if err != nil { if !tfresource.NotFound(err) { diff --git a/website/docs/r/db_instance.html.markdown b/website/docs/r/db_instance.html.markdown index 5c6c6f9ad926..d18ae8831f03 100644 --- a/website/docs/r/db_instance.html.markdown +++ b/website/docs/r/db_instance.html.markdown @@ -330,6 +330,7 @@ for additional read replica constraints. * `enabled_cloudwatch_logs_exports` - (Optional) Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. For supported values, see the EnableCloudwatchLogsExports.member.N parameter in [API action CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html). * `engine` - (Required unless a `snapshot_identifier` or `replicate_source_db` is provided) The database engine to use. For supported values, see the Engine parameter in [API action CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html). Note that for Amazon Aurora instances the engine must match the [DB cluster](/docs/providers/aws/r/rds_cluster.html)'s engine'. For information on the difference between the available Aurora MySQL engines see [Comparison between Aurora MySQL 1 and Aurora MySQL 2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Updates.20180206.html) in the Amazon RDS User Guide. * `engine_version` - (Optional) The engine version to use. If `auto_minor_version_upgrade` is enabled, you can provide a prefix of the version such as `8.0` (for `8.0.36`). The actual engine version used is returned in the attribute `engine_version_actual`, see [Attribute Reference](#attribute-reference) below. For supported values, see the EngineVersion parameter in [API action CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html). Note that for Amazon Aurora instances the engine version must match the [DB cluster](/docs/providers/aws/r/rds_cluster.html)'s engine version'. +* `engine_lifecycle_support` - (Optional) The life cycle type for this DB instance. This setting applies only to RDS for MySQL and RDS for PostgreSQL. Valid values are `open-source-rds-extended-support`, `open-source-rds-extended-support-disabled`. Default value is `open-source-rds-extended-support`. [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html * `final_snapshot_identifier` - (Optional) The name of your final DB snapshot when this DB instance is deleted. Must be provided if `skip_final_snapshot` is set to `false`. The value must begin with a letter, only contain alphanumeric characters and hyphens, and not end with a hyphen or contain two consecutive hyphens. Must not be provided when deleting a read replica. diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 555949c276a1..76f798c8d2b4 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -232,6 +232,7 @@ This resource supports the following arguments: * `enable_local_write_forwarding` - (Optional) Whether read replicas can forward write operations to the writer DB instance in the DB cluster. By default, write operations aren't allowed on reader DB instances.. See the [User Guide for Aurora](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-write-forwarding.html) for more information. **NOTE:** Local write forwarding requires Aurora MySQL version 3.04 or higher. * `enabled_cloudwatch_logs_exports` - (Optional) Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL). * `engine_mode` - (Optional) Database engine mode. Valid values: `global` (only valid for Aurora MySQL 1.21 and earlier), `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html) for limitations when using `serverless`. +* `engine_lifecycle_support` - (Optional) The life cycle type for this DB instance. This setting is valid for cluster types Aurora DB clusters and Multi-AZ DB clusters. Valid values are `open-source-rds-extended-support`, `open-source-rds-extended-support-disabled`. Default value is `open-source-rds-extended-support`. [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html * `engine_version` - (Optional) Database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value, or by running `aws rds describe-db-engine-versions`. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`. The value can contain a partial version where supported by the API. The actual engine version used is returned in the attribute `engine_version_actual`, , see [Attribute Reference](#attribute-reference) below. * `engine` - (Required) Name of the database engine to be used for this DB cluster. Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`. (Note that `mysql` and `postgres` are Multi-AZ RDS clusters). * `final_snapshot_identifier` - (Optional) Name of your final DB snapshot when this DB cluster is deleted. If omitted, no final snapshot will be made. diff --git a/website/docs/r/rds_global_cluster.html.markdown b/website/docs/r/rds_global_cluster.html.markdown index eaf790883db1..7c8b5d5ae748 100644 --- a/website/docs/r/rds_global_cluster.html.markdown +++ b/website/docs/r/rds_global_cluster.html.markdown @@ -206,6 +206,7 @@ This resource supports the following arguments: * `database_name` - (Optional, Forces new resources) Name for an automatically created database on cluster creation. * `deletion_protection` - (Optional) If the Global Cluster should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`. * `engine` - (Optional, Forces new resources) Name of the database engine to be used for this DB cluster. Terraform will only perform drift detection if a configuration value is provided. Valid values: `aurora`, `aurora-mysql`, `aurora-postgresql`. Defaults to `aurora`. Conflicts with `source_db_cluster_identifier`. +* `engine_lifecycle_support` - (Optional) The life cycle type for this DB instance. This setting applies only to Aurora PostgreSQL-based global databases. Valid values are `open-source-rds-extended-support`, `open-source-rds-extended-support-disabled`. Default value is `open-source-rds-extended-support`. [Using Amazon RDS Extended Support]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/extended-support.html * `engine_version` - (Optional) Engine version of the Aurora global database. The `engine`, `engine_version`, and `instance_class` (on the `aws_rds_cluster_instance`) must together support global databases. See [Using Amazon Aurora global databases](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html) for more information. By upgrading the engine version, Terraform will upgrade cluster members. **NOTE:** To avoid an `inconsistent final plan` error while upgrading, use the `lifecycle` `ignore_changes` for `engine_version` meta argument on the associated `aws_rds_cluster` resource as shown above in [Upgrading Engine Versions](#upgrading-engine-versions) example. * `force_destroy` - (Optional) Enable to remove DB Cluster members from Global Cluster on destroy. Required with `source_db_cluster_identifier`. * `source_db_cluster_identifier` - (Optional) Amazon Resource Name (ARN) to use as the primary DB Cluster of the Global Cluster on creation. Terraform cannot perform drift detection of this value.