Skip to content

Commit

Permalink
fixing DMS resources for Db2 naming
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamTylerLynch committed Dec 12, 2023
1 parent 1bb274c commit 5864c5f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions internal/service/dms/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const (
engineNameAzuredb = "azuredb"
engineNameAzureSQLManagedInstance = "azure-sql-managed-instance"
engineNameBabelfish = "babelfish"
engineNameDB2 = "db2"
engineNameDB2zOS = "db2-zos"
engineNameDb2 = "db2"
engineNameDb2zOS = "db2-zos"
engineNameTransfer = "dms-transfer"
engineNameDocDB = "docdb"
engineNameDynamoDB = "dynamodb"
Expand Down Expand Up @@ -71,8 +71,8 @@ func engineName_Values() []string {
engineNameAzuredb,
engineNameAzureSQLManagedInstance,
engineNameBabelfish,
engineNameDB2,
engineNameDB2zOS,
engineNameDb2,
engineNameDb2zOS,
engineNameTransfer,
engineNameDocDB,
engineNameDynamoDB,
Expand Down
6 changes: 3 additions & 3 deletions internal/service/dms/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ func resourceEndpointCreate(ctx context.Context, d *schema.ResourceData, meta in
// Set connection info in top-level namespace as well
expandTopLevelConnectionInfo(d, input)
}
case engineNameDB2, engineNameDB2zOS:
case engineNameDb2, engineNameDb2zOS:
if _, ok := d.GetOk("secrets_manager_arn"); ok {
input.IBMDb2Settings = &dms.IBMDb2Settings{
SecretsManagerAccessRoleArn: aws.String(d.Get("secrets_manager_access_role_arn").(string)),
Expand Down Expand Up @@ -1257,7 +1257,7 @@ func resourceEndpointUpdate(ctx context.Context, d *schema.ResourceData, meta in
expandTopLevelConnectionInfoModify(d, input)
}
}
case engineNameDB2, engineNameDB2zOS:
case engineNameDb2, engineNameDb2zOS:
if d.HasChanges(
"username", "password", "server_name", "port", "database_name", "secrets_manager_access_role_arn",
"secrets_manager_arn") {
Expand Down Expand Up @@ -1571,7 +1571,7 @@ func resourceEndpointSetState(d *schema.ResourceData, endpoint *dms.Endpoint) er
} else {
flattenTopLevelConnectionInfo(d, endpoint)
}
case engineNameDB2, engineNameDB2zOS:
case engineNameDb2, engineNameDb2zOS:
if endpoint.IBMDb2Settings != nil {
d.Set("username", endpoint.IBMDb2Settings.Username)
d.Set("server_name", endpoint.IBMDb2Settings.ServerName)
Expand Down
32 changes: 16 additions & 16 deletions internal/service/dms/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ func TestAccDMSEndpoint_docDB(t *testing.T) {
})
}

func TestAccDMSEndpoint_db2_basic(t *testing.T) {
func TestAccDMSEndpoint_Db2_basic(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_dms_endpoint.test"
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
Expand All @@ -1689,7 +1689,7 @@ func TestAccDMSEndpoint_db2_basic(t *testing.T) {
CheckDestroy: testAccCheckEndpointDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccEndpointConfig_db2(rName),
Config: testAccEndpointConfig_Db2(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckEndpointExists(ctx, resourceName),
resource.TestCheckResourceAttrSet(resourceName, "endpoint_arn"),
Expand All @@ -1702,7 +1702,7 @@ func TestAccDMSEndpoint_db2_basic(t *testing.T) {
ImportStateVerifyIgnore: []string{"password"},
},
{
Config: testAccEndpointConfig_db2Update(rName),
Config: testAccEndpointConfig_Db2Update(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckEndpointExists(ctx, resourceName),
resource.TestCheckResourceAttr(resourceName, "database_name", "tf-test-dms-db-updated"),
Expand All @@ -1718,7 +1718,7 @@ func TestAccDMSEndpoint_db2_basic(t *testing.T) {
})
}

func TestAccDMSEndpoint_db2zOS_basic(t *testing.T) {
func TestAccDMSEndpoint_Db2zOS_basic(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_dms_endpoint.test"
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
Expand All @@ -1730,7 +1730,7 @@ func TestAccDMSEndpoint_db2zOS_basic(t *testing.T) {
CheckDestroy: testAccCheckEndpointDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccEndpointConfig_db2zOS(rName),
Config: testAccEndpointConfig_Db2zOS(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckEndpointExists(ctx, resourceName),
resource.TestCheckResourceAttrSet(resourceName, "endpoint_arn"),
Expand All @@ -1743,7 +1743,7 @@ func TestAccDMSEndpoint_db2zOS_basic(t *testing.T) {
ImportStateVerifyIgnore: []string{"password"},
},
{
Config: testAccEndpointConfig_db2zOSUpdate(rName),
Config: testAccEndpointConfig_Db2zOSUpdate(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckEndpointExists(ctx, resourceName),
resource.TestCheckResourceAttr(resourceName, "database_name", "tf-test-dms-db-updated"),
Expand Down Expand Up @@ -1800,7 +1800,7 @@ func TestAccDMSEndpoint_azureSQLManagedInstance(t *testing.T) {
})
}

func TestAccDMSEndpoint_db2_secretID(t *testing.T) {
func TestAccDMSEndpoint_Db2_secretID(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_dms_endpoint.test"
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
Expand All @@ -1812,7 +1812,7 @@ func TestAccDMSEndpoint_db2_secretID(t *testing.T) {
CheckDestroy: testAccCheckEndpointDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccEndpointConfig_db2SecretID(rName),
Config: testAccEndpointConfig_Db2SecretID(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckEndpointExists(ctx, resourceName),
resource.TestCheckResourceAttrSet(resourceName, "endpoint_arn"),
Expand All @@ -1827,7 +1827,7 @@ func TestAccDMSEndpoint_db2_secretID(t *testing.T) {
})
}

func TestAccDMSEndpoint_db2zOS_secretID(t *testing.T) {
func TestAccDMSEndpoint_Db2zOS_secretID(t *testing.T) {
ctx := acctest.Context(t)
resourceName := "aws_dms_endpoint.test"
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
Expand All @@ -1839,7 +1839,7 @@ func TestAccDMSEndpoint_db2zOS_secretID(t *testing.T) {
CheckDestroy: testAccCheckEndpointDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccEndpointConfig_db2zOSSecretID(rName),
Config: testAccEndpointConfig_Db2zOSSecretID(rName),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckEndpointExists(ctx, resourceName),
resource.TestCheckResourceAttrSet(resourceName, "endpoint_arn"),
Expand Down Expand Up @@ -3982,7 +3982,7 @@ resource "aws_dms_endpoint" "test" {
`, rName)
}

func testAccEndpointConfig_db2(rName string) string {
func testAccEndpointConfig_Db2(rName string) string {
return fmt.Sprintf(`
resource "aws_dms_endpoint" "test" {
database_name = "tf-test-dms-db"
Expand All @@ -4006,7 +4006,7 @@ resource "aws_dms_endpoint" "test" {
`, rName)
}

func testAccEndpointConfig_db2SecretID(rName string) string {
func testAccEndpointConfig_Db2SecretID(rName string) string {
return acctest.ConfigCompose(testAccEndpointConfig_secretBase(rName), fmt.Sprintf(`
resource "aws_dms_endpoint" "test" {
endpoint_id = %[1]q
Expand All @@ -4028,7 +4028,7 @@ resource "aws_dms_endpoint" "test" {
`, rName))
}

func testAccEndpointConfig_db2Update(rName string) string {
func testAccEndpointConfig_Db2Update(rName string) string {
return fmt.Sprintf(`
resource "aws_dms_endpoint" "test" {
database_name = "tf-test-dms-db-updated"
Expand All @@ -4052,7 +4052,7 @@ resource "aws_dms_endpoint" "test" {
`, rName)
}

func testAccEndpointConfig_db2zOS(rName string) string {
func testAccEndpointConfig_Db2zOS(rName string) string {
return fmt.Sprintf(`
resource "aws_dms_endpoint" "test" {
database_name = "tf-test-dms-db"
Expand All @@ -4076,7 +4076,7 @@ resource "aws_dms_endpoint" "test" {
`, rName)
}

func testAccEndpointConfig_db2zOSSecretID(rName string) string {
func testAccEndpointConfig_Db2zOSSecretID(rName string) string {
return acctest.ConfigCompose(testAccEndpointConfig_secretBase(rName), fmt.Sprintf(`
resource "aws_dms_endpoint" "test" {
endpoint_id = %[1]q
Expand All @@ -4098,7 +4098,7 @@ resource "aws_dms_endpoint" "test" {
`, rName))
}

func testAccEndpointConfig_db2zOSUpdate(rName string) string {
func testAccEndpointConfig_Db2zOSUpdate(rName string) string {
return fmt.Sprintf(`
resource "aws_dms_endpoint" "test" {
database_name = "tf-test-dms-db-updated"
Expand Down

0 comments on commit 5864c5f

Please sign in to comment.