I'd like to be able to query the ARN of a security group, but queries like aws ec2 describe-security-groups
only provide group IDs. Clearly security groups do have ARNs because API calls like aws datasync create-agent
has options that require security group ARNs.
Clearly security groups do have ARNs because API calls like aws datasync create-agent has options that require security group ARNs.
To get an ARN from the AWS Management Console, navigate to the resource you want an ARN for, and view the details for that resource. For example, you can get the ARN for a DB instance from the Configuration tab of the DB instance details, as shown following.
To view your security groups using the consoleOpen the Amazon VPC console at https://console.aws.amazon.com/vpc/ . In the navigation pane, choose Security Groups. Your security groups are listed. To view the details for a specific security group, including its inbound and outbound rules, select the security group.
The ARN of security groups has known format:
arn:aws:ec2:<region>:<account>:security-group/<sg-group-id>
For example:
arn:aws:ec2:us-east-1:123445667:security-group/sg-11223344551122334
Thus you can always construct it yourself if its not explicitly given by AWS CLI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With