Are GitHub pages running under AWS S3

Step 3: Upload your "Hello, World!" Application to Amazon S3

Now you prepare your source content and upload it to a location from which CodeDeploy can serve it. The instructions below demonstrate how to provision an Amazon S3 bucket, prepare the application revision files for the bucket, bundle the revision files, and then push the revision into the bucket.

You can also deploy applications from GitHub repositories to instances with CodeDeploy. However, this option is not described in this tutorial. For more information, see Integrating CodeDeploy with GitHub.

Provision an Amazon S3 Bucket

Create a storage container or-Bucketin Amazon S3 - or use an existing bucket. Make sure that you can upload the revision to the bucket and that Amazon EC2 instances that are used in deployments can download the revision from the bucket.

You can use the AWS CLI, the Amazon S3 console, or the Amazon S3 APIs to create an Amazon S3 bucket. After you've created the bucket, you'll need to give it and your IAM user access permissions.

Bucket names must be unique in Amazon S3 for all AWS accounts. In case you can't use: Try a different bucket name like followed by a hyphen and your initials or some other unique identifier. You then need to replace with your bucket name throughout the tutorial.

The Amazon S3 bucket must be created in the same AWS Region in which the target Amazon EC2 instances are launched. For example, if you create the bucket in the US East (N. Virginia) region, your target Amazon EC2 instances must be launched in the US East (N. Virginia) region.

To create an Amazon S3 Bucket (CLI):

Call thembCreate an Amazon S3 Bucket:

How to Create an Amazon S3 Bucket (Console)

  1. Open the Amazon S3 console at

  2. In the Amazon S3 console, clickCreate a bucketout.

  3. Enter in the field Bucket name a name for the bucket.

  4. Choose from the list region the target region and click Create.

Granting permissions to the Amazon S3 bucket and your IAM user

You must have permissions to upload to the Amazon S3 bucket. You can specify these permissions through an Amazon S3 bucket policy. For example, in the following Amazon S3 bucket policy, the use of the wildcard character (*) enables the AWS account to upload files to any directory in the Amazon S3 bucket:

For information about how to view your AWS Account ID, see Finding Your AWS Account ID.

Now is a good time to check that the Amazon S3 bucket allows download requests from every participating Amazon EC2 instance. You can grant this permission through an Amazon S3 bucket policy. For example, in the following Amazon S3 bucket policy, using the wildcard character (*) allows any Amazon EC2 instance with an attached IAM instance profile that has the ARN to name files from any directory in the Amazon S3 bucket:

For more information on how to generate and attach an Amazon S3 bucket policy, see Bucket Policy Examples.

Your account must be authorized to upload the revision to the Amazon S3 bucket. One way to grant this permission is through an IAM policy. The following IAM policy allows your IAM user to upload revisions to any location in the Amazon S3 bucket:

For information about how to create and attach an IAM policy, see Working with Policies.

Prepare the application files for the bucket

Make sure that the website, the AppSpec file and the script are saved on your development computer as follows:

Bundle the application files into a single archive file and push the archive file

Bundle the files in an archive file (also applicationrevision called).

You may be charged for storing objects in a bucket and transferring application revisions to or from a bucket. For more information, see Amazon S3 Pricing.

  1. On the development computer, go to the folder where the files are located:

    If you do not change to this folder, file bundling starts in the current folder. For example, if the current folder is in place, the bundling process begins with the files and subfolders in the folder, which may contain more than just the subfolder.

  2. Call thecreate-applicationRegister a new application named Using CodeDeploy:

  3. Call CodeDeploypush to bundle the files, upload the revision to Amazon S3, and register information about the uploaded revision in CodeDeploy with a single action.

    This command bundles the files from the current directory (except for hidden files) in a single archive file with the name loads the revision to the bucket and registers information about the uploaded revision with CodeDeploy.

Step 2: Configure the source content
Step 4: Deploy Your Application