Create a security group to support EFA
communications
You can use the following AWS CLI command to create a security group that supports EFA. The command outputs a security group ID. Make the following replacements:
-
– Specify the AWS Region where you use AWS PCS, such asregion-code
us-east-1
. -
– Specify the ID of the VPC that you use for AWS PCS.vpc-id
-
– Provide your chosen name for the security group.efa-group-name
aws ec2 create-security-group \ --group-name
efa-group-name
\ --description "Security group to enable EFA traffic" \ --vpc-idvpc-id
\ --regionregion-code
Use the following commands to attach inbound and outbound security group rules. Make the following replacement:
-
– Provide the ID of the EFA security group you just created.efa-secgroup-id
aws ec2 authorize-security-group-ingress \
--group-id efa-secgroup-id
\
--protocol -1 \
--source-group efa-secgroup-id
aws ec2 authorize-security-group-egress \
--group-id efa-secgroup-id
\
--protocol -1 \
--source-group efa-secgroup-id