A Cloud Guru Test Flashcards

1
Q

How can you configure CodeBuild to notify the DevOps team of a failure in the build process?

A

Use CloudWatch Events and an SNS topic to notify subscribers of build events. CodeBuild natively supports CloudWatch Events, and SNS is a subscription based notification service that integrates with CloudWatch.

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

Which service enables you to automatically build, test and release new software whenever a developer makes an update to their code?

A

CodePipeline. CodePipeline automates the build, test and can be used to deploy phases of your release process every time there is a code change, based on the release model you define.

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

What services are compatible with CodeDeploy managed deployments?

A

CodeDeploy supports EC2, ECS (both EC2 and Fargate), Lambda and on-premises servers.

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

A developer needs to share an EBS volume with a second AWS account. What actions need to be performed to accomplish this task in the most optimal way?

A

It is not possible to directly share an EBS volume with another account. In order to accomplish the required task, it is required to create an EBS volume snapshot and grant permissions to that snapshot to the second AWS account.

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

An organization has mandated that all data within its DynamoDB tables must be encrypted at rest using an AWS owned key. What must a developer do to ensure this?

A

There’s no need to do anything; all DynamoDB tables are encrypted at rest with an AWS owned key by default. Non-encrypted DynamoDB tables are no longer supported in AWS.

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

What is canary deployment?

A

With canary deployment, traffic is shifted in two increments. The options specify the percentage of traffic that’s shifted to your updated Lambda function version in the first increment, and the interval, in minutes, before the remaining traffic is shifted in the second increment.

E.g., :
Canary10Percent30Minutes

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

What is linear deployment?

A

Linear deployment is when traffic is shifted in equal increments with an equal number of minutes between each increment.

E.g.:
Linear10PercentEvery1Minute

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

What is all at once deployment?

A

All traffic is shifted from the original Lambda function to the updated Lambda function version at once.

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

How to deploy a serverless application gradually?

A

If you use AWS SAM to create your serverless application, it comes with built-in CodeDeploy to ensure safe Lambda deployments. In the SAM template, you can specify the AutoPublishAlias and the DeploymentPreference.

The AutoPublishAlias detects when new code is being deployed and creates and published an updated version of that function with the latest code. It automatically creates an alias that points to the updated version of the Lambda function.

In the DeploymentPreference type, you can specify canary, linear or all at once.

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

What is the Lambda IteratorAge metric?

A

For stream-based invocations, Lambda emits the IteratorAge metric. IteratorAge metric is the time between when the last record in a batch was recorded and when Lambda reads the record. In general, iterator age increases when a function can’t keep up with processing the amount of data that is being written to the streams.

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

What’s the proper way of storing a credit card number that a Lambda function needs to use?

A

You can store it as an environment variable, however you should encrypt this before deploying, because the default encryption occurs after deploying, not during deployment.

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

How can my AWS Lambda function customize its behavior to the device and app making the request?

A

When called through the AWS Mobile SDK, Lambda functions automatically gain insight into the device and application that made the call through the ‘context’ object.

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

What happens if your Lambda code is too large?

A

It will trigger a code storage exception error.

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

What is the PreconditionFailedException (HTTP status code 412) in Lambda?

A

Your Lambda will throw a PreconditionFailedException when the RevisionId does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or GetAlias API to retrieve the latest RevisionId for your resource.

This error is often used as a protection against a racing condition when multiple people are working on the same function.

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

What happens if most or all clients of an API invalidates the cache?

A

It could significantly increase the latency of your API. You can either impose an InvalidateCache policy, or choose the Require authorization checkbox in the console.

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

What is a cross-origin HTTP request?

A

A cross-origin HTTP request is one that is made to:

  • a different domain
  • a different subdomain
  • a different port
  • a different protocol
17
Q

What is a simple HTTP request?

A

An HTTP request is simple if all of the following conditions are true:

  • it is issued against an API resource that allows only GET, HEAD and POST requests
  • If it is a POST method request, it must include an Origin header
  • The request payload content type is text/plain, multipart/form-data, or application/x-www-form-urlencoded.
  • The request does not contain custom headers
