amazon-web-servicesamazon-ec2

How to set "Name" of security group (AWS EC2)


Creating an EC2 security group through the console allows you to set a "group name" and it automatically provides a "group id".

However the "name" is always blank, unless the security group was generated automatically by elastic beanstalk or another resource.

Is there any way to set this name in the console, otherwise how is it done in the CLI?


Solution

  • You can either edit the name directly in the console or attach a Name tag to your security group.

    Using AWS CLI:

    aws ec2 create-tags --resources <sg_id> --tags Key=Name,Value=Test-Sg