Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Commit 465afe8

Browse files
committed
fix: initialize vars with correct values 🐛
1 parent 3ba4c96 commit 465afe8

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

entire-platform/cloudformation-templates/stack-dev.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,11 @@ Resources:
148148
- Type: s3
149149
Value: !Ref "EnvFileArn"
150150
Environment:
151+
# because they are on the same TaskDefinition, they can communicate
152+
# using `localhost`, otherwise, they would have to go through
153+
# Service to talk to each other, or even through the internet!
151154
- Name: REDIS_HOST
152-
Value: !Ref RedisContainerName
155+
Value: localhost
153156
- Name: PORT
154157
Value: !Ref "ServiceOneContainerPort"
155158
- Name: APP_PREFIX
@@ -186,7 +189,7 @@ Resources:
186189
Value: !Ref "EnvFileArn"
187190
Environment:
188191
- Name: REDIS_HOST
189-
Value: !Ref RedisContainerName
192+
Value: localhost
190193
- Name: PORT
191194
Value: !Ref "ServiceTwoContainerPort"
192195
- Name: APP_PREFIX
@@ -236,6 +239,8 @@ Resources:
236239
Value: !Ref "ServiceThreeContainerPort"
237240
- Name: APP_PREFIX
238241
Value: !Ref "ServiceThreeUriPrefix"
242+
- Name: DB_CONNECTION_STRING
243+
Value: !Sub postgres://postgres:postgres@localhost:5432/${ServiceThreeDatabaseName}
239244
DependsOn:
240245
- ContainerName: !Sub ${ServiceThreeContainerName}-bootstrap
241246
Condition: SUCCESS
@@ -251,6 +256,8 @@ Resources:
251256
- "-c"
252257
- "alembic upgrade head && exit 0"
253258
DependsOn:
259+
# this HEALTHY condition requires that you either specify it in the
260+
# Dockerfile or here in the CloudFormation template
254261
- ContainerName: !Ref PostgresContainerName
255262
Condition: HEALTHY
256263
LogConfiguration:
@@ -302,9 +309,13 @@ Resources:
302309
awslogs-group: !Sub ${EnvTag}-${StackName}
303310
awslogs-region: !Ref "AWS::Region"
304311
awslogs-stream-prefix: !Ref PostgresContainerName
305-
EnvironmentFiles:
306-
- Type: s3
307-
Value: !Ref "EnvFileArn"
312+
Environment:
313+
- Name: POSTGRES_DB
314+
Value: !Ref ServiceThreeDatabaseName
315+
- Name: POSTGRES_USER
316+
Value: postgres
317+
- Name: POSTGRES_PASSWORD
318+
Value: postgres
308319
MountPoints:
309320
- ContainerPath: /var/lib/postgresql/data
310321
SourceVolume: postgres-data

0 commit comments

Comments
 (0)