18
Q

What’s required for a response to a simple cross-origin POST method request?

A

For a simple cross-origin POST method request, the response from your resource needs to incldue the header Access-Control-Allow-Origin.

19
Q

What is a symmetric key?

A

When you create a customer master key (CMK) in KMS, by default, you get a symmetric CMK. Symmetric keys are used in symmetric encryption, where the same key is used for encryption and decryption.

AWS services that are integrated with KMS use symmetric CMKs to protect your data. These services do not support asymmetric CMKs.

20
Q

You have used a CMK to create a data key using the GeneratedDataKey operation to encrypt your application’s data using envelope encryption. You have been asked to provide temporary secured access to external auditors so that they can audit the data stored. These auditors should be able to immediately gain access to your data. What is the most effective and efficient way of achieving this?

A

Use grant tokens after using grants with the decrypt and re-encrypt operation. Using grant tokens received from the CreateGrant request will mitigate potential delay and grant immediate access. Decrypt operation is needed for the auditors to decrypt and re-encrypt this data.

21
Q

What is data key caching?

A

Data key caching lets you reuse the data keys that protect your data, instead of generating a new data key for each encryption operation.

Data key caching can reduce latency, improve throughput, reduce cost. In particular, caching might help if your application is hitting the KMS requests-per-second limit and raising the limit does not solve the problem.

However, these benefits come with some security tradeoffs. Encryption best practices generally discourage extensive reuse of data keys.

22
Q

What’s the LocalCryptoMaterialsCache?

A

To make data key caching easier to implement, the AWS Encryption SDK provides LocalCryptoMaterialsCache, an in-memory, least-recently-used cache with a configurable size.

23
Q

You’re the lead developer for a company that uses KMS to decrypt passwords from an RDS MySQL database using an asymmetric CMK. While decrypting the data you receive an InvalidCipherTextException error. What could have caused this error?

A

EncryptionAlgorithm is set to default value. Asymmetric CMKs cannot use the default algorithm, because the default one is for used for symmetric keys only. For symmetric CMKs, the default value would work.

24
Q

How do you control the behaviors of your APIs backend interactions?

A

You control the behaviors of your APIs backend integrations by setting up the integration request and integration response. These involve data mappings between a method and its corresponding integration.

25
Q

What are the two ways to configure server-side encryption for S3 artifacts?

A

AWS CodePipeline creates an S3 artifact bucket and default AWS-managed SSE-KMS encryption keys when you create a pipeline using the Create Pipeline wizard. The master key is encrypted along with object data and managed by AWS.

OR

You can create and manage your own customer-managed SSE-KMS keys.

26
Q

How is data encrypted using envelope encryption?

A

First, the data is encrypted using a plaintext data key. The data key is then further encrypted using a plaintext master key.

27
Q

You have a number of Lambda functions that need to be developed using AWS CodeDeploy. The Lambda functions have gone through multiple code revisions and versioning in Lambda is being used to maintain the revisions. Which of the following must be done to ensure that the right version of the function is deployed in AWS CodeDeploy?

A. Specify the version to be deployed in the AppSpec file.
B. Specify the version to be deployed in the BuildSpec file.
C. Create a Lambda function environment called ‘VER’ and mention the version that needs to be deployed.
D. Create an ALIAS for the Lambda function. Mark this as the recent version. Use this ALIAS in CodeDeploy.

A

A. Specify the version to be deployed in the AppSpec file.

If your application uses the AWS Lambda compute platform, the AppSpec file can be formatted with either YAML or JSON. It can also be typed directly into an editor in the console. The AppSpec file is used to specify: the AWS Lambda Function version to deploy, and the functions to be used as validation tests.

28
Q

You are in charge of deploying an application that will be hosted on an EC2 instance and sit behind an Elastic Load Balancer. You have been requested to monitor the incoming API connections to the Elastic Load Balancer. Which of the below options can suffice this requirement?

A. Use AWS CloudTrail with your load balancer.
B. Enable access logs on the load balancer.
C. Use a CloudWatch Logs Agent by installing on EC2.
D. Create a custom metric CloudWatch filter on your load balancer.

