Find Resources with the AWS CLI

AWSBeginner
Practice Now

Introduction

A reporting team needs to review its finance test settings without changing production or another team's settings. You will find the correct resources, make the list easier to read, and update the export format to CSV.

Complete the workspace and regional-resource labs first. The CLI connection and resources are prepared in a fresh environment; no previous files or credentials are needed. Use Terminal for commands and AWS View above Terminal to observe the changes.

Certification Relevance

Certification Exam task Practice
Cloud Practitioner (CLF-C02) Task 3.1 CLI resource queries and scoped operational inventories.

Lab Overview

Concept diagram: A name prefix selects finance staging settings; a separate update changes the export format to CSV.

Find the Finance Test Settings

In this step, you will narrow a mixed resource list to the finance settings assigned to this review.

The previous lab showed how Region selects a location. Here the prepared default is us-east-1: commands without --region use that location. You can still specify --region us-east-1 explicitly.

A resource inventory is a list of resources. View the prepared parameter inventory:

aws ssm describe-parameters

Look at each Name and Description. Staging is a test environment used before changing production, where normal business work runs. The list includes finance staging, finance production, and HR staging settings. Your two resources start with /labex/inventory/finance/staging/.

The official Console presents parameter metadata as a resource table. Compare its Name and Type columns with the fields returned by describe-parameters. The example names differ; this lab uses String parameters:

Official Parameter Store My parameters table showing resource names and types — Source: AWS Blog — https://aws.amazon.com/blogs/mt/implement-operations-observability-in-landing-zone-environments/.

The list is small enough to scan, but a filter makes your scope clearer. --parameter-filters asks the service to return matching records. Key=Name selects names, Option=BeginsWith matches their beginning, and Values=... supplies that beginning:

aws ssm describe-parameters --parameter-filters Key=Name,Option=BeginsWith,Values=/labex/inventory/finance/staging/

You should see two names: report-format and report-owner. Their order may vary. The filter selects this review’s resources without changing any setting.

A prefix filter selects finance staging and leaves other resources outside the result — Concept diagram: a filter changes the returned list, not the resources. The other settings still exist.

Show Names and Update the Export Format

In this step, you will display just the matching names, then change the finance staging export format.

The response contains more fields than you currently need. --query selects parts of a response; it does not change stored data. In 'Parameters[].Name', Parameters[] means the returned records, and .Name selects their names. Keep the expression in single quotes.

Add that selection to your existing filter:

aws ssm describe-parameters \
  --parameter-filters Key=Name,Option=BeginsWith,Values=/labex/inventory/finance/staging/ \
  --query 'Parameters[].Name'

The response lists the two matching names. The filter chooses resources; the query chooses fields to display.

A field selection displays resource names while the full records remain unchanged — Concept diagram: selecting Name hides other fields from this response; it does not erase them.

For a more compact display, append --output table:

aws ssm describe-parameters \
  --parameter-filters Key=Name,Option=BeginsWith,Values=/labex/inventory/finance/staging/ \
  --query 'Parameters[].Name' \
  --output table

The same two names appear in a table. Only the presentation changes.

Read the exact staging format setting by name:

aws ssm get-parameter --name /labex/inventory/finance/staging/report-format

Find Value: it is json. This is the application's export format, separate from the CLI's JSON response format. The downstream report importer needs CSV, so update that setting:

aws ssm put-parameter \
  --name /labex/inventory/finance/staging/report-format \
  --type String \
  --value csv \
  --overwrite

Read it again:

aws ssm get-parameter --name /labex/inventory/finance/staging/report-format

Its value is now csv. In AWS View, compare finance staging with production and HR. Only the staging report format changed; production remains json, and HR remains xlsx.

Confirm the Settings and Finish the Review

In this step, you will confirm the selected export format and its owning team.

You can also select one field from a single resource. 'Parameter.Value' reads the value inside Parameter; --output text displays it without JSON quotes:

aws ssm get-parameter \
  --name /labex/inventory/finance/staging/report-format \
  --query 'Parameter.Value' \
  --output text

The answer is csv. Confirm who owns this reporting configuration:

aws ssm get-parameter \
  --name /labex/inventory/finance/staging/report-owner \
  --query 'Parameter.Value' \
  --output text

The answer is finance. These are stored values; the earlier metadata listing showed names and descriptions instead.

The two stored values confirm the selected configuration: format csv, owner finance. The other groups remain unchanged. Next, use tags to group resources whose names do not share a prefix.

Summary

You found the finance staging settings, selected useful response fields, and changed only the intended export format. Next, organize resources by owner and environment with tags.

For further reading, see the AWS reference on AWS CLI server-side filters and client-side queries.