skills/se-architecture/arch-cloud/SKILL.md
Cloud: serverless Lambda/CF Workers, edge, CDN, multi-region, HA patterns, IaC Terraform
npx skillsauth add alphaonedev/openclaw-graph arch-cloudInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps design and implement cloud architectures focused on serverless technologies (e.g., AWS Lambda, Cloudflare Workers), edge computing, CDNs, multi-region setups for high availability (HA), and Infrastructure as Code (IaC) using Terraform. It ensures scalable, cost-effective solutions by guiding precise configuration and deployment.
Use this skill for applications needing low-latency edge delivery, serverless backends to reduce costs, multi-region redundancy for HA, or IaC automation. Examples include building global APIs, migrating to serverless, or optimizing CDN for media delivery. Avoid for simple monolithic apps or on-prem setups.
terraform init; plan changes with terraform plan -out=plan.tfplan; apply with terraform apply plan.tfplan. Use -var="region=us-east-1" for region-specific vars.aws lambda create-function --function-name myLambda --zip-file fileb://function.zip --handler index.handler --runtime nodejs14.x --role arn:aws:iam::123456789012:role/lambdaRole. Invoke with aws lambda invoke --function-name myLambda out.txt.$CLOUDFLARE_API_KEY env var. Create a Worker script via POST to https://api.cloudflare.com/client/v4/accounts/{account_id}/workers/scripts with JSON body: {"id": "myWorker", "content": "addEventListener('fetch', event => event.respondWith(new Response('Hello')));"}.resource "aws_lambda_function" "example" { function_name = "myFunction" runtime = "nodejs14.x" handler = "index.handler" filename = "function.zip" }. For API keys, set in env vars like export AWS_ACCESS_KEY_ID=$AWS_API_KEY.Integrate Terraform with CI/CD by running terraform plan in GitHub Actions via a workflow step: run: terraform plan -out=plan.out. For serverless, link Lambda to S3 triggers using Terraform: resource "aws_lambda_permission" "allow_s3" { action = "lambda:InvokeFunction" function_name = aws_lambda_function.example.function_name principal = "s3.amazonaws.com" source_arn = aws_s3_bucket.example.arn }. Use $TERRAFORM_STATE_BUCKET for remote state storage. For edge services, route traffic from Cloudflare to AWS via API Gateway by configuring Cloudflare's origin settings with the Gateway endpoint.
Handle Terraform errors by checking terraform plan output for diffs and running terraform apply --auto-approve only after review; common issues include dependency cycles—fix by ordering resources in .tf files. For Lambda, catch invocation errors with aws lambda invoke --function-name myLambda out.txt and parse logs via CloudWatch: use aws logs get-log-events --log-group /aws/lambda/myLambda --log-stream latest. If Cloudflare API returns 401, verify $CLOUDFLARE_API_KEY and retry with exponential backoff. In code, wrap API calls in try-catch: try { const response = await fetch('https://api.cloudflare.com/...'); } catch (error) { console.error(error.message); }. Always validate region configs to avoid "region not supported" errors.
export AWS_REGION=us-east-1 and export AWS_ACCESS_KEY_ID=$AWS_API_KEY. Create a Terraform file: resource "aws_lambda_function" "globalFn" { ... } resource "aws_route53_record" "failover" { zone_id = "Z1234567890" name = "api.example.com" type = "A" failover_routing_policy { ... } }. Run terraform init && terraform apply to deploy Lambda in us-east-1 and set up Route 53 for HA.export CLOUDFLARE_API_KEY=your_key. Use Terraform to provision: resource "cloudflare_worker_script" "edgeScript" { name = "edgeWorker" content = "addEventListener('fetch', event => { ... }); } resource "cloudflare_zone" "example" { zone = "example.com" }. Deploy with terraform apply, then test by curling the Worker endpoint.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui