diff --git a/aws/config.go b/aws/config.go index fc649c4bedb8..6a98eef736a9 100644 --- a/aws/config.go +++ b/aws/config.go @@ -589,14 +589,6 @@ func (c *Config) Client() (interface{}, error) { s3Config.DisableRestProtocolURICleaning = aws.Bool(true) client.s3connUriCleaningDisabled = s3.New(sess.Copy(s3Config)) - // Handle deprecated endpoint configurations - if c.Endpoints["kinesis_analytics"] != "" { - client.kinesisanalyticsconn = kinesisanalytics.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["kinesis_analytics"])})) - } - if c.Endpoints["r53"] != "" { - route53Config.Endpoint = aws.String(c.Endpoints["r53"]) - } - // Force "global" services to correct regions switch partition { case endpoints.AwsPartitionID: diff --git a/aws/provider.go b/aws/provider.go index 05d8a757b130..955f26f447c5 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -1095,7 +1095,6 @@ func init() { "iotanalytics", "iotevents", "kafka", - "kinesis_analytics", "kinesis", "kinesisanalytics", "kinesisanalyticsv2", @@ -1126,7 +1125,6 @@ func init() { "pricing", "qldb", "quicksight", - "r53", "ram", "rds", "redshift", @@ -1345,10 +1343,6 @@ func endpointsSchema() *schema.Schema { } } - // Since the endpoints attribute is a TypeSet we cannot use ConflictsWith - endpointsAttributes["kinesis_analytics"].Deprecated = "use `endpoints` configuration block `kinesisanalytics` argument instead" - endpointsAttributes["r53"].Deprecated = "use `endpoints` configuration block `route53` argument instead" - return &schema.Schema{ Type: schema.TypeSet, Optional: true, diff --git a/aws/provider_test.go b/aws/provider_test.go index 9a2bd7372732..1b9ace8063b9 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -812,11 +812,6 @@ func TestAccAWSProvider_Endpoints(t *testing.T) { // Initialize each endpoint configuration with matching name and value for _, endpointServiceName := range endpointServiceNames { - // Skip deprecated endpoint configurations as they will override expected values - if endpointServiceName == "kinesis_analytics" || endpointServiceName == "r53" { - continue - } - endpoints.WriteString(fmt.Sprintf("%s = \"http://%s\"\n", endpointServiceName, endpointServiceName)) } @@ -835,34 +830,6 @@ func TestAccAWSProvider_Endpoints(t *testing.T) { }) } -func TestAccAWSProvider_Endpoints_Deprecated(t *testing.T) { - var providers []*schema.Provider - var endpointsDeprecated strings.Builder - - // Initialize each deprecated endpoint configuration with matching name and value - for _, endpointServiceName := range endpointServiceNames { - // Only configure deprecated endpoint configurations - if endpointServiceName != "kinesis_analytics" && endpointServiceName != "r53" { - continue - } - - endpointsDeprecated.WriteString(fmt.Sprintf("%s = \"http://%s\"\n", endpointServiceName, endpointServiceName)) - } - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProviderFactories: testAccProviderFactories(&providers), - CheckDestroy: nil, - Steps: []resource.TestStep{ - { - Config: testAccAWSProviderConfigEndpoints(endpointsDeprecated.String()), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderEndpointsDeprecated(&providers)), - }, - }, - }) -} - func TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock(t *testing.T) { var providers []*schema.Provider @@ -1144,61 +1111,6 @@ func testAccCheckAWSProviderEndpoints(providers *[]*schema.Provider) resource.Te providerClient := provider.Meta().(*AWSClient) for _, endpointServiceName := range endpointServiceNames { - // Skip deprecated endpoint configurations as they will override expected values - if endpointServiceName == "kinesis_analytics" || endpointServiceName == "r53" { - continue - } - - providerClientField := reflect.Indirect(reflect.ValueOf(providerClient)).FieldByNameFunc(endpointFieldNameF(endpointServiceName)) - - if !providerClientField.IsValid() { - return fmt.Errorf("unable to match AWSClient struct field name for endpoint name: %s", endpointServiceName) - } - - actualEndpoint := reflect.Indirect(reflect.Indirect(providerClientField).FieldByName("Config").FieldByName("Endpoint")).String() - expectedEndpoint := fmt.Sprintf("http://%s", endpointServiceName) - - if actualEndpoint != expectedEndpoint { - return fmt.Errorf("expected endpoint (%s) value (%s), got: %s", endpointServiceName, expectedEndpoint, actualEndpoint) - } - } - } - - return nil - } -} - -func testAccCheckAWSProviderEndpointsDeprecated(providers *[]*schema.Provider) resource.TestCheckFunc { - return func(s *terraform.State) error { - if providers == nil { - return fmt.Errorf("no providers initialized") - } - - // Match AWSClient struct field names to endpoint configuration names - endpointFieldNameF := func(endpoint string) func(string) bool { - return func(name string) bool { - switch endpoint { - case "kinesis_analytics": - endpoint = "kinesisanalytics" - } - - return name == fmt.Sprintf("%sconn", endpoint) - } - } - - for _, provider := range *providers { - if provider == nil || provider.Meta() == nil || provider.Meta().(*AWSClient) == nil { - continue - } - - providerClient := provider.Meta().(*AWSClient) - - for _, endpointServiceName := range endpointServiceNames { - // Only check deprecated endpoint configurations - if endpointServiceName != "kinesis_analytics" && endpointServiceName != "r53" { - continue - } - providerClientField := reflect.Indirect(reflect.ValueOf(providerClient)).FieldByNameFunc(endpointFieldNameF(endpointServiceName)) if !providerClientField.IsValid() { diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index f830a489c37a..d24d32605705 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -128,7 +128,6 @@ The Terraform AWS Provider allows the following endpoints to be customized:
iotanalytics
iotevents
kafka
kinesis_analytics
(DEPRECATED Use kinesisanalytics
instead)kinesis
kinesisanalytics
kinesisanalyticsv2
pricing
qldb
quicksight
r53
route53
instead)
ram
rds
redshift