Use GetGroup with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use GetGroup with a CLI

The following code examples show how to use GetGroup.

CLI
AWS CLI

To get information about a resource group

The following get-group example displays details about the specified resource group. To get the query attached to the group, use get-group-query.

aws resource-groups get-group \ --group-name tbq-WebServer

Output:

{ "Group": { "GroupArn": "arn:aws:resource-groups:us-west-2:123456789012:group/tbq-WebServer", "Name": "tbq-WebServer", "Description": "A tag-based query resource group of WebServers." } }
  • For API details, see GetGroup in AWS CLI Command Reference.

PowerShell
Tools for PowerShell

Example 1: This example retrieves resource group as per the group name

Get-RGGroup -GroupName auto-no

Output:

Description GroupArn Name ----------- -------- ---- arn:aws:resource-groups:eu-west-1:123456789012:group/auto-no auto-no
  • For API details, see GetGroup in AWS Tools for PowerShell Cmdlet Reference.