1.4 Security Group

A security group controls the traffic that is allowed to reach and leave the resources that it is associated with. For example, after you associate a security group with an EC2 instance, it controls the inbound and outbound traffic for the instance.

Create Security Group

  1. At the VPC management console:

    • Click Security groups.
    • Click Create security group.

    Security Group Console Security Group Console

  2. At the Create security group page, enter the following information:

    • Name tag: security-group-inference-1.
    • Description: Allow SSH to developers. Allow REST API and gRPC calls for inference..
    • VPC: Choose the VPC with tag vpc-inference-1.
    • Click Create security group.

    Create Security Group Create Security Group

    You will need to create 3 inbound rules for this security group. EC2 instance needs to accept SSH connections from developers. Additionally, since you will serve the TensorFlow model with TensorFlow Serving with Docker, EC2 instance will need to accept REST API and gRPC calls at port 8501 and 8500 respectively.

    TypeProtocolPort RangeSourceDescription
    SSHTCP22My IPSSH connection from developers
    Custom TCPTCP8501Anywhere-IPv4REST API calls
    Custom TCPTCP8500Anywhere-IPv4gRPC calls

    Leave the other fields as default and click Create security group.