@@ -25,7 +25,10 @@ export const handler = async (event) => {
2525 '/image-processing/task-definition' ,
2626 '/image-processing/subnet-ids' ,
2727 '/image-processing/main-queue-url' ,
28- '/image-processing/db-secret-arn'
28+ '/image-processing/db-secret-arn' ,
29+ '/image-processing/db-endpoint' ,
30+ '/image-processing/SecurityGroupECS' ,
31+ '/image-processing/subnet-ids'
2932 ] ;
3033
3134 const ssmValues = { } ;
@@ -65,8 +68,10 @@ export const handler = async (event) => {
6568 } ) ) ;
6669 const secret = JSON . parse ( secretResp . SecretString || "{}" ) ;
6770
71+ console . log ( ssmValues [ '/image-processing/db-endpoint' ] ) ;
72+
6873 dbEnv = [
69- { name : "MYSQL_HOST" , value : secret . host } ,
74+ { name : "MYSQL_HOST" , value : ssmValues [ '/image-processing/db-endpoint' ] } ,
7075 { name : "MYSQL_USER" , value : secret . username } ,
7176 { name : "MYSQL_PASSWORD" , value : secret . password } ,
7277 { name : "MYSQL_DATABASE" , value : secret . dbname || secret . database || "default" }
@@ -96,8 +101,9 @@ export const handler = async (event) => {
96101 launchType : "FARGATE" ,
97102 networkConfiguration : {
98103 awsvpcConfiguration : {
99- subnets : ssmValues [ '/image-processing/subnet-ids' ] . split ( ',' ) ,
100- assignPublicIp : "ENABLED"
104+ subnets : ssmValues [ '/image-processing/subnet-ids' ] . split ( ',' ) ,
105+ securityGroups : [ ssmValues [ '/image-processing/SecurityGroupECS' ] ] ,
106+ assignPublicIp : "DISABLED"
101107 }
102108 } ,
103109 overrides : {
0 commit comments