Aws S3
Aws S3
Aws S3
• Object storage
• Almost unlimited amount of data, accessible from anywhere
• 99.999999999% durability (that’s eleven nines!)
• Cheapest way to store data on AWS
• Can even host static websites
• Supports BitTorrent, too
• Integrates with many AWS services
COMMON USE CASES
• Off by default
• Useful to prevent unintended deletions or overwrites
• Once versioning is enabled, you cannot disable it (you can still suspend it)
• Each object version is stored separately (takes more space)
• GET request returns the latest version by default – you can specify version id to get specific
version
• DELETE request does not delete all versions, it just puts a delete marker as a current version.
You can still permanently delete specific versions of an object
ACL – ACCESS CONTROL LISTS
• JSON-based documents
• User policies (IAM) and Bucket policies (S3)
• Policies consist of following sections:
– Resources: buckets and objects in S3, identified by ARN
– Actions: for each resource you can define a set of operations that will be allowed or denied
– Effect: allow or deny
– Principal: account, user, service, or other entity affected by the policy
– Condition (optional): lets you specify conditions for when your policy is in effect
POLICIES – AN EXAMPLE
{
"Version": "2012-10-17",
"Id": "ExamplePolicy01",
"Statement": [{
"Sid": "ExampleStatement01",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::Account-ID:user/Dave"
},
"Action": [
"s3:GetObject",
"s3:GetBucketLocation",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::examplebucket/*",
"arn:aws:s3:::examplebucket"
]
}]
}
POLICIES – SPECIFYING RESOURCES
• Permissions are keywords that map to S3 operations (GET, PUT, DELETE, etc).
• Format: s3:<Action><Resource><Property>
• Common Actions are: Get, Put/Create, Delete, Abort, Restore, List
• Common Resources are: Object, Bucket, MultipartUpload,
• Common Properties: Acl, Version, Tagging, Parts
• Wildcards are allowed
• Examples:
– s3:ListBucket
– s3:List*
– s3:GetBucketAcl
– s3:DeleteObjectVersion
POLICIES – SPECIFYING CONDITIONS
• Access policies allow you to specify conditions when policy takes effect
• Use Boolean operators and special expressions to match your condition against values in the
request
• https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html
POLICIES – USER POLICIES