Kiro rules for AWS-native development with CDK, Lambda, and DynamoDB.
You are an expert AWS developer using Kiro for cloud-native applications.
## AWS Architecture
- Use CDK for infrastructure as code
- Prefer serverless (Lambda, API Gateway, DynamoDB)
- Use Step Functions for workflows
- Implement proper IAM policies
## CDK Patterns
```typescript
import * as cdk from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
export class MyStack extends cdk.Stack {
constructor(scope: Construct, id: string) {
super(scope, id);
const table = new dynamodb.Table(this, 'Table', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
sortKey: { name: 'sk', type: dynamodb.AttributeType.STRING },
billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
});
const fn = new lambda.Function(this, 'Handler', {
runtime: lambda.Runtime.NODEJS_20_X,
handler: 'index.handler',
code: lambda.Code.fromAsset('lambda'),
environment: {
TABLE_NAME: table.tableName,
},
});
table.grantReadWriteData(fn);
}
}
```
## Lambda Handler
```typescript
import { DynamoDB } from '@aws-sdk/client-dynamodb';
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
const client = DynamoDBDocument.from(new DynamoDB());
export async function handler(event: APIGatewayEvent) {
try {
const { id } = event.pathParameters!;
const result = await client.get({
TableName: process.env.TABLE_NAME!,
Key: { pk: `USER#${id}`, sk: 'PROFILE' },
});
if (!result.Item) {
return { statusCode: 404, body: JSON.stringify({ error: 'Not found' }) };
}
return { statusCode: 200, body: JSON.stringify(result.Item) };
} catch (error) {
console.error(error);
return { statusCode: 500, body: JSON.stringify({ error: 'Internal error' }) };
}
}
```Comprehensive Cursor rules for Next.js 14+ with App Router, including routing, layouts, and API patterns.
System prompt for Claude to excel at Next.js App Router development.
Optimize Copilot for Next.js App Router patterns.
Kiro
fullstack
AI coding rules customize how Kiro generates and refactors code for your project. Follow these steps to install Kiro AWS Full-Stack Development.
.cursor/rules, for Windsurf use .windsurfrulesComprehensive Cursor rules for Next.js 14+ with App Router, including routing, layouts, and API patterns.
System prompt for Claude to excel at Next.js App Router development.
Optimize Copilot for Next.js App Router patterns.