Creating a bucket

  1. To create an S3 bucket, we simply search for the S3 service in the management console and then click the Create bucket button in the Amazon S3 Dashboard: 

  1. In the Create bucket dialog, we need to give the bucket a name. The name needs to be unique across all of AWS, as all of the buckets are automatically available via a unique DNS address in the following format:
 http://{your-bucket-name}.s3.amazonaws.com 

Usually, companies tend to find a good bucket naming schema, perhaps reversing the name of your domain like com-example-my-bucket-name or similar. The buckets also cannot contain any uppercase characters and must begin with a letter or number. Unique names between 3 and 63 characters are supported.

  1. In our example, we will create a bucket with a random number, dash, and the name mynewbucket, specifically 685684-mynewbucket. This bucket will be accessible via the following DNS name:
http://685684-mynewbucket.s3.amazonaws.com
  1. We also need to select a region where we want to store the bucket. In our example, we are using use-west-2, the Oregon region:

  1. In the next step, we have the ability to configure versioning, which will enable us to maintain different versions of the same file name in the bucket. Think of this as a way to prevent content from accidentally being modified or deleted. Be careful to make sure to enable expiry of versioned objects as the full amount of space consumed by each version counts against your S3 usage. This is especially important when delivering temporary files and logs to S3.
  1. In this step, we can also set up a log group and add tags to the bucket that help us identify the resource and maintain the inventory:

  1. Scrolling down, in Step 7 we can set the object-level logging, which allows us to use CloudTrail to determine and log each and every operation against each object. We can also deliver object-action metrics to CloudWatch. Both of these features carry extra costs. Objects can also be encrypted on the server side automatically at no additional cost. This should be enabled when compliance, governance, and other requirements need us to do so:

  1. In the next step, we can publicly access system permissions. For our purposes, we will be making the bucket publicly accessible so we need to un-check the setting to disable blocking new public policies. We can also uncheck the blocking of public ACLs if we want to control the public access through ACLs. The bucket needs to be public so we can deliver the static web page from this bucket in the next part of this exercise:

  1. In the Review tab, we get a summary of all the features created, and we finish the task by clicking Create bucket:

  1. Once the bucket is created we will apply the following policy to make it public. Please replace the 685684-mynewbucket with your bucket name:
 {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::685684-mynewbucket/*"
}
]
}
  1. Click on the bucket, select Permissions and then Bucket policy. Paste the previous code into the bucket policy and then click Save. Your bucket will be made public this way:

  1. Once the bucket is created, we can see it in the list of our buckets within the S3 management console:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.255.87