Reputation: 1591
I used a following way in nodejs to deploy a lambda function before.
await aws.command(
`cloudformation package \
--template-file ${template} \
--output-template-file ${serverless} \
--s3-bucket ${bucketName}`
).then(function (data) {
console.log('cloudformation packaging data=', data)
})
console.log('server deploying...')
await aws.command(
`cloudformation deploy \
--template-file ${serverless} \
--stack-name ${stackName} \
--capabilities CAPABILITY_IAM`
).then(function (data) {
console.log('cloudformation deploying data=', data)
})
Here are my cloudformation template file.
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Resources:
ExportServer:
Type: AWS::Serverless::Function
Properties:
Handler: src/server.handler
Runtime: nodejs12.x
Events:
AnyRequest:
Type: Api
Properties:
Path: /graphql
Method: ANY
But now I need to do it using boto3 in python.
Please give me any suggestion.
Upvotes: 0
Views: 1234
Reputation: 9472
The lambda boto3 API documentation shows the available functions for doing this. See https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html
Some specific API calls to explore:
Upvotes: 1