169
edits
No edit summary |
|||
| Line 27: | Line 27: | ||
An IAM policy statement must be applied to '''all the buckets''' you want to backup so the TSM robot user in charge of the backup can access them. This can be done with the [https://awscli.amazonaws.com/v2/documentation/api/latest/index.html aws cli]. | An IAM policy statement must be applied to '''all the buckets''' you want to backup so the TSM robot user in charge of the backup can access them. This can be done with the [https://awscli.amazonaws.com/v2/documentation/api/latest/index.html aws cli]. | ||
First, ensure that <code>my-bucket</code> currently has no IAM policy. Check bucket <code>my-bucket</code> using profile <code>my-profile</code> (as defined in ~/.aws/config and ~/.aws/credentials files) with: | First, ensure that <code>my-bucket</code> currently has no IAM policy. Check bucket <code><my-bucket></code> using profile <code>my-profile</code> (as defined in ~/.aws/config and ~/.aws/credentials files) with: | ||
<pre>$aws s3api get-bucket-policy --profile c3g-data-repos --bucket my-bucket | <pre>$aws s3api get-bucket-policy --profile c3g-data-repos --bucket <my-bucket> | ||
An error occurred (NoSuchBucketPolicy) when calling the GetBucketPolicy operation: The bucket policy does not exist | An error occurred (NoSuchBucketPolicy) when calling the GetBucketPolicy operation: The bucket policy does not exist | ||
| Line 49: | Line 49: | ||
], | ], | ||
"Resource": [ | "Resource": [ | ||
"arn:aws:s3:::my-bucket/*", | "arn:aws:s3:::<my-bucket>/*", | ||
"arn:aws:s3:::my-bucket" | "arn:aws:s3:::<my-bucket>" | ||
] | ] | ||
} | } | ||
| Line 57: | Line 57: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Load the policy onto the bucket <code>my-bucket</code> using the profile <code>my-profile:</code> | Load the policy onto the bucket <code><my-bucket></code> using the profile <code>my-profile:</code> | ||
<pre> | <pre> | ||
$aws s3api put-bucket-policy --policy file://my-policy.json --profile my-profile --bucket my-bucket | $aws s3api put-bucket-policy --policy file://my-policy.json --profile my-profile --bucket <my-bucket> | ||
</pre> | </pre> | ||
edits