Deploying a static application in an EC2 instance from the S3 Bucket using AWS CodeDeploy
We saw a lot of theoretical stuff related to AWS CodeDeploy. Now with the help of those theories and concepts, we will try to deploy a sample NodeJS application on an EC2 machine using AWS CodeDeploy. The revision means source code build with AppSpec.yml
file will be zipped and placed in the S3 bucket.
Getting ready
Before moving forward, one should know the following things first:
- Creating an IAM role and attaching permission to that role.
- Creating an EC2 instance in a public subnet and attaching the role in it.
- Creating the S3 bucket and uploading the file in that.
If you know these things, then you can continue.
Note
Refer to this link to know more about the IAM role, http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html.
How to do it...
- First of all, we have to create an IAM role for the EC2 instance and attach AWS CodeDeploy and AWS S3 access. We have named the role
CodeDeploy-Instance-Profile...