I wrote a lambda aws function on JetBrains Rider, and while trying to get to deploy the template.yaml file i get an aws tools error with the content
Cannot find any resources in SAM template project_path/template.yaml
.yaml file content:
Transform: AWS::Serverless-2016-10-31
Description: >
Sample SAM Template for lambda
Globals:
Function:
Timeout: 900
Metadata:
AWS::ServerlessRepo::Application:
Name: report_serverless
Description: report_serverless
Author: user
Resources:
ReportServerlessFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./data/
Handler: report_serverless::report_serverless.Function::FunctionHandler
Runtime: dotnetcore3.1
Architectures:
- x86_64
Environment:
Variables:
VaultApiHost: *******
VaultApiToken: *******
VaultCertificate: ****
ASPNETCORE_ENVIRONMENT: Development
VpcConfig:
SecurityGroupIds:
- *******
SubnetIds:
- *********
- *********
- *********
FileSystemConfigs:
- Arn: !GetAtt AccessPoint.Arn
LocalMountPath: /mnt/efs
Events:
ReportServerless:
Type: Api
Properties:
Path: /report
Method: get
Policies:
- Statement:
- Sid: AWSLambdaVPCAccessExecutionRole
Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
- ec2:CreateNetworkInterface
- ec2:DescribeNetworkInterfaces
- ec2:DeleteNetworkInterface
Resource: "*"
- Sid: AmazonElasticFileSystemClientFullAccess
Effect: Allow
Action:
- elasticfilesystem:ClientMount
- elasticfilesystem:ClientRootAccess
- elasticfilesystem:ClientWrite
- elasticfilesystem:DescribeMountTargets
Resource: "*"
MyMountTarget:
Type: AWS::EFS::MountTarget
Properties:
FileSystemId: *********
SecurityGroups:
- *********
SubnetId: ********
AccessPoint:
Type: AWS::EFS::AccessPoint
Properties:
FileSystemId: ***********
Outputs:
ReportServerlessApi:
Description: "API Gateway endpoint URL for Prod stage for Report Serverless function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
ReportServerlessFunction:
Description: "Report Serverless Lambda Function ARN"
Value: !GetAtt ReportServerlessFunction.Arn
ReportServerlessFunctionIamRole:
Description: "Implicit IAM Role created for Report Serverless function"
Value: !GetAtt ReportServerlessRole.Arn
and trying to deploy from console returns
Error: Failed to create changeset for the stack: sam-app, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state: For expression "Status" we matched expected path: "FAILED" Status: FAILED. Reason: T emplate error: instance of Fn::GetAtt references undefined resource ReportServerlessRole
using the Sam validate code replies the file is valid, and also ReportServerlessRole.Arn is created