尝试使用适用于 .NET /1.1.0.1 的 AWS 开发工具包使用类似于以下的代码向 Amazon SNS 主题添加权限时:
AddPermissionRequest request = new AddPermissionRequest()
.WithActionNames(new[] { "Publish" })
.WithAWSAccountIds(new[] { "xxx" })
.WithLabel("PrincipleAllowControl")
.WithTopicArn(resourceName);
client.AddPermission(request);
返回以下错误消息:
<ErrorResponse xmlns=" http://sns.amazonaws.com/doc/2010-03-31/">
<Error>
<Type>Sender</Type>
<Code>ValidationError</Code>
<Message>2 validation errors detected: Value null at 'actionName' failed to satisfy constraint: Member must not be null; Value null at 'aWSAccountId' failed to satisfy constraint: Member must not be null</Message>
</Error>
<RequestId>45054159-e46b-11df-9b30-693941920fe7</RequestId>
</ErrorResponse>