Skip to content

Commit 705b50e

Browse files
committed
add ip addr cfn output
1 parent 9d275f0 commit 705b50e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cdk/cdk/web_stack.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from aws_cdk import Duration, RemovalPolicy, Stack
1+
from aws_cdk import CfnOutput, Duration, RemovalPolicy, Stack
22
from aws_cdk import aws_ec2 as ec2
33
from aws_cdk import aws_iam as iam
44
from aws_cdk import aws_s3 as s3
@@ -102,6 +102,14 @@ def __init__(
102102
instance_id=instance.instance_id,
103103
)
104104

105+
# Output the server IP address
106+
CfnOutput(
107+
self,
108+
"ServerIP",
109+
value=elastic_ip.attr_public_ip,
110+
description="Public IP address of the web server",
111+
)
112+
105113
# S3 bucket for database backups
106114
backup_bucket = s3.Bucket(
107115
self,

0 commit comments

Comments
 (0)