What is aws code commit
Source control service
Data is encrypted in transit and at rest.
Tracks an manages code changes, mainatins version histroy etc.
What is aws code deploy
Automated deployment to EC2 on premises systems and lambda
what is aws code pipeline
CI/CD workflow tool. Fully automates entire release process. Build deploy test
What is CI/CD
Best practices for software development and deployment
Enable frequent changes whilst maintaining service stability.
How does CI work
Developers make changes to code repository
Triggers and automated build.
What is continuous delivery
ITs about automating the build test and deployment functions.
What deployment approaches are there
in place and blue-green
How does inplace deployment work
- App is stopped on each instance
- Latest revision installed
- Instance out of service (capacity reduced)
- If instances are behind load balancer, you can configure load balancer to stop sending requrests to the instances being upgraded
- Also called rolling update
- Only ued for ec2 and on premis system, no lambda support
If you need to rollback, previous versions gotta be redeployed.
How does blue green deployment work
New instances are provisioned and the latest revision is installed on the new instances.
Blue is the active deployment, green is the new release
new instances are registered with and ELB. Traffic is just routed to the new instances. OG instances terminated
Why is bluegreen deployment so good
Upgrades, They can be created ahead of time.
Switchin back is easier (if you havent terminated the old ones)
What is a deployment group
Set of EC2 instances or lambda functions to which a new revision of software is gonna get deployed
Process and componenets used to apply a new revision
Set of deployment rules as well as success/fail conditions
App spect file
Defines deployment actions you want aws codedeploy to execute
Everythig needed to deploy the new version. App spec file, executables etc
unique idendifier for application you want to deploy. Ensures the correct combo of revision, deployment config and deployment group
What is the appspec file
Used to define the params that will be used for codedeploy deployment.
Its structure varies depending on whether you're deploying to EC2, lambda or on premise.
How are appspec files written if its lambda deployments
- Version: Reserved for future use
- Resources: Name and properties of lambda funct to deploy
- Hooks: Specifies lambda functions to run at set points in the deployment
What hooks can we use in lambda appspec file
Before allow function
how does appspec file look for ec2 and on premises
- Version: Reserved for future use.
- OS: Operating system yo're on
- Files:Location of any files that need to be copied
- Hooks: Speicfy scripts to be run at set times
Where does the appspec file have to go for EC2 and on premise
root directory of your revision.
What are the steps to do order of hook for a code-deploy in place -deployment
What is aws code build
A fully managed build service which runs a set of commands that you define
eg compiles code, runs tests and produces artifacts that are ready to deploy
It takes source code form code commit to then build out a docker image
What is docker
an open source tech whic lets you create apps based on linux or windows containers
Container is a lightweight standalone software package which has everything the sofwhere needs to run.
AWS provides elastic container service as a fully managed clustered platform which lets you run your docker images in the cloud
How did faye do the docker thing
Manually built a docker image from a dockerfile.
Source code in codecommit was added with buildspec.yml to contain all the manaual commands to build tag and push to elastic container registry.
Code build built image. New docker image created. Then visible in ECR.
What are the key dkocker commands
- docker build
- docker tag
- docker push. Pushes to ecr repo.
Can you ovverride the settings in buildspec.yml
Yes with commands in console
If build fails, check build logs in codebuild console. Can see in cloudwatch
What is cloudformation?
Service that lets you manage configure and provision AWS infrastructure as code.
How are resources defined in a cloudformation template
Use a cloud formation template
- Supports YAML or JSON.
- Its gets interpreted and the API calls are made to create the resources defined
Benefits of cloudformation
- Infra provisioned consitently
- Less time and effort than manual
- version control possible
- free to use (only charged for createion)
- Can be used to manage updates and dependencies
- Can be used to rollback and delte wholestack
Cloud formation template structure?
- AWS templateformat
- resources - the only mandatory bit
What is SAM?
Serverless application model.
Extension to cloudformation used to define serverless apps. So if you want a serverless stakc you can use sam with cloudformation to make life easy.
Simplified syntax for defining serverless resources: APIs Lambda functions, Dynamo DB tables. etc.
You can use it to package deployment code, upload it to s3 and deploy serverless application
What is a cloudformation nested stack?
Allows you to reuse bits of cloudformation code for common use cases.
EG standard config for load balancer, web server, application server etc.
Instead of copying out the code each time, you can create a standard template for each common use case and reference from within cloudformation temp.
Whats the most important bit to add into a cloudformation template if you want to have a nested stack?
- Its the resource tag with the url for the location of the nested stack.
You can store it in s3
When deploying application code to lambda, the appspec file can be written in which slanguage
When deploying applicatio code to ec2, the appspec file can be written in which language