- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我尝试将 put_item() 放入 DynamoDB 时,AWS Lambda 函数中出现此错误。
c_table.put_item(Item={"id": result['conn_id'], "username": payload.get("username"), "created": datetime.utcnow().isoformat() })
WSConnectionTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: my_table_name
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
BillingMode: PAY_PER_REQUEST
StreamSpecification:
StreamViewType: NEW_AND_OLD_IMAGES
ConnectFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${AWS::StackName}-ConnectFunction
Description: !Sub
- Stack ${StackTagName} Environment ${EnvironmentTagName} Function ${ResourceName}
- ResourceName: ConnectFunction
CodeUri: sources
Handler: handlers.connection
Runtime: python3.7
MemorySize: 3008
Timeout: 30
Tracing: Active
Policies:
- AWSXRayDaemonWriteAccess
- DynamoDBCrudPolicy:
TableName: !Ref WSConnectionTable
Environment:
Variables:
TABLE_NAME: !Ref WSConnectionTable
TABLE_ARN: !GetAtt WSConnectionTable.Arn
一切正常,希望在 WS 连接之后,我想将连接 ID 保存到数据库,并且对 put_item() 的调用失败并出现以下错误:
[ERROR] ClientError: An error occurred (AccessDeniedException) when calling the PutItem operation: User: arn:aws:sts::74xxxxxxx:assumed-role/websocket-dev-ConnectFunctionRole-1PCCYG1DTLQYW/websocket-dev-ConnectFunction is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-east-2:74xxxxxxx:table/my_table_name_dev
如果有任何有关如何解决此问题的线索,我将不胜感激
最佳答案
您的 DdB 表名为 my_table_name
:
WSConnectionTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: my_table_name
并且您的策略仅允许访问此表:
- DynamoDBCrudPolicy:
TableName: !Ref WSConnectionTable
但是,错误消息表明您正在尝试访问不同的表(称为 my_table_name_dev
),并且访问被拒绝
关于amazon-web-services - 客户端错误: An error occurred (AccessDeniedException),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64073116/
这个问题已经有答案了: Avoid Java 8 Files.walk(..) termination cause of ( java.nio.file.AccessDeniedException )
我正在尝试删除一个文件,然后重新创建它。首先,我检查该文件是否已存在,如果存在,则将其删除。然后我尝试在同一位置创建一个具有相同名称的新文件。当我这样做时,我收到此错误: java.nio.file.
这是尝试在我的 usb 连接的 android 设备上运行/测试应用程序后我的 android studio 控制台收到的错误 错误:任务 ':app:mockableAndroidJar' 执行失败
我正在创建简单的对象序列化,并且BufferedOutputStream的创建引发了异常AccessDeniedException。这是代码: Path filePath = Paths.get("c
我想访问我的网络应用程序之外的静态资源,这样它们就不会在每次重新部署时被破坏,但我似乎无法获取它们 我有一个 servlet,旨在通过 FileOutputStream 提供这些图像,但当我将其部署到
描述: 我在 Java 8 中创建了一个 ZIP 文件,并尝试将一个目录及其所有子文件和目录复制到该 zip 文件中。 Path directory = Paths.get("P:\Java\T
在我的 Spring Boot Web 应用程序中,只要用户没有必要的权限,我就会在我的业务代码中抛出 org.springframework.security.access.AccessDenied
我有 2 个服务:RecentRecordService 和 BookService。 @Service public class RecentRecordService { @Transac
我正在使用 Swift AWS Mobile Hub Helper 构建我的 iOS 应用程序并连接到我的 DynamoDB 数据库。我可以看到,在使用 Facebook SignInProvider
我使用这个自定义错误处理程序: @Component public class OAuth2AuthenticationEntryPoint implements AuthenticationEntr
使用AWS CLI aws --version aws-cli/1.11.21 Python/2.7.12 Darwin/15.3.0 botocore/1.4.78 如https://github.
解决完所有authentication related problems后在我的第一个 Spring Web 应用程序中,我现在陷入了授权的困境。 使用@Secured注释进行配置非常简单,所以我认为
我在 Spring Security 中使用角色层次结构。 ROLE_USER > ROLE_GUEST
我编写了一个小方法,用于告诉我应用程序的另一个实例是否已在运行。我知道有很多方法可以查明另一个实例是否正在运行,但我选择了这个。我正在创建一个空文件并在应用程序实例期间保持锁定状态。如果另一个实例正在
我是 amazon Dynamo DB 的新手。我收到访问被拒绝的异常。 请帮我解决这个问题。 错误: User: arn:aws:sts::xx:assumed-role/Cognito_Sampl
我在解决运行在 Tomcat 6.0 上的 Java Servlet 的权限问题时遇到了问题 当我尝试操作存储在网络共享上的文件时遇到 AccessDeniedException。 这是堆栈跟踪: j
我目前正在尝试将 GWT 网络应用程序部署到 tomcat 实例,但该程序未正确运行。仔细检查 tomcat 日志后,Tomcat 似乎遇到了 AccessDeniedException。 SEVER
我想使用此代码读取文件内容: String content = new String(Files.readAllBytes(Paths.get("/sys/devices/virtual/dmi/id
我是 AWS 新手。我有一个用户帐户和两个角色,一个用于生产,一个用于测试。 通常我会登录我的帐户并切换到产品角色来运行一些简单的选择查询。 现在我想通过 PyAthena 在 Python 中本地使
首先让我说,对于我的场景,访问应该被拒绝。内置 Spring Boot 和 Spring Security 4。我允许任何人连接到 websocket 并订阅一个主题,但我确保能够使用以下 web 套
我是一名优秀的程序员,十分优秀!