# Command examples

> Code examples that show how to use AWS Command Line Interface with AWS.

**Source:** https://docs.aws.amazon.com/cli/latest/userguide/cli_code_examples.html

---

# AWS CLI command examples

The code examples in this topic show you how to use the AWS Command Line Interface with AWS.

*Basics* are code examples that show you how to perform the essential operations within a service.

*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.

*Scenarios* are code examples that show you how to accomplish specific tasks by calling multiple functions within a service or combined with other AWS services.

Some services contain additional example categories that show how
to leverage libraries or functions specific to the service.

###### Services

- 
[ACM](./cli_acm_code_examples.html)

- 
[API Gateway](./cli_api-gateway_code_examples.html)

- 
[API Gateway HTTP and WebSocket API](./cli_apigatewayv2_code_examples.html)

- 
[API Gateway Management API](./cli_apigatewaymanagementapi_code_examples.html)

- 
[App Mesh](./cli_app-mesh_code_examples.html)

- 
[App Runner](./cli_apprunner_code_examples.html)

- 
[AWS AppConfig](./cli_appconfig_code_examples.html)

- 
[Application Auto Scaling](./cli_application-auto-scaling_code_examples.html)

- 
[Application Discovery Service](./cli_application-discovery-service_code_examples.html)

- 
[Application Signals](./cli_application-signals_code_examples.html)

- 
[AppRegistry](./cli_service-catalog-appregistry_code_examples.html)

- 
[Athena](./cli_athena_code_examples.html)

- 
[Amazon EC2 Auto Scaling](./cli_auto-scaling_code_examples.html)

- 
[Auto Scaling Plans](./cli_auto-scaling-plans_code_examples.html)

- 
[AWS Backup](./cli_backup_code_examples.html)

- 
[AWS Batch](./cli_batch_code_examples.html)

- 
[AWS Budgets](./cli_budgets_code_examples.html)

- 
[Amazon Chime](./cli_chime_code_examples.html)

- 
[Cloud Control API](./cli_cloudcontrol_code_examples.html)

- 
[AWS Cloud Map](./cli_servicediscovery_code_examples.html)

- 
[AWS Cloud9](./cli_cloud9_code_examples.html)

- 
[CloudFormation](./cli_cloudformation_code_examples.html)

- 
[CloudFront](./cli_cloudfront_code_examples.html)

- 
[Amazon CloudSearch](./cli_cloudsearch-domain_code_examples.html)

- 
[CloudTrail](./cli_cloudtrail_code_examples.html)

- 
[CloudWatch](./cli_cloudwatch_code_examples.html)

- 
[CloudWatch Logs](./cli_cloudwatch-logs_code_examples.html)

- 
[CloudWatch Network Monitoring](./cli_networkmonitor_code_examples.html)

- 
[CloudWatch Observability Access Monitor](./cli_oam_code_examples.html)

- 
[CloudWatch Observability Admin](./cli_observabilityadmin_code_examples.html)

- 
[CloudWatch Synthetics](./cli_synthetics_code_examples.html)

- 
[CodeArtifact](./cli_codeartifact_code_examples.html)

- 
[CodeBuild](./cli_codebuild_code_examples.html)

- 
[CodeCommit](./cli_codecommit_code_examples.html)

- 
[CodeDeploy](./cli_codedeploy_code_examples.html)

- 
[CodeGuru Reviewer](./cli_codeguru-reviewer_code_examples.html)

- 
[CodePipeline](./cli_codepipeline_code_examples.html)

- 
[AWS CodeStar Notifications](./cli_codestar-notifications_code_examples.html)

- 
[CodeConnections](./cli_codestar-connections_code_examples.html)

- 
[Amazon Cognito Identity](./cli_cognito-identity_code_examples.html)

- 
[Amazon Cognito Identity Provider](./cli_cognito-identity-provider_code_examples.html)

- 
[Amazon Comprehend](./cli_comprehend_code_examples.html)

- 
[Amazon Comprehend Medical](./cli_comprehendmedical_code_examples.html)

- 
[AWS Config](./cli_config-service_code_examples.html)

- 
[Amazon Connect](./cli_connect_code_examples.html)

- 
[AWS Cost and Usage Report](./cli_cost-and-usage-report-service_code_examples.html)

- 
[Cost Explorer Service](./cli_cost-explorer_code_examples.html)

- 
[Firehose](./cli_firehose_code_examples.html)

- 
[Amazon Data Lifecycle Manager](./cli_dlm_code_examples.html)

- 
[AWS Data Pipeline](./cli_data-pipeline_code_examples.html)

- 
[DataSync](./cli_datasync_code_examples.html)

- 
[DAX](./cli_dax_code_examples.html)

- 
[Detective](./cli_detective_code_examples.html)

- 
[Device Farm](./cli_device-farm_code_examples.html)

- 
[Direct Connect](./cli_direct-connect_code_examples.html)

- 
[Directory Service](./cli_directory-service_code_examples.html)

- 
[Directory Service Data](./cli_directory-service-data_code_examples.html)

