Skip to content

Commit 5fbd71b

Browse files
committed
Add network configuration for ECS Service
1 parent 1b122a9 commit 5fbd71b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cloud-formation/ecs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ Resources:
2424
Principal:
2525
Service: ecs-tasks.amazonaws.com
2626
Path: /gocapture/
27+
Vpc:
28+
Type: AWS::EC2::VPC
29+
Properties:
30+
CidrBlock: 10.0.0.0/16
31+
SecurityGroup:
32+
Type: AWS::EC2::SecurityGroup
33+
Properties:
34+
GroupName: GoCaptureSecurityGroup
35+
VpcId: !Ref Vpc
36+
PublicSubnet:
37+
Type: AWS::EC2::Subnet
38+
Properties:
39+
VpcId: !Ref Vpc
2740
Cluster:
2841
Type: AWS::ECS::Cluster
2942
Properties:
@@ -34,6 +47,13 @@ Resources:
3447
Cluster: !Ref Cluster
3548
DesiredCount: 1
3649
LaunchType: FARGATE
50+
NetworkConfiguration:
51+
AwsvpcConfiguration:
52+
AssignPublicIp: ENABLED
53+
SecurityGroups:
54+
- !Ref SecurityGroup
55+
Subnets:
56+
- !Ref PublicSubnet
3757
ServiceName: GoCaptureECSService
3858
TaskDefinition: !Ref TaskDefinition
3959
TaskDefinition:

0 commit comments

Comments
 (0)