This documentation is for Version 1 of the Amazon CLI only. For documentation related to Version 2 of the Amazon CLI, see the Version 2 User Guide.
CloudWatch Observability Admin examples using Amazon CLI
The following code examples show you how to perform actions and implement common scenarios by using the Amazon Command Line Interface with CloudWatch Observability Admin.
Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.
Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.
Topics
Actions
The following code example shows how to use get-telemetry-evaluation-status-for-organization.
- Amazon CLI
-
To get telemetry onboarding status for the organization
The following
get-telemetry-evaluation-status-for-organizationexample returns the current onboarding status of the telemetry config feature for the organization.aws observabilityadmin get-telemetry-evaluation-status-for-organizationOutput:
{ "Status": "RUNNING" }For more information, see Auditing CloudWatch telemetry configurations
in the Amazon CloudWatch User Guide. -
For API details, see GetTelemetryEvaluationStatusForOrganization
in Amazon CLI Command Reference.
-
The following code example shows how to use get-telemetry-evaluation-status.
- Amazon CLI
-
To get telemetry onboarding status for the account
The following
get-telemetry-evaluation-statusexample returns the current onboarding status of the telemetry config feature in the specified account.aws observabilityadmin get-telemetry-evaluation-statusOutput:
{ "Status": "RUNNING" }For more information, see Auditing CloudWatch telemetry configurations
in the Amazon CloudWatch User Guide. -
For API details, see GetTelemetryEvaluationStatus
in Amazon CLI Command Reference.
-
The following code example shows how to use list-resource-telemetry-for-organization.
- Amazon CLI
-
To retrieve the telemetry configurations for the organization
The following
list-resource-telemetry-for-organizationexample returns a list of telemetry configurations in the organization for Amazon resources supported by telemetry config.aws observabilityadmin list-resource-telemetry-for-organization \ --resource-typesAWS::EC2::InstanceOutput:
{ "TelemetryConfigurations": [ { "AccountIdentifier": "111111111111", "TelemetryConfigurationState": { "Logs": "NotApplicable", "Metrics": "Disabled", "Traces": "NotApplicable" }, "ResourceType": "AWS::EC2::Instance", "ResourceIdentifier": "i-a166400b", "ResourceTags": { "Name": "dev" }, "LastUpdateTimeStamp": 1733168548521 }, { "AccountIdentifier": "222222222222", "TelemetryConfigurationState": { "Logs": "NotApplicable", "Metrics": "Disabled", "Traces": "NotApplicable" }, "ResourceType": "AWS::EC2::Instance", "ResourceIdentifier": "i-b188560f", "ResourceTags": { "Name": "apache" }, "LastUpdateTimeStamp": 1732744260182 } ] }For more information, see Auditing CloudWatch telemetry configurations
in the Amazon CloudWatch User Guide. -
For API details, see ListResourceTelemetryForOrganization
in Amazon CLI Command Reference.
-
The following code example shows how to use list-resource-telemetry.
- Amazon CLI
-
To retrieve the telemetry configurations for the account
The following
list-resource-telemetryexample returns a list of telemetry configurations for Amazon resources supported by telemetry config in the specified account.aws observabilityadmin list-resource-telemetry \ --resource-typesAWS::EC2::InstanceOutput:
{ "TelemetryConfigurations": [ { "AccountIdentifier": "111111111111", "TelemetryConfigurationState": { "Logs": "NotApplicable", "Metrics": "Disabled", "Traces": "NotApplicable" }, "ResourceType": "AWS::EC2::Instance", "ResourceIdentifier": "i-0e979d278b040f856", "ResourceTags": { "Name": "apache" }, "LastUpdateTimeStamp": 1732744260182 } ] }For more information, see Auditing CloudWatch telemetry configurations
in the Amazon CloudWatch User Guide. -
For API details, see ListResourceTelemetry
in Amazon CLI Command Reference.
-
The following code example shows how to use start-telemetry-evaluation-for-organization.
- Amazon CLI
-
To enable the telemetry config feature
The following
start-telemetry-evaluation-for-organizationexample enables the telemetry config feature for the organization.aws observabilityadmin start-telemetry-evaluation-for-organizationThis command produces no output.
For more information, see Turning on CloudWatch telemetry auditing
in the Amazon CloudWatch User Guide. -
For API details, see StartTelemetryEvaluationForOrganization
in Amazon CLI Command Reference.
-
The following code example shows how to use start-telemetry-evaluation.
- Amazon CLI
-
To enable the telemetry config feature
The following
start-telemetry-evaluationexample enables the telemetry config feature in the specified account.aws observabilityadmin start-telemetry-evaluationThis command produces no output.
For more information, see Turning on CloudWatch telemetry auditing
in the Amazon CloudWatch User Guide. -
For API details, see StartTelemetryEvaluation
in Amazon CLI Command Reference.
-
The following code example shows how to use stop-telemetry-evaluation-for-organization.
- Amazon CLI
-
To disable the telemetry config feature
The following
stop-telemetry-evaluation-for-organizationexample disables the telemetry config feature for the organization.aws observabilityadmin stop-telemetry-evaluation-for-organizationThis command produces no output.
For more information, see Turning off CloudWatch telemetry auditing
in the Amazon CloudWatch User Guide. -
For API details, see StopTelemetryEvaluationForOrganization
in Amazon CLI Command Reference.
-
The following code example shows how to use stop-telemetry-evaluation.
- Amazon CLI
-
To disable the telemetry config feature
The following
stop-telemetry-evaluationexample disables the telemetry config feature in the specified account.aws observabilityadmin stop-telemetry-evaluationThis command produces no output.
For more information, see Turning off CloudWatch telemetry auditing
in the Amazon CloudWatch User Guide. -
For API details, see StopTelemetryEvaluation
in Amazon CLI Command Reference.
-