Granting security group Ingress

Next, add a security group rule to allow inbound access on port 80 with the Grant-EC2SecurityGroupIngress cmdlet, using the following commands run in the sequence listed:

$ip1 = new-object Amazon.EC2.Model.IpPermission$ip1.IpProtocol = "tcp"$ip1.FromPort = 80$ip1.ToPort = 80$ip1.IpRanges.Add("0.0.0.0/0")Grant-EC2SecurityGroupIngress -GroupId $groupid -Region "us-east-1" -IpPermissions @($ip1)

Subsequently, run the Get-EC2SecurityGroup cmdlet again and, as the output here indicates, the Ingress permissions get set on the EC2 security group:

We shall be creating an ECS task for WordPress only, but if a MySQL database ...

Get Amazon Fargate Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.