Configure Serverless Framework for multi-cloud deployment
✓Works with OpenClaudeYou are a serverless infrastructure engineer. The user wants to configure Serverless Framework to deploy the same application across multiple cloud providers (AWS, Azure, Google Cloud).
What to check first
- Run
serverless --versionto confirm Serverless Framework CLI is installed (requires v3+) - Verify cloud provider credentials are configured:
aws configure,az login,gcloud auth login - Check that
serverless.ymlexists in the project root with a service name defined
Steps
- Install Serverless Framework globally:
npm install -g serverless - Create a base
serverless.ymlwith provider-agnostic function definitions using${sls:stage}and${aws:accountId}variables - Set up environment-specific files:
serverless.${provider}.ymlfor AWS, Azure, and GCP overrides - Configure provider-specific plugins:
serverless-plugin-aws-alerts,serverless-azure-functions,serverless-google-cloudfunctions - Use the
provider.regionandprovider.runtimekeys to specify cloud-specific deployment targets - Set up IAM roles and permissions per provider using
provider.iam.role.statements - Create deployment scripts that call
serverless deploy --config serverless.${PROVIDER}.yml - Test multi-cloud deployment with
serverless deploy function -f functionName --provider aws(repeat for each provider)
Code
# serverless.yml (base configuration)
service: multi-cloud-app
frameworkVersion: '3'
params:
default:
stage: dev
region: us-east-1
provider:
name: aws
runtime: nodejs18.x
region: ${param:region}
stage: ${param:stage}
environment:
STAGE: ${param:stage}
CLOUD_PROVIDER: aws
iam:
role:
statements:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: 'arn:aws:logs:*:*:*'
functions:
hello:
handler: src/handlers/hello.handler
events:
- http:
path: hello
method: get
cors: true
timeout: 30
memorySize: 256
process:
handler: src/handlers/process.handler
events:
- sqs:
arn: !GetAtt ProcessQueue.Arn
batchSize: 10
timeout: 60
memorySize: 512
resources:
Resources:
ProcessQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:service}-${param:stage}-queue
VisibilityTimeout: 300
plugins:
- serverless-plugin-aws-alerts
- serverless
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Serverless Skills
Other Claude Code skills in the same category — free to download.
Vercel Deploy
Deploy and configure applications on Vercel
Netlify Deploy
Deploy and configure applications on Netlify
SST Setup
Set up SST (Serverless Stack) for full-stack serverless apps
Edge Functions
Build and deploy edge functions (Vercel, Cloudflare Workers)
Serverless Database
Set up serverless databases (PlanetScale, Neon, Turso)
Serverless Cron
Set up serverless cron jobs and scheduled functions
Serverless Queue
Implement serverless queues and event-driven processing
Want a Serverless skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.