Use EC2 instance public address (free tier compatible)
Some checks failed
AWS Deploy on Push / build (push) Has been cancelled
Some checks failed
AWS Deploy on Push / build (push) Has been cancelled
This commit is contained in:
@@ -136,15 +136,17 @@ class IptvUpdaterStack(Stack):
|
||||
),
|
||||
security_group=security_group,
|
||||
key_pair=key_pair,
|
||||
role=role
|
||||
role=role,
|
||||
# Option: 1: Enable auto-assign public IP (free tier compatible)
|
||||
associate_public_ip_address=True
|
||||
)
|
||||
|
||||
# Create Elastic IP
|
||||
eip = ec2.CfnEIP(
|
||||
self, "IptvUpdaterEIP",
|
||||
domain="vpc",
|
||||
instance_id=instance.instance_id
|
||||
)
|
||||
# Option: 2: Create Elastic IP (not free tier compatible)
|
||||
# eip = ec2.CfnEIP(
|
||||
# self, "IptvUpdaterEIP",
|
||||
# domain="vpc",
|
||||
# instance_id=instance.instance_id
|
||||
# )
|
||||
|
||||
# Add Cognito User Pool
|
||||
user_pool = cognito.UserPool(
|
||||
@@ -285,7 +287,10 @@ class IptvUpdaterStack(Stack):
|
||||
|
||||
# Outputs
|
||||
CfnOutput(self, "DBEndpoint", value=db.db_instance_endpoint_address)
|
||||
CfnOutput(self, "InstancePublicIP", value=eip.attr_public_ip)
|
||||
# Option: 1: Use EC2 instance public IP (free tier compatible)
|
||||
CfnOutput(self, "InstancePublicIP", value=instance.instance_public_ip)
|
||||
# Option: 2: Use EIP (not free tier compatible)
|
||||
# CfnOutput(self, "InstancePublicIP", value=eip.attr_public_ip)
|
||||
CfnOutput(self, "UserPoolId", value=user_pool.user_pool_id)
|
||||
CfnOutput(self, "UserPoolClientId", value=client.user_pool_client_id)
|
||||
CfnOutput(self, "CognitoDomainUrl",
|
||||
|
||||
Reference in New Issue
Block a user