Hello,
I have strange problem with IamRole.
A few months ago my lambda deploy was OK but I did some changes in my code and I get the follow error message:
Blockquote
Serverless Error ----------------------------------------
219 The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [IamRoleLambdaExecution] in the Resources block of the template
This is my serverless.yml
service: BATCH-lambda-f
provider:
name: aws
deploymentBucket:
serverSideEncryption: AES256
blockPublicAccess: true
name: serverless-f-${opt:stage,self:provider.stage}
runtime: nodejs12.x
iam:
role: arn:aws:iam::xxxxxx:role/rol_exec
deploymentRole: arn:aws:iam::xxxxxx:role/rol_exec
plugins:
- '@lambda/v-ext-plugin'
package:
exclude:
- .git/**
- README.md
- env.yml
- docker-compose.yml
- scripts/**
- config/localhost.json
- node_modules/aws-sdk/**
- .env
custom:
vaultExtension:
include:
- f
functions:
fac:
name: ${opt:stage,self:provider.stage}-BATCH-f
handler: index.handler
memorySize: 256
timeout: 900
role: ${ssm:/${opt:stage,self:provider.stage}/RolExecLambda~true}
environment:
NODE_ENV: '${opt:stage,self:provider.stage}'
MYSQL_DB_HOST: ${ssm:/${opt:stage,self:provider.stage}/MYSQL_DB_HOST~true}
MYSQL_DB_PORT: ${ssm:/${opt:stage,self:provider.stage}/MYSQL_DB_PORT~true}
MYSQL_DB_USER: ${ssm:/${opt:stage,self:provider.stage}/MYSQL_DB_USER~true}
MYSQL_DB_PASSWORD: ${ssm:/${opt:stage,self:provider.stage}/MYSQL_DB_PASSWORD~true}
MYSQL_DB_SCHEMA: ${ssm:/${opt:stage,self:provider.stage}/MYSQL_DB_SCHEMA~true}
vpc:
securityGroupIds:
- Fn::ImportValue: 'q-${opt:stage,self:provider.stage}-VPCSecGroup'
subnetIds:
- Fn::ImportValue: 'q-${opt:stage,self:provider.stage}-subNetPerA'
- Fn::ImportValue: 'q-${opt:stage,self:provider.stage}-subNetPerB'
events:
- schedule:
rate: 'cron(0 8 25 1/1 ? *)'
description: 'fpf'
name: aws_cloudwatch_${opt:stage,self:provider.stage}_event_rule_schedule_fac
enabled: true
I always getting the same error
What I’m doing wrong?
Thank you.