Make sure DB credentials are available when running userdata
Some checks failed
AWS Deploy on Push / build (push) Failing after 41s
Some checks failed
AWS Deploy on Push / build (push) Failing after 41s
This commit is contained in:
@@ -275,6 +275,25 @@ class IptvManagerStack(Stack):
|
||||
associate_public_ip_address=True,
|
||||
)
|
||||
|
||||
# Ensure instance depends on SSM parameters being created
|
||||
instance.node.add_dependency(db)
|
||||
ssm_params = [
|
||||
ssm.StringParameter.from_string_parameter_name(
|
||||
self, "DBHostParamRef", "/iptv-manager/DB_HOST"
|
||||
),
|
||||
ssm.StringParameter.from_string_parameter_name(
|
||||
self, "DBNameParamRef", "/iptv-manager/DB_NAME"
|
||||
),
|
||||
ssm.StringParameter.from_string_parameter_name(
|
||||
self, "DBUserParamRef", "/iptv-manager/DB_USER"
|
||||
),
|
||||
ssm.StringParameter.from_string_parameter_name(
|
||||
self, "DBPassParamRef", "/iptv-manager/DB_PASSWORD"
|
||||
),
|
||||
]
|
||||
for param in ssm_params:
|
||||
instance.node.add_dependency(param)
|
||||
|
||||
# Option: 2: Create Elastic IP (not free tier compatible)
|
||||
# eip = ec2.CfnEIP(
|
||||
# self, "IptvManagerEIP",
|
||||
|
||||
Reference in New Issue
Block a user