AWS 15, 16, 17 Flashcards
How do we enable Cross Account in CodeCommit?
Use IAM Role in your AWS Account and use AWS STS (with AssumeRole API)
How can you trigger CodeCommit notifications?
AWS SNS, AWS Lambda or AWS CloudWatch Event Rules
What are artifacts in CodePipeline?
Artifacts are stored in Amazon S3 and passed on to the next stage. It is the result of the previous stages action.
What must you do before you can interact (clone, pull, push, etc) with a CodeCommit repository?
You must generate credentials for either HTTPS or SSH in IAM for the User you are using.
What is the CodePipeline service role?
It is an IAM role that allows CodePipeline to communicate with the services it needs to
Stages in CodePipeline cannot have multiple Action Groups, true or false?
False. Stages can have multiple action groups
How can we define our CodeBuild build instructions?
With a buildspec.yml file. Must be root of directory.
How can we speed up our building of an artifact in CodeBuild?
We can choose the cache option to store needed dependencies for our build
By default, your CodeBuild containers will be launched inside your VPC, true or false?
False. They will be launched outside. Therefore, it cannot access resources in a VPC. You must specify a VPC configuration.
What are the steps to make CodeDeploy work?
Each EC2 machine (or On Premise machine) must be running the CodeDeploy Agent;
The agent is continuously polling AWS CodeDeploy for work to do;
Application is pulled from GitHub or S3;
EC2 will run the deployment instructions;
CodeDeploy Agent will report success / failure of deployment on the instance
How are EC2 instances grouped in CodeDeploy?
They are grouped by deployment group (dev / test/ prod)
What is the order of the hooks in CodeDeploy?
ApplicationStop; DownloadBundle; BeforeInstall; AfterInstall; ApplicationStart; ValidateService;
What are the two primary types of deployment targets for AWS CodeDeploy?
Set of EC2 instances with tags, or directly to an ASG. Can do a mix of both if needed/wanted/
Before we can do CodeDeploy with EC2 instances, what must we do?
Make sure the Instances have the CodeDeploy agent;
We must create two IAM roles. We need to create one for CodeDeploy to interact with other AWS services and create one for our EC2 so that it can access necessary resources.
What file must be present for your application in CodeDeploy?
appspec.yml ; Must be at root directory.
What are the two deployment types for CodeDeploy?
In-place and Blue/Green
What are the three provided deployment configurations for CodeDeploy Deployment Group?
AllAtOnce, OneAtATime, HalfAtATime
Regarding in-place deployments between CodeDeploy and an ASG, what happens to instances that are created after a deploy by the ASG?
CodeDeploy and ASG will go ahead and run a deployment on those instances
For a Blue/Green deployment in CodeDeploy with an ASG, what must we make sure we have?
We need an ELB. A new target group will be created to deploy the new instances and versions and health check them. Then the ELB will route to the new versions in the new target group. Will get rid of the old one.
If a rollback happens in CodeDeploy, what happens?
CodeDeploy redeploys the last known good revision as a new deployment. So we will get a new deployment id.
What is CodeStar?
It quickly builds a project with a CICD pipeline, repository, possible IDE, team member access and other project needs.
Which AWS Service helps you run automated test in your CICD?
CodeBuild
You are looking to automatically trigger a code analysis at each commit in CodeCommit to ensure your developers haven’t committed secret credentials. How can you achieve this?
Integrate SNS / Lambda with CodeCommit
You want to send email alerts anytime pull requests are open or comments are added to commits in CodeCommit. You should use
AWS CloudWatch events that push to SNS
What are the use cases for SNS / Lambda notifications in CodeCommit?
Deletion of branches;
Trigger for pushes that happens in master branch;
Notify external Build System;
Trigger AWS Lambda functions to perform codebase analysis;
What are the use cases for CloudWatch Event Rules?
Trigger for pull request updates (created, updated, deleted, commented);
Commit comment events;
You want to give a colleague that has an IAM User in another AWS Account access to your CodeCommit repository. How should you achieve that?
Setup an IAM Role in your account and tell him to use STS cross-account access to assume that role
How can we react to CodePipeline state changes?
AWS CloudWatch Events. We can have these create SNS notifications like failed pipelines and cancelled stages
Which AWS Services allow you to track and audit API calls made to and from CodePipeline?
AWS Cloud Trail
Your CodeBuild has failed. What isn’t a solution to troubleshoot what happened?
Look through Logs in AWS CloudWatch logs;
Look through Logs in AWS S3;
SSH into the CodeBuild container to debug from there;
Run CodeBuild locally to reproduce the build;
SSH into CodeBuild container. CodeBuild containers are deleted at the end of their execution. You can’t SSH into them, even while they’re running
Which hook step should be used in appspec.yml file to ensure the application is properly running after being deployed?
ValidateService
You’ve created a fleet of EC2 & on-premise instances and you’re trying to run your first CodeDeploy. It doesn’t work, why?
You’ve probably forgotten to install and start the CodeDeploy agent