

# Retrieve AWS resource tags for a configuration

You retrieve the tags for a configuration with the `ListTagsForResource` operation, which returns the current tag set for the configuration's ARN. You can retrieve resource tags by using the Amazon S3 console, the AWS CLI, or the AWS SDKs.

## Using the S3 console
<a name="s3-tables-storage-lens-get-tags-console"></a>

In the Amazon S3 console, you view a configuration's tags on the dashboard configuration details page.

**To view a configuration's tags**

1. Sign in to the AWS Management Console and open the Amazon S3 console at [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/).

1. In the left navigation pane, choose **Storage Lens**, and then choose the **Table buckets** tab.

1. Choose the dashboard, and then choose **View dashboard configuration**.

1. In the **General** section, review the tags that are applied to the configuration.

## Using the AWS CLI
<a name="s3-tables-storage-lens-get-tags-cli"></a>

**Example**  
The following example command retrieves the tags for an Amazon S3 Storage Lens for Tables configuration. To use this example, replace the `{{user input placeholders}}` with your own information.  

```
aws s3tables list-tags-for-resource --resource-arn={{arn:aws:s3tables:us-east-1:222222222222:storage-lens/your-configuration-id}}
```

## Using the AWS SDK for Java
<a name="s3-tables-storage-lens-get-tags-sdk-java"></a>

The following example retrieves the tags for an Amazon S3 Storage Lens for Tables configuration in SDK for Java. To use this example, replace the `{{user input placeholders}}` with your own information.

**Example – Get tags for an Amazon S3 Storage Lens for Tables configuration**  

```Java
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3tables.S3TablesClient;
import software.amazon.awssdk.services.s3tables.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.s3tables.model.ListTagsForResourceResponse;

public class GetStorageLensTags {

    public static void main(String[] args) {
        String resourceArn = "{{arn:aws:s3tables:us-east-1:111122223333:storage-lens/your-configuration-id}}";

        try (S3TablesClient s3TablesClient = S3TablesClient.builder()
                .region(Region.{{US_EAST_1}})
                .build()) {

            ListTagsForResourceResponse response = s3TablesClient.listTagsForResource(
                    ListTagsForResourceRequest.builder()
                            .resourceArn(resourceArn)
                            .build());

            System.out.println(response.tags());
        }
    }
}
```