A

B. Enable access logs on the load balancer.

Elastic Load Balancing provides access logs that capture detailed information about requests sent to your load balancer. Each log contains information such as the time the request was received, the client’s IP address, latencies, request paths, and server responses. You can use these access logs to analyze traffic patterns and troubleshoot issues.

29
Q

How do you resolve a LambdaThrottledException while using Cognito Events?

A

To resolve a LambdaThrottledException while using Cognito events, you need to perform retry on sync operations while writing the Lambda function.

30
Q

What is Cognito Events?

A

Cognito Events allows you to execute an AWS Lambda function in response to important events in Amazon Cognito. Cognito raises the Sync Trigger event when a dataset it synchronized. You can use the Sync Trigger event to take an action when a user updates data. The function can evaluate and optionally manipulate the data before it is stored in the cloud and synchronized to the user’s other devices, or to update other values in the dataset based on incoming data such as issuing an award when a player reaches a new level.

31
Q

How would you go about securing a CI/CD pipeline that uses resources created or managed by another AWS account?

A

In some cases, you want to create a pipeline that uses resources that are created or managed by another AWS account. E.g., you might want to use one account for your pipeline and another for your AWS CodeDeploy resources. To do so, you must create a AWS Key Management Service (KMS) key to use, add the key to the pipeline, and set up account policies and roles to enable cross-account access.

32
Q

Can you use the customer master key to encrypt and decrypt your data?

A

No, you should never use your customer master key directly to encrypt/decrypt your data.

33
Q

How do you protect your encryption key?

A

When you encrypt your data, your data is protected, but you have to protect your encryption key. One strategy is to encrypt it. Envelope encryption is the practice of encrypting plaintext data with a data key, and then encrypting the data key under another key. You can even encrypt the data encryption key under another encryption key, and encrypt that encryption key with another encryption key. But, eventually, one key must remain in plaintext so that you can decrypt the keys and your data. This top-level plaintext key encryption key is known as the master key.

34
Q

What does AWS Key Management Service do?

A

AWS KMS helps you protect your master keys by storing and managing them securely. Master keys stored in AWS KMS, known as customer master keys (CMKs) never leave KMS unencrypted. To use an AWS KMS CMK, you must call KMS.

35
Q

What is a Lambda alias and how are they used?

A

A Lambda alias is like a pointer to a specific Lambda function version. Users can access the function version using the alias ARN. An alias can only point to a function version, not another alias. You can update an alias to point to a new version of the function.

Event sources such as S3 invoke your Lambda function. These event sources maintain a mapping that identifies the function to invoke when events occur. If you specify a Lambda function alias in the mapping configuration, you don’t need to update the mapping when the function version changes.

36
Q

What are routing configurations used for?

A

Use routing configurations on an alias to send a portion of traffic to a second version. E.g., you can reduce the risk of deploying a new version by configuring the alias to send the most of the traffic to the existing version, and only a small percentage of traffic to the new version.

You can point an alias to a maximum of two Lambda function versions.

37
Q

How do you configure alias routing?

A

Use the create-alias and update-alias commands to configure the traffic weights between two function versions. When you create or update the alias, you specify the traffic weight in the routing-config parameter.

38
Q

What do you need to do while enabling CORS on resources using API Gateway for all responses apart from 200 response of the OPTIONS method?

A

While enabling CORS on resources using API Gateway, for all responses apart from 200 response of the OPTIONS method, we need to manually configure to return Access-Control-Allow-Origin with ‘*’ or specific origins to fulfill pre-flight handshakes.

39
Q

A company is developing an application which interacts with a DynamoDB table. There is now a security mandate that all data must be encrypted at rest. How can you achieve this requirement?

A. Enable encryption using AWS owned CMK
B. Enable encryption using AWS managed CMK
C. Enable encryption using client keys
D. Enable your application to use the SDK to decrypt the data.

A

A & B. Enable encryption using AWS owned and AWS managed CMKs.

DynamoDB encryption is mandatory at the time of table creation itself and is of two types: Default method of using AWS owned CMK; KMS method using AWS managed key.