Not able to add policies in SAM template

前端 未结 3 988
猫巷女王i
猫巷女王i 2021-02-20 13:46

I am working on SAM template for publishing my Application in AWS Serverless repository. But when I try to add policies for my lambda it shows me error: Invalid Serverless Appli

3条回答
  •  -上瘾入骨i
    2021-02-20 14:24

    Here's the full list of policy templates from the official repo example.

    
    Transform: AWS::Serverless-2016-10-31
    Resources:
      MyFunction:
        Type: 'AWS::Serverless::Function'
        Properties:
          CodeUri: src/
          Handler: index.handler
          Runtime: nodejs4.3
          Policies:
    
            - SQSPollerPolicy:
                QueueName: name
    
            - LambdaInvokePolicy:
                FunctionName: name
    
            - CloudWatchPutMetricPolicy: {}
    
            - EC2DescribePolicy: {}
    
            - DynamoDBCrudPolicy:
                TableName: name
    
            - DynamoDBReadPolicy:
                TableName: name
    
            - SESSendBouncePolicy:
                IdentityName: name
    
            - ElasticsearchHttpPostPolicy:
                DomainName: name
    
            - S3ReadPolicy:
                BucketName: name
    
            - S3CrudPolicy:
                BucketName: name
    
            - AMIDescribePolicy: {}
    
            - CloudFormationDescribeStacksPolicy: {}
    
            - RekognitionDetectOnlyPolicy: {}
    
            - RekognitionNoDataAccessPolicy:
                CollectionId: id
    
            - RekognitionReadPolicy:
                CollectionId: id
    
            - RekognitionWriteOnlyAccessPolicy:
                CollectionId: id
    
            - RekognitionLabelsPolicy: {}
    
            - SQSSendMessagePolicy:
                QueueName: name
    
            - SNSPublishMessagePolicy:
                TopicName: name
    
            - VPCAccessPolicy: {}
    
            - DynamoDBStreamReadPolicy:
                TableName: name
                StreamName: name
    
            - KinesisStreamReadPolicy:
                StreamName: name
    
            - SESCrudPolicy:
                IdentityName: name
    
            - SNSCrudPolicy:
                TopicName: name
    
            - KinesisCrudPolicy:
                StreamName: name
    
            - KMSDecryptPolicy:
                KeyId: keyId
    
            - SESBulkTemplatedCrudPolicy:
                IdentityName: name
    
            - SESEmailTemplateCrudPolicy: {}
    
            - FilterLogEventsPolicy:
                LogGroupName: name
    
            - StepFunctionsExecutionPolicy:
                StateMachineName: name
    
    

提交回复
热议问题