- 
[AWS DMS](./cli_database-migration-service_code_examples.html)

- 
[Amazon DocumentDB](./cli_docdb_code_examples.html)

- 
[DynamoDB](./cli_dynamodb_code_examples.html)

- 
[DynamoDB Streams](./cli_dynamodb-streams_code_examples.html)

- 
[Amazon EC2](./cli_ec2_code_examples.html)

- 
[Amazon EC2 Instance Connect](./cli_ec2-instance-connect_code_examples.html)

- 
[Amazon ECR](./cli_ecr_code_examples.html)

- 
[Amazon ECR Public](./cli_ecr-public_code_examples.html)

- 
[Amazon ECS](./cli_ecs_code_examples.html)

- 
[Amazon EFS](./cli_efs_code_examples.html)

- 
[Amazon EKS](./cli_eks_code_examples.html)

- 
[Elastic Beanstalk](./cli_elastic-beanstalk_code_examples.html)

- 
[ELB - Version 1](./cli_elastic-load-balancing_code_examples.html)

- 
[ELB - Version 2](./cli_elastic-load-balancing-v2_code_examples.html)

- 
[Elastic Transcoder](./cli_elastic-transcoder_code_examples.html)

- 
[ElastiCache](./cli_elasticache_code_examples.html)

- 
[MediaStore](./cli_mediastore_code_examples.html)

- 
[Amazon EMR](./cli_emr_code_examples.html)

- 
[Amazon EMR on EKS](./cli_emr-containers_code_examples.html)

- 
[EventBridge](./cli_eventbridge_code_examples.html)

- 
[EventBridge Pipes](./cli_pipes_code_examples.html)

- 
[Firewall Manager](./cli_fms_code_examples.html)

- 
[AWS FIS](./cli_fis_code_examples.html)

- 
[Amazon GameLift Servers](./cli_gamelift_code_examples.html)

- 
[Amazon Glacier](./cli_glacier_code_examples.html)

- 
[Global Accelerator](./cli_global-accelerator_code_examples.html)

- 
[AWS Glue](./cli_glue_code_examples.html)

- 
[GuardDuty](./cli_guardduty_code_examples.html)

- 
[AWS Health](./cli_health_code_examples.html)

- 
[HealthImaging](./cli_medical-imaging_code_examples.html)

- 
[HealthLake](./cli_healthlake_code_examples.html)

- 
[HealthOmics](./cli_omics_code_examples.html)

- 
[IAM](./cli_iam_code_examples.html)

- 
[IAM Access Analyzer](./cli_accessanalyzer_code_examples.html)

- 
[Image Builder](./cli_imagebuilder_code_examples.html)

- 
[Incident Manager](./cli_ssm-incidents_code_examples.html)

- 
[Incident Manager Contacts](./cli_ssm-contacts_code_examples.html)

- 
[Amazon Inspector](./cli_inspector2_code_examples.html)

- 
[AWS IoT](./cli_iot_code_examples.html)

- 
[AWS IoT Analytics](./cli_iotanalytics_code_examples.html)

- 
[Device Advisor](./cli_iotdeviceadvisor_code_examples.html)

- 
[AWS IoT data](./cli_iot-data-plane_code_examples.html)

- 
[AWS IoT Events](./cli_iot-events_code_examples.html)

- 
[AWS IoT Events-Data](./cli_iot-events-data_code_examples.html)

- 
[AWS IoT Greengrass](./cli_greengrass_code_examples.html)

- 
[AWS IoT Greengrass V2](./cli_greengrassv2_code_examples.html)

- 
[AWS IoT Jobs SDK release](./cli_iot-jobs-data-plane_code_examples.html)

- 
[AWS IoT SiteWise](./cli_iotsitewise_code_examples.html)

- 
[AWS IoT Things Graph](./cli_iotthingsgraph_code_examples.html)

- 
[AWS IoT Wireless](./cli_iot-wireless_code_examples.html)

- 
[Amazon IVS](./cli_ivs_code_examples.html)

- 
[Amazon IVS Chat](./cli_ivschat_code_examples.html)

- 
[Amazon IVS Real-Time Streaming](./cli_ivs-realtime_code_examples.html)

- 
[Amazon Kendra](./cli_kendra_code_examples.html)

- 
[Kinesis](./cli_kinesis_code_examples.html)

- 
[AWS KMS](./cli_kms_code_examples.html)

- 
[Lake Formation](./cli_lakeformation_code_examples.html)

- 
[Lambda](./cli_lambda_code_examples.html)

- 
[License Manager](./cli_license-manager_code_examples.html)

- 
[Lightsail](./cli_lightsail_code_examples.html)

- 
[Macie](./cli_macie2_code_examples.html)

- 
[Amazon Managed Grafana](./cli_grafana_code_examples.html)

- 
[MediaConnect](./cli_mediaconnect_code_examples.html)

- 
[MediaConvert](./cli_mediaconvert_code_examples.html)

- 
[MediaLive](./cli_medialive_code_examples.html)

