Developer Theory (ACG) Flashcards

1
Q

What is CI/CD?

A

Continuous Integration, Continuous Delivery/Deployment

A software development best practice by making small changes and automate as much as possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe Continuous Integration

A

Integrating or merging the code changes frequently - at least once per day.

Think CodeCommit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe Continuous Delivery

A

Automating the build, test and deployment functions.

Think CodeBuild and CodeDeploy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe Continuous Deployment

A

Fully automated release process, code is deployed into Stage/Prod as soon as it has successfully passed through the release pipeline.

Think CodePipeline.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an In-Place deployment?

A

The app is stopped on each instance and the new release is installed (also known as a rolling update).

Capacity is reduced as each instance is updated. You have to re-deploy to rollback and Lambda is not supported.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Blue/Green deployment?

A

New instances are provisioned where the new release is installed. Blue represents the active deployment, green is the new release.

Switch back and forth with your Load Balancer. You pay for 2 environments until you terminate the old servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the AppSpec File?

A

Configuration file that defines parameters for CodeDeploys such as target OS, files, hooks, etc. Should be saved in the root directory. Hooks are lifecycle events that have a very specific run order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Run Order?

A

Lifecycle event hooks are run in a specific order known as the Run Order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In-Place Deployment can be broken down into 3 broad phases, what are they?

A

De-registering, installation, re-registering with a Load Balancer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the logical flow of an In-Place deployment? (7 steps)

A
ApplicationStop
DownloadBundle
BeforeInstall
Install
AfterInstall
ApplicationStart
ValidateService
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is CodeArtifact?

A

Central repo that can be used by all devs to obtain the correct version of software packages/libraries required for their projects. Think nuGet packages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you pull packages from an external public repository such as npm?

A

Create an upstream repository with an external connection to the public repository i.e. npm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is SAM?

A

Serverless Application Model (SAM)

Extension for CloudFormation to define and provision serverless apps. Has its own AWS SAM CLI and its own commands to package and deploy:

sam package
sam deploy

Packages app and uploads to S3
Deploys serverless app using CloudFormation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are CloudFormation Nested Stacks?

A

Allows you to re-use CloudFormation code for frequently used configs, e.g., load balancers, web/app servers.

Reference it in the Resources section of any CloudFormation template using the Stack resource type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What AWS service provides source control, enabling teams to collaborate on code, html pages, scripts, images, and binaries?

A

CodeCommit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What AWS service compiles source code, runs tests and produces packages that are ready to deploy?

A

CodeBuild

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What AWS service automates code deployments to EC2 instances, Lambda and on-prem systems?

A

CodeDeploy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What AWS service is an end-to-end solution, allowing you to build, test, and deploy your app every time there is a code change?

A

CodePipeline

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A virtual operating environment with everything software needs to run are called what?

A

Containers

Includes libraries, system tools, code and runtime.

Apps can be built using independent stateless components, or microservices running in multiple containers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is ECS?

A

Elastic Container Service

ECS can run your containers on clusters of VMs. Docker and Windows containers are supported.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is Fargate?

A

You can run containers without EC2 instances. Serverless!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is ECR?

A

Elastic Container Registry

Where you store your container images.

23
Q

When using Elastic Beanstalk, you can deploy your Docker container to a single EC2 instance. True or False?

A

TRUE

You can also deploy multiple docker instances to an ECS cluster.

24
Q

How do you deploy a docker container to Elastic Beanstalk?

A

Just upload your code bundle to Elastic Beanstalk.

25
Q

What section is mandatory in your CloudFormation template?

A

Resources

26
Q

Where do you input custom values, like the name of an EC2 SSH key pair in your CloudFormation template?

A

Parameters

27
Q

Where do you provision resources according to the environment in your CloudFormation template?

A

Conditions

28
Q

Which section allows you to create custom mappings like ‘Region : AMI’ in your CloudFormation template?

A

Mappings

29
Q

Which section references code located in S3 to specify the use of the Serverless Application Model (SAM)?

A

Transform

30
Q

Where do you define nested stacks in your CloudFormation template?

A

Resources

Reference nested stacks in the Resources section using the Stack resource type.

31
Q

Which section allows you to export values from one stack to another in CloudFormation?

A

Outputs

Use the import value function to import values.

32
Q

When deploying application code to a EC2/On-Premises compute platform, the AppSpec file can be written in which language?

A

YAML

AppSpec files on an EC2/on-premises compute platform must be a YAML-formatted file named appspec.yml and it must be placed in the root of the directory structure of an application’s source code. Otherwise, deployments fail.

33
Q

You are using CloudFormation to create a new S3 bucket, which of the following sections would you use to define the properties of your bucket?

A

Resources

The Resources section specifies the stack resources and their properties, such as an Amazon Elastic Compute Cloud instance or an Amazon Simple Storage Service bucket.

34
Q

Which AWS service can be used to centrally store and version control your application source code, binaries and libraries?

A

CodeCommit

AWS CodeCommit is a fully-managed source control service that hosts secure Git-based repositories. It makes it easy for teams to collaborate on code in a secure and highly scalable ecosystem.

35
Q

Which of the following should you do if you want to allow developers to pull packages from an external public repository and make them available in a CodeArtifact repository?

A

Create an upstream CodeArtifact repository with an external connection to the external repository. Associate the upstream repository with the repository used by the developers.

36
Q

