gpt4 book ai didi

amazon-web-services - 如何在无服务器框架YAML中使用Fn::Join?

转载 作者:行者123 更新时间:2023-12-03 07:12:57 25 4
gpt4 key购买 nike

我在 Serverless.yaml 文件中有一个策略,如下所述。

    AppSyncDynamoDBPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
Description: 'Managed policy'
Path: /appsync/
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:DeleteItem
- dynamodb:UpdateItem
- dynamodb:Query
- dynamodb:Scan
- dynamodb:BatchGetItem
- dynamodb:BatchWriteItem
Resource:
Fn::Join:
- ""
- - Fn::GetAtt: [dslvehicleState, Arn]
- "*"

当 sls 部署完成时,它会抛出一个错误,如下所述。

An error occurred: AppSyncDynamoDBPolicy - Syntax errors in policy. (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID: 166ba0b3-cc67-11e8-8f74-3339d857f829).

我在这里缺少什么?

最佳答案

使用 Ref 方法尝试一下:

AppSyncDynamoDBPolicy:
Type: AWS::IAM::ManagedPolicy
Properties:
Description: 'Managed policy'
Path: /appsync/
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:DeleteItem
- dynamodb:UpdateItem
- dynamodb:Query
- dynamodb:Scan
- dynamodb:BatchGetItem
- dynamodb:BatchWriteItem
Resource:
Fn::Join:
- ""
- - "Ref": "dslvehicleState"
- "*"

关于amazon-web-services - 如何在无服务器框架YAML中使用Fn::Join?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52736029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com