Hello guys,
I have created my serverless.yml where I try to assign a in-build role to my execution lambda function. Unfortunately the way I’m doing it is not handy. I have tried to follow the documentation but all the examples drag me into the footage of new role creating which is something I don’t need. Please check out my file content and let me know how to achieve what I attempt:
service: mylabs
provider:
name: aws
runtime: python3.6
stage: dev
memorySize: 512 # optional, in MB, default is 1024
timeout: 10 # optional, in seconds, default is 6
versionFunctions: false # optional, default is true
tracing:
lambda: true # optional, enables tracing for all functions (can be true (true equals 'Active') 'Active' or 'PassThrough')
environment: # all the env variables are coming in here
var1: 12
var2: 32
role: mydefaultrole
functions:
first-deployment:
name: dm-my-function
description: first function deploy by serverless
runtime: python3.6 # this can be inherated from the provider definition
handler: src/dm-function1.lambda_handler
events:
- schedule:
rate: cron(0 9 * * ? *)
name: ${self:functions.first-deployment.name}
resources:
Resources:
mydefaultrole:
role: 'arn:aws:iam::account:role/lambdabasicrole'