What is the purpose of creating an external connection when configuring CodeArtifact?

A

An external connection is a connection between a CodeArtifact repository and an external, public repository so that packages can be fetched from the external repository.

37
Q

Which of the following practices allows multiple developers working on the same application to merge code changes frequently, without impacting each other and enables the identification of bugs early on in the release process?

A

Continuous Integration

Continuous Integration (CI) is the practice of merging all developers’ working copies to a shared repository frequently, preferably several times a day. One of the key benefits of integrating regularly is that you can detect errors quickly and locate them more easily. As each change introduced is typically small, pinpointing the specific change that introduced a defect can be done quickly.

38
Q

Which AWS CloudFormation section specifies one or more macros that AWS CloudFormation uses to process your templates, and is required for AWS SAM template files?

A

Transform

The Transform section specifies one or more macros that AWS CloudFormation uses to process your template. The Transform section builds on the simple, declarative language of AWS CloudFormation with a powerful macro system. The declaration Transform: AWS::Serverless-2016-10-31 is required for AWS SAM template files.

39
Q

You want to use the output of your CloudFormation stack as input for another CloudFormation stack. Which section of your CloudFormation template would you use to help you do this?

A

Outputs

40
Q

Which of the following is an artifact repository that makes it easy for developers to find approved software packages they need to build their applications?

A

CodeArtifact

41
Q

When deploying application code to Lambda, the AppSpec file can be written in which languages?

A

YAML and JSON

The application specification file (AppSpec file) is a YAML-formatted or JSON-formatted file used by CodeDeploy to manage a deployment.

42
Q

Your company has moved to AWS so it can use “Infrastructure as Code”. You would like to apply version control to your infrastructure, so that you can roll back infrastructure to a previous stable version if needed. You would also like to quickly deploy testing and staging environments in multiple regions. What services should you use to achieve this?

A

CloudFormation and CodeCommit.

CloudFormation allows for the rolling back to prior stacks and is AWS’s go to Infrastructure as code solution. CodeCommit is a fully-managed source control service for secure Git-based repositories.

43
Q

Part of your CloudFormation deployment fails due to a misconfiguration, by default what will happen?

A

CloudFormation will rollback the entire stack

By default, the “automatic rollback on error” feature is enabled. This will direct CloudFormation to only create or update all resources in your stack if all individual operations succeed. If they do not, CloudFormation reverts the stack to the last known stable configuration.

44
Q

In the CodeDeploy AppSpec file, what are hooks used for?

A

To specify code, scripts or functions that you want to run at set points in the deployment lifecycle.

The hooks section specifies the location (as relative paths starting from the root of the revision bundle) of the scripts to run during each phase of the deployment. Each phase of a deployment is called a deployment lifecycle event.

45
Q

Which AWS service can be used to automatically install your application code onto EC2, on-premises systems and Lambda?

A

CodeDeploy

CodeDeploy is a deployment service that automates application deployments to Amazon EC2 instances, on-premises instances, serverless Lambda functions, or Amazon ECS services.

46
Q

Which AWS service can be used to fully automate your entire release process?

A

CodePipeline

47
Q

You want users to receive an email notification whenever they push code to their AWS CodeCommit repositories. How can you configure this?

A

Configure Notifications in the AWS CodeCommit console, this will create a CloudWatch Events rule to send a notification to an Amazon SNS topic which will trigger an email to be sent to the user

You can set up notification rules for a repository so that repository users receive emails about the repository event types you specify. Notifications are sent when events match the notification rule settings. You can create an Amazon SNS topic to use for notifications or use an existing one in your AWS account. You can use the CodeCommit console and the AWS CLI to configure notification rules.

48
Q

Which of the following approaches allows you to re-use pieces of CloudFormation code in multiple templates, for common use cases like provisioning a load balancer or web server?

A

Use a CloudFormation nested stack

49
Q

Which 4 things are suitable to store in CodeArtifact?

A

Libraries
Documentation relating to your application
Deployable packages
Compiled applications

CodeArtifact is a fully managed artifact repository service that makes it easy for organizations of any size to securely store, publish, and share software packages used in their software development process. This includes everything needed to build your application, including libraries, deployable packages, compiled applications, and documentation relating to your application.

50
Q

How can you prevent AWS CloudFormation from deleting successfully provisioned resources during a stack create operation, while allowing resources in a failed state to be updated or deleted upon the next stack operation?

A

Two things:

  1. In the CloudFormation console, for Stack failure options, select “Preserve successfully provisioned resources”
  2. Use the “–disable-rollback” flag with the AWS CLI
51
Q

Which two things can you define using the Transforms section of the CloudFormation template?

A
  1. To re-use code located in S3

2. To specify the use of the Serverless Application Model for Lambda deployments

52
Q

You are running your application using Docker provisioned with Elastic Beanstalk. You would like to upgrade the application to a new version. How should you approach this?

A

Bundle your Dockerfile and the application code into a zip file, then upload and deploy it using the Elastic Beanstalk console.

53
Q

You are deploying an application to a number of EC2 instances using CodeDeploy. What is the name of the file used on the EC2/on-premises compute platform?

A

appspec.yml

AppSpec files on an EC2/on-premises compute platform must be a YAML-formatted file named appspec.yml and it must be placed in the root of the directory structure of an application’s source code. Otherwise, deployments fail.

54
Q

Which AWS service can be used to compile source code, run tests and also package code?

A

CodeBuild