What's the difference between buildspec, appspec, and rolling my own AMI?

4k Views Asked by At

I'm fairly confused about how the buildspec.yml and the appspec.yml files differ from one another, aside from structure. It doesn't seem like the phase commands from my buildspec have much effect on the deployment environment, and there is similar ambiguity between which appspec hook to use when running a procedure, like an installation. So long as the procedure happens before the phase that needs it, I don't see the difference in the phases. (I have read the spec reference docs; they mostly confirm that the phases are titled for their purpose, but not really what the purpose is.)

As an example, why wouldn't I just bake my own AMIs with packer each time I had to do a deployment, and then standup a new host and attach the AMI?

1

There are 1 best solutions below

0
On

Here you go.

buildspec.yml

This file is use to make build from the source artifact created by pipeline. Again this is only necessary for the application which require to make build such as angular, react etc. if you have nodejs application you do not need this file.

appspec.yml

This file is required if you are trying to deploy your application to an EC2 instance. The deployment group that is created for the EC2 instance will look for this file in your root which contain series of instruction that need to be followed after the files have been overtite in the ec2 instance. for eg: if you have nodejs application then it requires to re-run the command run application.

Want to add some more differene ? Please comment.