【发布时间】:2016-07-28 23:03:05
【问题描述】:
我在尝试使用快照还原集群时遇到问题。我将不胜感激。
使用的代码是:
var con = new AmazonRedshiftClient(acess_key_id, secret_acess_key, Amazon.RegionEndpoint.USWest2);
var restore = new Amazon.Redshift.Model.RestoreFromClusterSnapshotRequest()
{
ClusterIdentifier = clusterIdentifier,
SnapshotIdentifier = snapshotIdentifier,
AvailabilityZone = "us-west-2a",
};
var response = con.RestoreFromClusterSnapshot(restore);
Console.WriteLine("Cluster Status : {0}", response.Cluster.ClusterStatus);
当它调用 RestoreClusterSnapshotRequest 操作时,我有一个异常: “拒绝访问。请确保您的 IAM 权限允许此操作。”
像这样为 Amazon Redshift 使用基于身份的策略(IAM 策略) 政策:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"redshift:CopyClusterSnapshot",
"redshift:RestoreFromClusterSnapshot",
"redshift:AuthorizeSnapshotAccess",
"redshift:RevokeSnapshotAccess"
],
"Resource": [
"arn:aws:redshift:us-west-2:{AccoundId}:*/backup-20160208-dbrd",
"arn:aws:redshift:us-west-2: {AccoundId}:cluster:*"
]
},
{
"Effect": "Allow",
"Action": [
"redshift:DescribeClusterSnapshots"
],
"Resource": [
"*"
]
}
]
}
任何人都可以帮助我克服这个问题.. 如果我在此过程中犯了任何错误,请纠正我.. .
提前致谢
【问题讨论】:
标签: amazon-s3 amazon-redshift aws-sdk