Create Security Groups

Since security groups’ inbound and outbound rules are interdependent, you must first create them all with default settings and adjust the rules later.

1. Go to AWS VPC console.

2. In the left sidebar,

  • Choose Security groups.
  • Click Create security group.

0001

3. In the Basic details section,

  • For Security group name, enter fcj-nlb.
  • For Description, enter fcj-nlb.
  • For VPC, choose the VPC named fcj.

0002

Scroll down to the bottom. Click Create security group.

0003

Do the same to add the other security groups. Replace the value of each field using the following tables.

  • For fcj-alb security group.
FieldValue
Security group namefcj-alb
Descriptionfcj-alb
VPCfcj
  • For fcj-ecs-fargate security group.
FieldValue
Security group namefcj-ecs-fargate
Descriptionfcj-ecs-fargate
VPCfcj
  • For fcj-db security group.
FieldValue
Security group namefcj-db
Descriptionfcj-db
VPCfcj
  • For fcj-vpc-endpoint security group.
FieldValue
Security group namefcj-vpc-endpoint
Descriptionfcj-vpc-endpoint
VPCfcj

After completing, you got 5 security groups in total. You next modify their rules.

4. Choose fcj-alb security group. Select Inbound rules tab and then click Edit inbound rules.

0004

5. Follow the table, add inbound rule(s) and then click Save rules.

#TypeProtocolPort rangeSource
1HTTPTCP80Custom - choose security group named fcj-nlb

0005

6. Choose fcj-alb security group. Select Outbound rules tab and then click Edit outbound rules.

0006

7. Follow the table, add outbound rule(s) and then click Save rules.

#TypeProtocolPort rangeDestination
1Custom TCPTCP8080Custom - choose security group named fcj-ecs-fargate

0007

8. Do the same for the other security groups from step 4 to 7.

  • For fcj-nlb security group,

Outbound rule(s)

#TypeProtocolPort rangeDestination
1HTTPTCP80Custom - choose security group named fcj-alb
  • For fcj-ecs-fargate security group,

Inbound rule(s)

#TypeProtocolPort rangeSource
1Custom TCPTCP8080Custom - choose security group named fcj-alb

Outbound rule(s)

#TypeProtocolPort rangeDestination
1PostgreSQLTCP5432Custom - choose security group named fcj-db
2HTTPSTCP443Custom - choose security group named fcj-vpc-endpoint
3HTTPSTCP443Custom - choose S3 prefix list named com.amazonaws.us-east-1.s3 | pl-63a5400a
  • For fcj-db security group,

Inbound rule(s)

#TypeProtocolPort rangeSource
1PostgreSQLTCP5432Custom - choose security group named fcj-ecs-fargate
  • For fcj-vpc-endpoint security group,

Inbound rule(s)

#TypeProtocolPort rangeSource
1HTTPSTCP443Custom - choose security group named fcj-ecs-fargate

Outbound rule(s)

#TypeProtocolPort rangeDestination
1HTTPSTCP443Anywhere-IPv4 - 0.0.0.0/0