Skip to content

Commit

Permalink
Cosmetics.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Jul 16, 2024
1 parent a70236a commit 4bb5881
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 43 deletions.
18 changes: 9 additions & 9 deletions internal/service/rds/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,18 @@ func ResourceCluster() *schema.Resource {
validation.StringInSlice(ClusterEngine_Values(), false),
),
},
"engine_mode": {
"engine_lifecycle_support": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: EngineModeProvisioned,
ValidateFunc: validation.StringInSlice(EngineMode_Values(), false),
Computed: true,
ValidateFunc: validation.StringInSlice(engineLifecycleSupport_Values(), false),
},
"engine_lifecycle_support": {
"engine_mode": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(EngineLifecycleSupport_Values(), false),
ForceNew: true,
Default: engineModeProvisioned,
ValidateFunc: validation.StringInSlice(engineMode_Values(), false),
},
names.AttrEngineVersion: {
Type: schema.TypeString,
Expand Down Expand Up @@ -1240,8 +1240,8 @@ 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_mode", dbc.EngineMode)
d.Set("engine_lifecycle_support", dbc.EngineLifecycleSupport)
d.Set("engine_mode", dbc.EngineMode)
clusterSetResourceDataEngineVersionFromCluster(d, dbc)
d.Set(names.AttrHostedZoneID, dbc.HostedZoneId)
d.Set("iam_database_authentication_enabled", dbc.IAMDatabaseAuthenticationEnabled)
Expand Down Expand Up @@ -1303,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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/cluster_migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func resourceClusterResourceV0() *schema.Resource {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: EngineModeProvisioned,
Default: engineModeProvisioned,
},
names.AttrEngineVersion: {
Type: schema.TypeString,
Expand Down
8 changes: 4 additions & 4 deletions internal/service/rds/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +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", tfrds.EngineLifecycleSupport),
resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support"),
resource.TestCheckResourceAttrPair(resourceName, names.AttrEngineVersion, dataSourceName, names.AttrVersion),
),
},
Expand Down Expand Up @@ -2630,7 +2630,7 @@ func TestAccRDSCluster_engineLifecycleSupport_disabled(t *testing.T) {
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", tfrds.EngineLifecycleSupportDisabled),
resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support-disabled"),
),
},
testAccClusterImportStep(resourceName),
Expand Down Expand Up @@ -5262,7 +5262,7 @@ resource "aws_rds_cluster" "test" {
master_username = "tfacctest"
master_password = "avoid-plaintext-passwords"
skip_final_snapshot = true
engine_lifecycle_support = %[3]q
engine_lifecycle_support = "open-source-rds-extended-support-disabled"
}
`, rName, tfrds.ClusterEngineAuroraPostgreSQL, tfrds.EngineLifecycleSupportDisabled)
`, rName, tfrds.ClusterEngineAuroraPostgreSQL)
}
46 changes: 23 additions & 23 deletions internal/service/rds/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,46 +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"
engineLifecycleSupport = "open-source-rds-extended-support"
engineLifecycleSupportDisabled = "open-source-rds-extended-support-disabled"
)

func EngineLifecycleSupport_Values() []string {
func engineLifecycleSupport_Values() []string {
return []string{
EngineLifecycleSupport,
EngineLifecycleSupportDisabled,
engineLifecycleSupport,
engineLifecycleSupportDisabled,
}
}

Expand Down
6 changes: 3 additions & 3 deletions internal/service/rds/global_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +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),
ValidateFunc: validation.StringInSlice(engineLifecycleSupport_Values(), false),
},
names.AttrEngineVersion: {
Type: schema.TypeString,
Expand Down Expand Up @@ -170,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)
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func ResourceInstance() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(EngineLifecycleSupport_Values(), false),
ValidateFunc: validation.StringInSlice(engineLifecycleSupport_Values(), false),
},
names.AttrEngineVersion: {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestAccRDSInstance_engineLifecycleSupport_disabled(t *testing.T) {
testAccCheckInstanceAttributes(&v),
acctest.MatchResourceAttrRegionalARN(resourceName, names.AttrARN, "rds", regexache.MustCompile(`db:.+`)),
resource.TestCheckResourceAttr(resourceName, names.AttrEngine, tfrds.InstanceEngineMySQL),
resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", tfrds.EngineLifecycleSupportDisabled),
resource.TestCheckResourceAttr(resourceName, "engine_lifecycle_support", "open-source-rds-extended-support-disabled"),
resource.TestCheckResourceAttrSet(resourceName, names.AttrEngineVersion),
),
},
Expand Down
2 changes: 1 addition & 1 deletion internal/service/rds/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4bb5881

Please sign in to comment.