- Newest
- Most votes
- Most comments
The issue you're encountering is not a bug in the Terraform provider, but rather a misunderstanding of how to configure a DMS endpoint for Amazon Redshift Serverless. When creating a DMS target endpoint for Redshift Serverless, you need to use specific settings that differ from a standard Redshift cluster or a PostgreSQL database.
To create a DMS target endpoint for Redshift Serverless, you should make the following changes to your Terraform configuration:
-
Change the
engine_nameto "redshift-serverless" instead of "redshift" or "postgres". -
In the
server_namefield, use the workgroup endpoint. This should be in the format:workgroup-name.account-number.aws-region.redshift-serverless.amazonaws.com. -
Add a
redshift_settingsblock to specify additional Redshift Serverless-specific configurations.
Here's an updated version of your Terraform configuration that should work for creating a DMS target endpoint for Redshift Serverless:
resource "aws_dms_endpoint" "target" { endpoint_id = "corail-cloud-target-redshift-serverless" endpoint_type = "target" engine_name = "redshift-serverless" server_name = aws_redshiftserverless_workgroup.default_workgroup.endpoint[0].address port = 5439 database_name = "corail_database" username = aws_redshiftserverless_namespace.default_namespace.admin_username password = aws_redshiftserverless_namespace.default_namespace.admin_user_password redshift_settings { server_name = aws_redshiftserverless_workgroup.default_workgroup.endpoint[0].address } }
This configuration uses the correct engine name for Redshift Serverless and includes the necessary redshift_settings block. The server_name is specified both in the main resource block and in the redshift_settings block to ensure proper configuration.
By making these changes, you should be able to successfully create a DMS target endpoint for your Redshift Serverless instance using Terraform.
Sources
New features in AWS DMS 3.5.1 | AWS Database Blog
Using an Amazon Redshift database as a target for AWS Database Migration Service - AWS Database Migration Service
Connecting to Amazon Redshift Serverless - Amazon Redshift
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 years ago

Indeed, I just found that I had the wrong engine_name, thanks a lot!