- 
[MediaPackage](./cli_mediapackage_code_examples.html)

- 
[MediaPackage VOD](./cli_mediapackage-vod_code_examples.html)

- 
[MediaStore Data Plane](./cli_mediastore-data_code_examples.html)

- 
[MediaTailor](./cli_mediatailor_code_examples.html)

- 
[MemoryDB](./cli_memorydb_code_examples.html)

- 
[Amazon MSK](./cli_kafka_code_examples.html)

- 
[Network Flow Monitor](./cli_networkflowmonitor_code_examples.html)

- 
[Network Manager](./cli_networkmanager_code_examples.html)

- 
[OpenSearch Service](./cli_elasticsearch-service_code_examples.html)

- 
[Organizations](./cli_organizations_code_examples.html)

- 
[AWS Outposts](./cli_outposts_code_examples.html)

- 
[AWS Payment Cryptography](./cli_payment-cryptography_code_examples.html)

- 
[AWS Payment Cryptography Data Plane](./cli_payment-cryptography-data_code_examples.html)

- 
[Amazon Pinpoint](./cli_pinpoint_code_examples.html)

- 
[Amazon Polly](./cli_polly_code_examples.html)

- 
[AWS Price List](./cli_pricing_code_examples.html)

- 
[AWS Private CA](./cli_acm-pca_code_examples.html)

- 
[AWS Proton](./cli_proton_code_examples.html)

- 
[Amazon RDS](./cli_rds_code_examples.html)

- 
[Amazon RDS Data Service](./cli_rds-data_code_examples.html)

- 
[Amazon RDS Performance Insights](./cli_pi_code_examples.html)

- 
[Amazon Redshift](./cli_redshift_code_examples.html)

- 
[Amazon Rekognition](./cli_rekognition_code_examples.html)

- 
[AWS RAM](./cli_ram_code_examples.html)

- 
[Resource Explorer](./cli_resource-explorer-2_code_examples.html)

- 
[Resource Groups](./cli_resource-groups_code_examples.html)

- 
[Resource Groups Tagging API](./cli_resource-groups-tagging-api_code_examples.html)

- 
[RouteÂ 53](./cli_route-53_code_examples.html)

- 
[RouteÂ 53 domain registration](./cli_route-53-domains_code_examples.html)

- 
[Route 53 Profiles](./cli_route53profiles_code_examples.html)

- 
[RouteÂ 53 Resolver](./cli_route53resolver_code_examples.html)

- 
[Amazon S3](./cli_s3_code_examples.html)

- 
[Amazon S3 Control](./cli_s3-control_code_examples.html)

- 
[Secrets Manager](./cli_secrets-manager_code_examples.html)

- 
[Security Hub](./cli_securityhub_code_examples.html)

- 
[Security Lake](./cli_securitylake_code_examples.html)

- 
[AWS Serverless Application Repository](./cli_serverlessapplicationrepository_code_examples.html)

- 
[Service Catalog](./cli_service-catalog_code_examples.html)

- 
[Service Quotas](./cli_service-quotas_code_examples.html)

- 
[Amazon SES](./cli_ses_code_examples.html)

- 
[Shield](./cli_shield_code_examples.html)

- 
[Signer](./cli_signer_code_examples.html)

- 
[Snowball Edge](./cli_snowball_code_examples.html)

- 
[Amazon SNS](./cli_sns_code_examples.html)

- 
[Amazon SQS](./cli_sqs_code_examples.html)

- 
[Storage Gateway](./cli_storage-gateway_code_examples.html)

- 
[AWS STS](./cli_sts_code_examples.html)

- 
[Support](./cli_support_code_examples.html)

- 
[Amazon SWF](./cli_swf_code_examples.html)

- 
[Systems Manager](./cli_ssm_code_examples.html)

- 
[Amazon Textract](./cli_textract_code_examples.html)

- 
[Amazon Transcribe](./cli_transcribe_code_examples.html)

- 
[Amazon Translate](./cli_translate_code_examples.html)

- 
[Trusted Advisor](./cli_trustedadvisor_code_examples.html)

- 
[Verified Permissions](./cli_verifiedpermissions_code_examples.html)

- 
[VPC Lattice](./cli_vpc-lattice_code_examples.html)

- 
[AWS WAF Classic](./cli_waf_code_examples.html)

- 
[AWS WAF Classic Regional](./cli_waf-regional_code_examples.html)

- 
[AWS WAFV2](./cli_wafv2_code_examples.html)

- 
[WorkDocs](./cli_workdocs_code_examples.html)

- 
[Amazon WorkMail](./cli_workmail_code_examples.html)

- 
[Amazon WorkMail Message Flow](./cli_workmailmessageflow_code_examples.html)

- 
[WorkSpaces](./cli_workspaces_code_examples.html)

- 
[X-Ray](./cli_xray_code_examples.html)

 **Javascript is disabled or is unavailable in your browser.**

To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.

[Document Conventions](/general/latest/gr/docconventions.html)

Amazon SNS

ACM