Following a failure into an AWS account with the AWS connector's call tool — finding the resource from what the cluster knows, where each symptom's cause usually lives, and reading CloudTrail. Load it before your first AWS call.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Aws Investigation?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/clm-cloud-solutions-aws-investigation)
---
name: aws-investigation
description: Following a failure into an AWS account with the AWS connector's call tool — finding the resource from what the cluster knows, where each symptom's cause usually lives, and reading CloudTrail. Load it before your first AWS call.
---
**The workload's own error names the AWS piece: read it first.** Before any AWS call, read the failing workload's logs and events, and the caller's as well as the callee's when a request crosses workloads. An AccessDenied names the action and often the role; a KMS error names the key; a timeout names the host and port; an ALB 502 or 503 says the request never reached a healthy target. A cause you reach without that line is a guess.
**Find the resource from what the cluster already knows; never list the account.** Every call costs time and a share of a small rate limit, and a list of the whole account answers nothing:
- A pod's AWS identity: with EKS Pod Identity, `eks ListPodIdentityAssociations` with clusterName, namespace and serviceAccount, then `DescribePodIdentityAssociation` for its roleArn; with IRSA, the ServiceAccount's `eks.amazonaws.com/role-arn` annotation.
- A node: `spec.providerID` is `aws:///<zone>/<instance-id>` (get_external_connections lists them in clusterNetwork); `ec2 DescribeInstances` with those ids gives the VPC, subnets, security groups and instance profile.
- A load balancer: the Ingress or Service status hostname (`<name>-<id>.<region>.elb.amazonaws.com`); `elbv2 DescribeLoadBalancers` with Names, then `DescribeTargetGroups` with its LoadBalancerArn and `DescribeTargetHealth` for each group.
- A database: its endpoint (`<id>.<hash>.<region>.rds.amazonaws.com`); `rds DescribeDBInstances` with that DBInstanceIdentifier gives its security groups, status and parameter group.
- A name in a private domain (`db.shop.internal`, a corporate suffix): it is usually a Route 53 private hosted zone record. `route53 ListHostedZonesByName` with DNSName, then `ListResourceRecordSets` with HostedZoneId and StartRecordName: the record points (CNAME or alias) at the real endpoint, and the record itself may be what changed.
**Where the cause usually lives, by symptom:**
- A timeout to a database or cache: the dependency's security group must allow the nodes' (or pods') security group on its port. Read the dependency's group, then the nodes' outbound rules, then the subnet's network ACL and route table. Connection refused or an authentication error is not the network.
- An ALB 502, 503 or 504, or users timing out, while the pods are Ready: `DescribeTargetHealth` gives each target's state and reason. Unhealthy targets with healthy pods point at the path from the load balancer to them: the node or pod security group must allow the load balancer's group on the target port, the network ACLs of the targets' subnets must allow it too (they are stateless: the target port in, the ephemeral ports back out), and the target group's health check path and port must answer. Healthy targets while clients fail point at the load balancer's own security group inbound or its listener: the health checks come from the load balancer, so a rule removed for clients leaves them green.
- AccessDenied in a pod's AWS calls: from the pod's role, `iam ListAttachedRolePolicies`, `ListRolePolicies`, `GetRolePolicy`, or `GetPolicy` and `GetPolicyVersion`; `iam SimulatePrincipalPolicy` with the exact action and resource ARN settles it. A resource policy can deny too: `s3 GetBucketPolicy`, `kms GetKeyPolicy` (PolicyName `default`), `ecr GetRepositoryPolicy`.
- A KMS error (`KMS.DisabledException`, `KMSInvalidStateException`, AccessDenied on Decrypt): the key changed. `kms DescribeKey` with the key id or ARN from the error, or the bucket's key from `s3 GetBucketEncryption` (KMSMasterKeyID), gives its KeyState (Enabled, Disabled, PendingDeletion) and DeletionDate; `ListGrants` and `GetKeyPolicy` say who may use it. Then CloudTrail: DisableKey, ScheduleKeyDeletion, PutKeyPolicy, RetireGrant or RevokeGrant.
- An image pull failure from ECR: the node's instance profile role (pull permission) and `ecr GetRepositoryPolicy`; `ecr DescribeImages` with `repositoryName` says whether the tag exists, when it was pushed and last pulled. A tag or digest that is gone (`manifest unknown`, `not found`): `ecr GetLifecyclePolicy` for a rule that expires it, and `cloudtrail LookupEvents` with `EventSource` `ecr.amazonaws.com` for who deleted or retagged it (lifecycle expirations log as `PolicyExecutionEvent`). `ecr DescribeImageScanFindings` gives an image's vulnerabilities.
- Database authentication failing after a credential change: `secretsmanager DescribeSecret` gives LastRotatedDate, LastChangedDate and the version stages; `ListSecretVersionIds` says when each version was created and which one holds AWSCURRENT and AWSPREVIOUS. Never the value. Pods keep the credential they loaded until they reload it. In the cluster, a Secret synced from Secrets Manager (External Secrets labels it `reconcile.external-secrets.io/managed`) shows its last write in get_resource_yaml: written after the pods started, the cluster already holds the new credential, and restarting the pods that read it at start is the fix, not a change in AWS.
- Messages piling up in a queue a Lambda function consumes: `sqs GetQueueAttributes` with AttributeNames `All` gives the QueueArn, the backlog and the redrive policy; `lambda ListEventSourceMappings` with that EventSourceArn gives the function and whether the mapping is Enabled; `GetFunctionConcurrency` gives ReservedConcurrentExecutions: with an SQS trigger, 0 throttles every invocation while the mapping keeps receiving, so each throttled receive counts toward the queue's maxReceiveCount and moves messages to its dead-letter queue (to pause a consumer, disable the mapping). `GetFunctionConfiguration` gives its State and LastUpdateStatus. The AWS/Lambda Throttles and Errors metrics confirm which it is. Environment variables come back by name only.
- A short outage in the past: `rds DescribeEvents` with SourceIdentifier and Duration in minutes (reboots, failovers, maintenance); `eks ListUpdates` and `DescribeUpdate`, and `autoscaling DescribeScalingActivities`, for node replacements; `health DescribeEvents` for AWS's own events (it needs a Business support plan or higher: a SubscriptionRequiredException says nothing about the incident).
**CloudTrail tells who changed what, if you ask the right way.**
- When you know when the symptom started, ask first what changed just before it: ReadOnly=false, with StartTime a few minutes before the start and EndTime at it, returns every write in that region and window, whatever its resource or event name. Otherwise look up one resource: LookupAttributes takes one attribute per call, so use ResourceName with the id (the security group, the role name, the key id, the DB identifier), with StartTime and EndTime around the incident; when it comes back empty, try the full ARN before concluding. LookupEvents allows two calls per second per account and region: no sweeps.
- Lambda's event names may carry a version date (GetFunction20150331 for GetFunction): look its changes up by ResourceName, or by EventSource `lambda.amazonaws.com`, not by EventName.
- A resource's events are in its own region. IAM, CloudFront and Route 53 changes are recorded in us-east-1.
- Event history keeps 90 days of management events. S3 object reads and Lambda invocations are data events and never appear: the change that broke them does.
- A recent event can take up to about 15 minutes to appear. An empty answer minutes after the incident is not proof that nothing changed: say so, read the resource's current state, and look again later.
- KubeBolt returns one row per event and leaves out the read-only calls that succeeded; a failed read stays, since it may be the symptom. In a Revoke, Detach, Delete, Disable or Remove event, the request is the state before the change, and when it names the thing only by id (a security group rule id), the response holds what was removed: quote it as the value to restore.
- Name who made a change exactly as the record does (`assumed-role/<role>/<session>`, `user/<name>`, root, or a service). A session name is not always a person. Without a record, say the change has no author you could find; never infer one.
- The user agent tells how a change was made: console, CLI, an SDK, Terraform or CloudFormation. A change made by infrastructure code comes back on the next apply unless the code is fixed.
**State and change go together.** Read the resource as it is now (the rule that is missing, the policy no longer attached, the key's state, the record's value) and the event that changed it. One without the other is half a cause. If the state is already correct, say when it was restored and by whom, if the record shows it.
**The fix is the operator's: name the smallest one.** KubeBolt changes nothing in AWS. Say the exact change that restores what was there, with the values from the event that removed it (the rule's protocol, port and source, from its request or response; the policy ARN to attach; the key to enable; the record's previous value); when neither that event nor the old policy is within reach, rebuild it from everything the failing call needs, read from the resource itself (its key, its policy), not only from the action in the error. Say where it belongs when infrastructure code made the original change. Never propose a broader permission than the one removed, and never suggest moving a secret back to an older version without saying what that version's credentials can reach.