AWS Resource Query

AWS Resource Query

Answers natural-language questions about AWS resources by running only read-only AWS CLI commands and showing the results as tables.

Skill files1 file
SKILL.md632 lines
1
---
2
name: aws-resource-query
3
description: 'Query AWS resources using natural language. Covers EC2, S3, RDS, Lambda, ECS, EKS, Secrets Manager, IAM, VPC, networking, messaging, and more. Strictly read-only — no writes, deletes, or mutations.'
4
---
5
6
# AWS Resource Query
7
8
Answer natural language questions about AWS resources by translating intent into read-only AWS CLI commands. This skill **never** runs commands that create, modify, or delete resources.
9
10
## Safety Contract
11
12
**STRICTLY READ-ONLY.** This skill exclusively uses:
13
- `aws <service> describe-*`
14
- `aws <service> list-*`
15
- `aws <service> get-*`
16
- `aws sts get-caller-identity`
17
- `aws configure get`
18
- `aws resourcegroupstaggingapi get-resources`
19
- `aws ce get-*`
20
- `aws support describe-*`
21
22
**NEVER** run any of the following, regardless of what the user asks:
23
`create-*`, `run-*`, `start-*`, `stop-*`, `reboot-*`, `delete-*`, `terminate-*`, `put-*`, `update-*`, `modify-*`, `attach-*`, `detach-*`, `send-*`, `publish-*`, `invoke-*`, `execute-*`
24
25
If the user's query implies a write action, respond:
26
> "This skill is read-only. I can show you the current state of [resource], but I cannot [create/modify/delete] it. Would you like to see what currently exists?"
27
28
## Workflow
29
30
### Step 1: Parse Intent
31
Identify: target service(s), scope (all / filtered / specific), detail level, and region.
32
33
### Step 2: Confirm Account & Region
34
```bash
35
aws sts get-caller-identity --query '{Account:Account,UserId:UserId}'
36
aws configure get region
37
```
38
Append `--region <region>` to all commands when the user specifies one.
39
40
### Step 3: Execute & Format
41
Run the matched read-only command(s) below and format results as a readable table. For large result sets show a count first and offer to filter further.
42
43
---
44
45
## Intent → Command Mapping
46
47
### COMPUTE
48
49
#### EC2 Instances
50
```bash
51
# "list EC2 instances" / "show my VMs" / "what instances are running"
52
aws ec2 describe-instances \
53
--query 'Reservations[].Instances[].[InstanceId,InstanceType,State.Name,Tags[?Key==`Name`].Value|[0],PrivateIpAddress,PublicIpAddress]' \
54
--output table
55
56
# "running instances only"
57
aws ec2 describe-instances --filters Name=instance-state-name,Values=running \
58
--query 'Reservations[].Instances[].[InstanceId,InstanceType,Tags[?Key==`Name`].Value|[0],PrivateIpAddress]' \
59
--output table
60
61
# "stopped instances"
62
aws ec2 describe-instances --filters Name=instance-state-name,Values=stopped \
63
--query 'Reservations[].Instances[].[InstanceId,InstanceType,Tags[?Key==`Name`].Value|[0]]' \
64
--output table
65
66
# "instance types in use"
67
aws ec2 describe-instances --query 'Reservations[].Instances[].InstanceType' --output text | sort | uniq -c | sort -rn
68
69
# "auto scaling groups" / "ASGs"
70
aws autoscaling describe-auto-scaling-groups \
71
--query 'AutoScalingGroups[].[AutoScalingGroupName,MinSize,MaxSize,DesiredCapacity]' --output table
72
73
# "elastic IPs" / "EIPs"
74
aws ec2 describe-addresses \
75
--query 'Addresses[].[PublicIp,InstanceId,AllocationId,AssociationId]' --output table
76
77
# "key pairs"
78
aws ec2 describe-key-pairs \
79
--query 'KeyPairs[].[KeyName,CreateTime]' --output table
80
81
# "AMIs I own"
82
aws ec2 describe-images --owners self \
83
--query 'Images[].[ImageId,Name,CreationDate,State]' --output table
84
85
# "spot instances"
86
aws ec2 describe-spot-instance-requests \
87
--query 'SpotInstanceRequests[].[SpotInstanceRequestId,State,InstanceId,LaunchSpecification.InstanceType]' --output table
88
```
89
90
#### Lambda Functions
91
```bash
92
# "list Lambda functions" / "show serverless functions"
93
aws lambda list-functions \
94
--query 'Functions[].[FunctionName,Runtime,MemorySize,Timeout,LastModified]' --output table
95
96
# "Lambda function details for <name>"
97
aws lambda get-function-configuration --function-name <name>
98
99
# "Lambda event source mappings" / "Lambda triggers"
100
aws lambda list-event-source-mappings \
101
--query 'EventSourceMappings[].[FunctionArn,EventSourceArn,State,BatchSize]' --output table
102
103
# "Lambda layers"
104
aws lambda list-layers \
105
--query 'Layers[].[LayerName,LatestMatchingVersion.LayerVersionArn]' --output table
106
107
# "Lambda concurrency for <name>"
108
aws lambda get-function-concurrency --function-name <name>
109
```
110
111
#### ECS
112
```bash
113
# "ECS clusters"
114
aws ecs list-clusters --query 'clusterArns' --output table
115
116
# "ECS cluster details"
117
aws ecs describe-clusters \
118
--clusters $(aws ecs list-clusters --query 'clusterArns[]' --output text) \
119
--query 'clusters[].[clusterName,status,runningTasksCount,activeServicesCount]' --output table
120
121
# "ECS services in <cluster>"
122
aws ecs describe-services --cluster <cluster> \
123
--services $(aws ecs list-services --cluster <cluster> --query 'serviceArns[]' --output text) \
124
--query 'services[].[serviceName,status,runningCount,desiredCount]' --output table
125
126
# "ECS task definitions"
127
aws ecs list-task-definitions --query 'taskDefinitionArns' --output table
128
```
129
130
#### EKS
131
```bash
132
# "EKS clusters" / "Kubernetes clusters"
133
aws eks list-clusters --query 'clusters' --output table
134
135
# "EKS cluster details for <name>"
136
aws eks describe-cluster --name <name> \
137
--query 'cluster.[name,status,version,endpoint]'
138
139
# "EKS node groups for <cluster>"
140
aws eks list-nodegroups --cluster-name <name> --query 'nodegroups' --output table
141
142
# "EKS add-ons for <cluster>"
143
aws eks list-addons --cluster-name <name> --query 'addons' --output table
144
```
145
146
#### Other Compute
147
```bash
148
# "Beanstalk environments"
149
aws elasticbeanstalk describe-environments \
150
--query 'Environments[].[EnvironmentName,ApplicationName,Status,Health]' --output table
151
152
# "Batch job queues"
153
aws batch describe-job-queues \
154
--query 'jobQueues[].[jobQueueName,state,status,priority]' --output table
155
156
# "Batch compute environments"
157
aws batch describe-compute-environments \
158
--query 'computeEnvironments[].[computeEnvironmentName,type,state,status]' --output table
159
```
160
161
---
162
163
### STORAGE
164
165
#### S3
166
```bash
167
# "list S3 buckets" / "show my buckets"
168
aws s3api list-buckets --query 'Buckets[].[Name,CreationDate]' --output table
169
170
# "S3 bucket encryption for <name>"
171
aws s3api get-bucket-encryption --bucket <name>
172
173
# "S3 bucket versioning for <name>"
174
aws s3api get-bucket-versioning --bucket <name>
175
176
# "S3 public access settings for <name>"
177
aws s3api get-public-access-block --bucket <name>
178
179
# "S3 lifecycle rules for <name>"
180
aws s3api get-bucket-lifecycle-configuration --bucket <name>
181
182
# "S3 bucket policy for <name>"
183
aws s3api get-bucket-policy --bucket <name>
184
185
# "list objects in s3://<bucket>/<prefix>"
186
aws s3api list-objects-v2 --bucket <bucket> --prefix <prefix> \
187
--query 'Contents[].[Key,Size,LastModified,StorageClass]' --output table
188
```
189
190
#### EBS & EFS
191
```bash
192
# "EBS volumes" / "list volumes"
193
aws ec2 describe-volumes \
194
--query 'Volumes[].[VolumeId,Size,VolumeType,State,AvailabilityZone,Attachments[0].InstanceId]' --output table
195
196
# "unattached EBS volumes" / "unused volumes"
197
aws ec2 describe-volumes --filters Name=status,Values=available \
198
--query 'Volumes[].[VolumeId,Size,VolumeType,CreateTime]' --output table
199
200
# "EBS snapshots I own"
201
aws ec2 describe-snapshots --owner-ids self \
202
--query 'Snapshots[].[SnapshotId,VolumeId,State,StartTime]' --output table
203
204
# "EFS file systems"
205
aws efs describe-file-systems \
206
--query 'FileSystems[].[FileSystemId,Name,LifeCycleState,SizeInBytes.Value,ThroughputMode]' --output table
207
```
208
209
---
210
211
### DATABASES
212
213
#### RDS
214
```bash
215
# "list RDS instances" / "show databases" / "what databases do I have"
216
aws rds describe-db-instances \
217
--query 'DBInstances[].[DBInstanceIdentifier,DBInstanceClass,Engine,EngineVersion,DBInstanceStatus,MultiAZ,Endpoint.Address]' \
218
--output table
219
220
# "Aurora clusters" / "RDS clusters"
221
aws rds describe-db-clusters \
222
--query 'DBClusters[].[DBClusterIdentifier,Engine,EngineVersion,Status,MultiAZ,Endpoint]' --output table
223
224
# "RDS snapshots"
225
aws rds describe-db-snapshots \
226
--query 'DBSnapshots[].[DBSnapshotIdentifier,DBInstanceIdentifier,Engine,Status,SnapshotCreateTime]' --output table
227
228
# "RDS parameter groups"
229
aws rds describe-db-parameter-groups \
230
--query 'DBParameterGroups[].[DBParameterGroupName,DBParameterGroupFamily]' --output table
231
232
# "RDS subnet groups"
233
aws rds describe-db-subnet-groups \
234
--query 'DBSubnetGroups[].[DBSubnetGroupName,VpcId]' --output table
235
```
236
237
#### DynamoDB
238
```bash
239
# "DynamoDB tables" / "list NoSQL tables"
240
aws dynamodb list-tables --query 'TableNames' --output table
241
242
# "DynamoDB table details for <name>"
243
aws dynamodb describe-table --table-name <name> \
244
--query 'Table.[TableName,TableStatus,ItemCount,BillingModeSummary.BillingMode]'
245
246
# "DynamoDB backups"
247
aws dynamodb list-backups \
248
--query 'BackupSummaries[].[TableName,BackupName,BackupStatus,BackupCreationDateTime]' --output table
249
250
# "DynamoDB global tables"
251
aws dynamodb list-global-tables \
252
--query 'GlobalTables[].[GlobalTableName,ReplicationGroup[].RegionName]' --output table
253
```
254
255
#### ElastiCache & Redshift
256
```bash
257
# "ElastiCache clusters" / "Redis clusters"
258
aws elasticache describe-cache-clusters \
259
--query 'CacheClusters[].[CacheClusterId,Engine,EngineVersion,CacheNodeType,CacheClusterStatus]' --output table
260
261
# "ElastiCache replication groups"
262
aws elasticache describe-replication-groups \
263
--query 'ReplicationGroups[].[ReplicationGroupId,Status,AutomaticFailover]' --output table
264
265
# "Redshift clusters" / "data warehouse"
266
aws redshift describe-clusters \
267
--query 'Clusters[].[ClusterIdentifier,ClusterStatus,NodeType,NumberOfNodes,Endpoint.Address]' --output table
268
269
# "DocumentDB clusters"
270
aws docdb describe-db-clusters \
271
--query 'DBClusters[].[DBClusterIdentifier,Status,Engine,Endpoint]' --output table
272
273
# "Neptune clusters" / "graph databases"
274
aws neptune describe-db-clusters \
275
--query 'DBClusters[].[DBClusterIdentifier,Status,Engine,Endpoint]' --output table
276
```
277
278
---
279
280
### NETWORKING
281
282
#### VPC & Subnets
283
```bash
284
# "list VPCs" / "show my VPCs"
285
aws ec2 describe-vpcs \
286
--query 'Vpcs[].[VpcId,CidrBlock,IsDefault,Tags[?Key==`Name`].Value|[0],State]' --output table
287
288
# "subnets" / "list subnets"
289
aws ec2 describe-subnets \
290
--query 'Subnets[].[SubnetId,VpcId,CidrBlock,AvailabilityZone,MapPublicIpOnLaunch,Tags[?Key==`Name`].Value|[0]]' --output table
291
292
# "public subnets"
293
aws ec2 describe-subnets --filters "Name=mapPublicIpOnLaunch,Values=true" \
294
--query 'Subnets[].[SubnetId,VpcId,CidrBlock,AvailabilityZone]' --output table
295
296
# "security groups"
297
aws ec2 describe-security-groups \
298
--query 'SecurityGroups[].[GroupId,GroupName,VpcId,Description]' --output table
299
300
# "security group rules for <group-id>"
301
aws ec2 describe-security-group-rules --filters "Name=group-id,Values=<id>" \
302
--query 'SecurityGroupRules[].[IsEgress,IpProtocol,FromPort,ToPort,CidrIpv4,Description]' --output table
303
304
# "route tables"
305
aws ec2 describe-route-tables \
306
--query 'RouteTables[].[RouteTableId,VpcId,Associations[0].SubnetId,Tags[?Key==`Name`].Value|[0]]' --output table
307
308
# "internet gateways" / "IGWs"
309
aws ec2 describe-internet-gateways \
310
--query 'InternetGateways[].[InternetGatewayId,Attachments[0].VpcId,Tags[?Key==`Name`].Value|[0]]' --output table
311
312
# "NAT gateways"
313
aws ec2 describe-nat-gateways \
314
--query 'NatGateways[].[NatGatewayId,VpcId,SubnetId,State,NatGatewayAddresses[0].PublicIp]' --output table
315
316
# "VPC endpoints"
317
aws ec2 describe-vpc-endpoints \
318
--query 'VpcEndpoints[].[VpcEndpointId,VpcId,ServiceName,State,VpcEndpointType]' --output table
319
320
# "VPC peering connections"
321
aws ec2 describe-vpc-peering-connections \
322
--query 'VpcPeeringConnections[].[VpcPeeringConnectionId,Status.Code,RequesterVpcInfo.VpcId,AccepterVpcInfo.VpcId]' --output table
323
324
# "NACLs" / "network ACLs"
325
aws ec2 describe-network-acls \
326
--query 'NetworkAcls[].[NetworkAclId,VpcId,IsDefault]' --output table
327
328
# "Transit Gateways"
329
aws ec2 describe-transit-gateways \
330
--query 'TransitGateways[].[TransitGatewayId,State,Description]' --output table
331
```
332
333
#### Load Balancers & DNS
334
```bash
335
# "load balancers" / "ALBs" / "NLBs"
336
aws elbv2 describe-load-balancers \
337
--query 'LoadBalancers[].[LoadBalancerName,Type,Scheme,State.Code,DNSName]' --output table
338
339
# "target groups"
340
aws elbv2 describe-target-groups \
341
--query 'TargetGroups[].[TargetGroupName,Protocol,Port,TargetType,VpcId]' --output table
342
343
# "target health for <target-group-arn>"
344
aws elbv2 describe-target-health --target-group-arn <arn> \
345
--query 'TargetHealthDescriptions[].[Target.Id,TargetHealth.State,TargetHealth.Description]' --output table
346
347
# "Route 53 hosted zones" / "DNS zones"
348
aws route53 list-hosted-zones \
349
--query 'HostedZones[].[Id,Name,Config.PrivateZone,ResourceRecordSetCount]' --output table
350
351
# "DNS records in zone <id>"
352
aws route53 list-resource-record-sets --hosted-zone-id <id> \
353
--query 'ResourceRecordSets[].[Name,Type,TTL]' --output table
354
355
# "CloudFront distributions"
356
aws cloudfront list-distributions \
357
--query 'DistributionList.Items[].[Id,DomainName,Status,Origins.Items[0].DomainName]' --output table
358
359
# "VPN connections"
360
aws ec2 describe-vpn-connections \
361
--query 'VpnConnections[].[VpnConnectionId,State,Type,CustomerGatewayId]' --output table
362
363
# "Direct Connect connections"
364
aws directconnect describe-connections \
365
--query 'connections[].[connectionId,connectionName,connectionState,bandwidth]' --output table
366
```
367
368
---
369
370
### SECURITY & IDENTITY
371
372
#### IAM
373
```bash
374
# "IAM users" / "list users"
375
aws iam list-users \
376
--query 'Users[].[UserName,UserId,CreateDate,PasswordLastUsed]' --output table
377
378
# "IAM roles" / "list roles"
379
aws iam list-roles \
380
--query 'Roles[].[RoleName,RoleId,CreateDate]' --output table
381
382
# "IAM policies attached to role <name>"
383
aws iam list-attached-role-policies --role-name <name> \
384
--query 'AttachedPolicies[].[PolicyName,PolicyArn]' --output table
385
386
# "IAM groups"
387
aws iam list-groups \
388
--query 'Groups[].[GroupName,GroupId,CreateDate]' --output table
389
390
# "IAM policies (customer managed)"
391
aws iam list-policies --scope Local \
392
--query 'Policies[].[PolicyName,AttachmentCount,CreateDate]' --output table
393
394
# "who has MFA enabled" / "MFA devices"
395
aws iam list-virtual-mfa-devices \
396
--query 'VirtualMFADevices[].[SerialNumber,User.UserName,EnableDate]' --output table
397
398
# "IAM account password policy"
399
aws iam get-account-password-policy
400
401
# "IAM account summary"
402
aws iam get-account-summary
403
```
404
405
#### Secrets Manager
406
```bash
407
# "list secrets" / "Secrets Manager secrets" / "show secrets"
408
aws secretsmanager list-secrets \
409
--query 'SecretList[].[Name,ARN,LastChangedDate,LastAccessedDate,Description]' --output table
410
411
# "secret metadata for <name>"
412
aws secretsmanager describe-secret --secret-id <name> \
413
--query '{Name:Name,ARN:ARN,RotationEnabled:RotationEnabled,LastRotatedDate:LastRotatedDate,Tags:Tags}'
414
415
# "secrets with rotation enabled"
416
aws secretsmanager list-secrets \
417
--query 'SecretList[?RotationEnabled==`true`].[Name,LastRotatedDate]' --output table
418
```
419
420
> ⚠️ **Note**: Secret **values** are never retrieved (`get-secret-value` is excluded). Only metadata is shown.
421
422
#### SSM Parameter Store
423
```bash
424
# "SSM parameters" / "Parameter Store"
425
aws ssm describe-parameters \
426
--query 'Parameters[].[Name,Type,LastModifiedDate,Description]' --output table
427
428
# "SSM parameters by path <path>"
429
aws ssm describe-parameters \
430
--parameter-filters "Key=Path,Values=<path>" \
431
--query 'Parameters[].[Name,Type,LastModifiedDate]' --output table
432
```
433
434
> ⚠️ **Note**: Parameter **values** are never retrieved (`get-parameter` is excluded). Only metadata is shown.
435
436
#### KMS & Certificates
437
```bash
438
# "KMS keys" / "encryption keys"
439
aws kms list-keys --query 'Keys[].[KeyId,KeyArn]' --output table
440
441
# "KMS key details for <id>"
442
aws kms describe-key --key-id <id> \
443
--query 'KeyMetadata.[KeyId,Description,KeyState,KeyUsage,CreationDate,Enabled]'
444
445
# "KMS aliases"
446
aws kms list-aliases \
447
--query 'Aliases[].[AliasName,AliasArn,TargetKeyId]' --output table
448
449
# "SSL certificates" / "ACM certificates"
450
aws acm list-certificates \
451
--query 'CertificateSummaryList[].[CertificateArn,DomainName,Status,RenewalEligibility]' --output table
452
453
# "certificate details for <arn>"
454
aws acm describe-certificate --certificate-arn <arn> \
455
--query 'Certificate.[DomainName,Status,NotAfter,NotBefore,InUseBy]'
456
```
457
458
#### GuardDuty, Security Hub & Config
459
```bash
460
# "GuardDuty detectors"
461
aws guardduty list-detectors --query 'DetectorIds' --output table
462
463
# "GuardDuty findings"
464
aws guardduty list-findings --detector-id <id> --query 'FindingIds' --output table
465
466
# "Security Hub findings"
467
aws securityhub get-findings \
468
--query 'Findings[].[Title,Severity.Label,WorkflowState,UpdatedAt]' --output table
469
470
# "AWS Config rules"
471
aws configservice describe-config-rules \
472
--query 'ConfigRules[].[ConfigRuleName,ConfigRuleState,Source.SourceIdentifier]' --output table
473
474
# "non-compliant resources"
475
aws configservice get-compliance-summary-by-config-rule \
476
--query 'ComplianceSummariesByConfigRule[].[ConfigRuleName,Compliance.ComplianceType]' --output table
477
```
478
479
---
480
481
### MESSAGING & EVENTS
482
483
```bash
484
# "SQS queues" / "list queues"
485
aws sqs list-queues --query 'QueueUrls' --output table
486
487
# "SQS queue details / message count for <url>"
488
aws sqs get-queue-attributes --queue-url <url> \
489
--attribute-names ApproximateNumberOfMessages,ApproximateNumberOfMessagesNotVisible,ApproximateAgeOfOldestMessage
490
491
# "SNS topics"
492
aws sns list-topics --query 'Topics[].TopicArn' --output table
493
494
# "SNS subscriptions"
495
aws sns list-subscriptions \
496
--query 'Subscriptions[].[SubscriptionArn,Protocol,Endpoint,TopicArn]' --output table
497
498
# "EventBridge rules"
499
aws events list-rules \
500
--query 'Rules[].[Name,State,ScheduleExpression,EventPattern]' --output table
501
502
# "EventBridge event buses"
503
aws events list-event-buses \
504
--query 'EventBuses[].[Name,Arn]' --output table
505
506
# "Kinesis streams"
507
aws kinesis list-streams --query 'StreamNames' --output table
508
509
# "Kinesis Firehose delivery streams"
510
aws firehose list-delivery-streams --query 'DeliveryStreamNames' --output table
511
```
512
513
---
514
515
### API GATEWAY & SERVERLESS
516
517
```bash
518
# "API Gateway APIs" / "REST APIs"
519
aws apigateway get-rest-apis \
520
--query 'items[].[id,name,description,createdDate]' --output table
521
522
# "HTTP APIs" / "API Gateway v2"
523
aws apigatewayv2 get-apis \
524
--query 'Items[].[ApiId,Name,ProtocolType,ApiEndpoint,CreatedDate]' --output table
525
526
# "Step Functions state machines" / "workflows"
527
aws stepfunctions list-state-machines \
528
--query 'stateMachines[].[name,stateMachineArn,type,creationDate]' --output table
529
530
# "Step Functions executions for <arn>"
531
aws stepfunctions list-executions --state-machine-arn <arn> \
532
--query 'executions[].[name,status,startDate,stopDate]' --output table
533
```
534
535
---
536
537
### MONITORING & OBSERVABILITY
538
539
```bash
540
# "CloudWatch alarms" / "list alarms"
541
aws cloudwatch describe-alarms \
542
--query 'MetricAlarms[].[AlarmName,StateValue,MetricName,Namespace,Threshold]' --output table
543
544
# "alarms in ALARM state" / "triggered alarms"
545
aws cloudwatch describe-alarms --state-value ALARM \
546
--query 'MetricAlarms[].[AlarmName,MetricName,StateReason]' --output table
547
548
# "CloudWatch dashboards"
549
aws cloudwatch list-dashboards \
550
--query 'DashboardEntries[].[DashboardName,LastModified,Size]' --output table
551
552
# "CloudWatch log groups"
553
aws logs describe-log-groups \
554
--query 'logGroups[].[logGroupName,retentionInDays,storedBytes]' --output table
555
556
# "CloudTrail trails"
557
aws cloudtrail describe-trails \
558
--query 'trailList[].[Name,S3BucketName,IsMultiRegionTrail,LogFileValidationEnabled]' --output table
559
560
# "ECR repositories" / "container registries"
561
aws ecr describe-repositories \
562
--query 'repositories[].[repositoryName,repositoryUri,createdAt]' --output table
563
```
564
565
---
566
567
### COST & BILLING
568
569
```bash
570
# "current month cost" / "how much am I spending"
571
aws ce get-cost-and-usage \
572
--time-period Start=$(date -u +%Y-%m-01),End=$(date -u +%Y-%m-%d) \
573
--granularity MONTHLY --metrics BlendedCost \
574
--query 'ResultsByTime[].[TimePeriod.Start,Total.BlendedCost.Amount,Total.BlendedCost.Unit]' \
575
--output table
576
577
# "cost by service" / "spending breakdown"
578
aws ce get-cost-and-usage \
579
--time-period Start=$(date -u -d '30 days ago' +%Y-%m-%d),End=$(date -u +%Y-%m-%d) \
580
--granularity MONTHLY --metrics BlendedCost \
581
--group-by Type=DIMENSION,Key=SERVICE --output table
582
583
# "AWS Budgets"
584
aws budgets describe-budgets \
585
--account-id $(aws sts get-caller-identity --query Account --output text) \
586
--query 'Budgets[].[BudgetName,BudgetType,BudgetLimit.Amount,CalculatedSpend.ActualSpend.Amount]' \
587
--output table
588
589
# "Trusted Advisor recommendations"
590
aws support describe-trusted-advisor-checks --language en \
591
--query 'checks[].[id,name,category]' --output table
592
```
593
594
---
595
596
### CROSS-SERVICE QUERIES
597
598
```bash
599
# "resources tagged Environment=production" / "all production resources"
600
aws resourcegroupstaggingapi get-resources \
601
--tag-filters Key=Environment,Values=production \
602
--query 'ResourceTagMappingList[].[ResourceARN]' --output table
603
604
# "all resources tagged <key>=<value>"
605
aws resourcegroupstaggingapi get-resources \
606
--tag-filters Key=<key>,Values=<value> \
607
--query 'ResourceTagMappingList[].[ResourceARN,Tags]' --output table
608
609
# "inventory of all resources" (AWS Config)
610
aws configservice list-discovered-resources --resource-type <type> \
611
--query 'resourceIdentifiers[].[resourceType,resourceId,resourceName]' --output table
612
```
613
614
---
615
616
## Output Formatting Rules
617
618
1. Always use `--output table` for list results; use `--output json` only when deep detail is explicitly requested
619
2. Always use `--query` to extract only relevant fields — never dump raw JSON
620
3. For large result sets (>20 items), show a count first, then offer to filter
621
4. When a command returns nothing, explain why (wrong region, no resources, insufficient permissions)
622
5. Offer to drill into a specific resource: "Found 47 EC2 instances. Filter by state, type, or tag?"
623
624
## Error Handling
625
626
| Error | Response |
627
|---|---|
628
| `AccessDenied` | "You don't have permission to list [resource]. Required: `<service>:<Action>`." |
629
| `NoCredentialProviders` | "Run `aws configure` or set `AWS_PROFILE`." |
630
| Empty result | "No [resources] found in [region]. Check another region?" |
631
| Invalid identifier | "Could not find '[name]'. Check the name or provide the resource ID." |
632

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 11,970 prompts

