Aws

From G1Joshi/Agent-Skills · View interactive version

Aws is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert Amazon Web Services (AWS) cloud assistance covering IAM, EC2, S3, ECS/EKS, Lambda, VPC, and CloudWatch. Use when designing, deploying, and managing scalable AWS cloud architectures.

How to use this skill

Skill file

AWS

Amazon Web Services (AWS) is a comprehensive cloud platform providing scalable compute, serverless architectures, managed databases, and enterprise AI infrastructure.

When to Use

Quick Start

# Verify credentials and caller identity
aws sts get-caller-identity

# List S3 buckets
aws s3 ls

# Sync local assets directory to private S3 bucket
aws s3 sync ./dist s3://my-app-assets-bucket/ --delete

Core Concepts

Serverless Architecture with AWS Lambda & SQS

Event-driven microservice processing incoming messages:

import json
import boto3
import os

dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(os.environ['ORDERS_TABLE'])

def handler(event, context):
    processed_count = 0

    for record in event['Records']:
        body = json.loads(record['body'])
        order_id = body['order_id']
        amount = body['amount']

        # Persist transaction to DynamoDB
        table.put_item(Item={
            'PK': f"ORDER#{order_id}",
            'amount': str(amount),
            'status': 'CONFIRMED',
            'timestamp': record['attributes']['ApproximateFirstReceiveTimestamp']
        })
        processed_count += 1

    return {
        'statusCode': 200,
        'body': json.dumps({'processed': processed_count})
    }

Least-Privilege IAM Policy

Scoping permissions strictly to resource ARNs:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowS3InvoiceBucketAccess",
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::corporate-invoices-prod/*"
    },
    {
      "Sid": "AllowKMSDecryption",
      "Effect": "Allow",
      "Action": "kms:Decrypt",
      "Resource": "arn:aws:kms:us-east-1:123456789012:key/abc-123",
      "Condition": {
        "StringEquals": {
          "kms:CallerAccount": "123456789012"
        }
      }
    }
  ]
}

High-Availability VPC Network Architecture

Subnet layout for zero-trust network segregation:

[Internet Gateway]
       │
[Public Subnets (NAT Gateway, ALB)] ──► 10.0.1.0/24, 10.0.2.0/24
       │
[Private Application Subnets (ECS, EKS, Lambda)] ──► 10.0.10.0/24, 10.0.11.0/24
       │
[Isolated Database Subnets (Aurora, Redis)] ──► 10.0.20.0/24, 10.0.21.0/24

Common Patterns

Least-Privilege IAM Policy for Application Service Roles

Problem: Granting wildcard * permissions exposes AWS accounts to severe compromise.

Solution:

Scoped IAM policy restricting actions to specific resources:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::my-production-bucket/uploads/*"
    },
    {
      "Effect": "Allow",
      "Action": "dynamodb:GetItem",
      "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/UserSessions"
    }
  ]
}

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :-------------------------------------------------------------------- | :---------------------------------------------------------------- | :------------------------------------------------------------------------------- |

| AccessDenied (Service: Amazon S3; Status Code: 403) | IAM user/role lacks permission or S3 Bucket Policy blocks access. | Verify IAM policy permissions and check bucket Block Public Access settings. |

| ExpiredToken: The security token included in the request is expired | Temporary STS credentials (AWS SSO or assumed role) have expired. | Re-authenticate: aws sso login or refresh STS tokens. |

| VPC Resource Timeout / No internet access in Lambda | Lambda placed in private subnet without NAT Gateway. | Route private subnet 0.0.0.0/0 traffic through a NAT Gateway in a public subnet. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.