I understand that you are trying to figure out how to set the DB_CONNECTION_STRING environment variable for a Fargate container.
If are using CDK to create ECS resources, then you should be able to pass environment variables to the container with your Task definition - https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.TaskDefinition.html
ECS allow you declare environment variables to be populated with secret values from SecretsManager. Since the secret values does not get evaluated until ECS is running the container, there is no good way to inject those values into another string, unless you do it from inside the container. Since MS SQL seems to want to use DB_CONNECTION_STRING containing these details, you would have to either have that connection string stored in secrets manager, or assemble the connection string at your end by generating it from the DBUSER and DBPASS values.
The links below would help shed light into how to achieve your use case - https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-rds.Credentials.html
I hope this information can help achieve your use case.
If the information above does not help, please open a support case with AWS using the following https://console.aws.amazon.com/support/home#/case/create and provide details on the code snippet and also please let us know if you are using CDK to create ECS resources in the support case.
Error loading metadata using AWS SCT against an RDS SQL Server Instanceasked 9 months ago
Deploy updated container to existing CDK stackAccepted Answerasked 3 years ago
No space left on device when deploy ECS Fargate Service with CDKAccepted Answerasked 10 months ago
DMS to migrate SQL Server from RDS to EC2asked 3 years ago
How to create an container image and deploy it to an lambda function using CDK?Accepted Answerasked 3 months ago
Linked server connection from on-prem SQL Server to RDS MySQL?asked 6 days ago
How to use AWS CDK to compile and deploy a typescript api with dependencies to lambda?asked 9 months ago
How can I connect Google Data Studio to an Private AWS RDS Postgres instance?asked 4 months ago
Connect Lightsail instance to AWS instance in a private subnetasked 5 months ago
CDK v1: Deploy RDS SQL Server and use credential in a connection string for fargate docker instanceasked 8 months ago