More by @OpenSourceBuffGuy

See all
Pastel autumn outfit lookbook with handwritten annotations prompt image

Pastel autumn outfit lookbook with handwritten annotations

Creates a pastel e-commerce fashion lookbook poster of a model in a simple autumn outfit, with handwritten labels, arrows and a bold headline.

image-prompt, fashion, fashion-shoot, poster, text-rendering, pastel, autumn, full-body, woman, minimalist, negative-space, vertical-format, gpt-image, product-photography, social-media-graphic, photorealistic, for-online-sellers, for-designers, portrait, editorial, whimsical, cozy, studio-lighting

Premium food photography template prompt image

Premium food photography template

Creates a steaming, glossy spicy Sichuan-style dish photo in a dark bowl with chilies and restaurant props, with the food and ratio left to fill in.

image-prompt, gpt-image, food-photography, photorealistic, cinematic, moody, dramatic-lighting, bokeh, close-up, high-angle, square-format, placeholders, template, negative-prompt, cooking, restaurants, product-photography, for-photographers, for-small-business-owners, for-online-sellers, advertising

Configuration Validation prompt image

Configuration Validation

Builds configuration validation for an application: schemas, per-environment rules, runtime checks, secret handling, tests and a security report.

slash-command, code-generation, python, best-practices, security-review, testing, audit, yaml-prompt, developer-tools, for-developers, for-devops-engineers, code, report, documentation, migration, advanced, long-form, devops, deployment, structured-output

Reviews

Loading reviews…

Discussion

Loading comments…