Dev with AWS Flashcards

1
Q

What is a Gateway Load Balancer

A

A Gateway Load Balancer helps you to deploy, scale, and manage your third-party appliances, such as firewalls, intrusion detection and prevention systems, and deep packet inspection systems. It provides a gateway for distributing traffic across multiple virtual appliances while scaling them up and down based on demand.

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

What are the three components of Amazon EC2 Auto Scaling?

A

One component is a launch template or a launch configuration you can use as a configuration template for the EC2 instances. Another component is an Amazon EC2 Auto Scaling group you can use to specify your minimum, maximum, and desired capacity of your instances. The third component refers to scaling policies you can use to configure a group to scale based on the occurrence of specified conditions or on a schedule.

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

Users in a company are authenticated in the corporate network, and they want to use AWS services without signing in again. Which AWS authentication option should the company use?

A

Instead of creating an IAM user for each employee that needs access to an AWS account, you should use IAM roles to federate users.

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

What are the main components that make up Elastic Load Balancing (ELB)?

A

The ELB service is made up of these main components: rules, listeners, and target groups. Listeners will contain rules, which are used by the listeners to route requests to the target groups.

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

What is Transfer Acceleration?

A

it will significantly reduce the upload time to S3. Take note that the name of the bucket used for Transfer Acceleration must be DNS-compliant and must not contain periods (“.”).

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

When to use IAM Policy for S3?

A

You need to control access to AWS services other than S3. IAM policies will be easier to manage since you can centrally manage all of your permissions in IAM, instead of spreading them between IAM and S3.

You have numerous S3 buckets each with different permissions requirements. IAM policies will be easier to manage since you don’t have to define a large number of S3 bucket policies and can instead rely on fewer, more detailed IAM policies.

You prefer to keep access control policies in the IAM environment.

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

When to use a S3 Bucket Policy?

A

You want a simple way to grant cross-account access to your S3 environment, without using IAM roles.

Your IAM policies bump up against the size limit (up to 2 kb for users, 5 kb for groups, and 10 kb for roles). S3 supports bucket policies of up 20 kb.

You prefer to keep access control policies in the S3 environment.

You want to apply common security controls to all principals who interact with S3 buckets, such as restricting the IP addresses or VPC a bucket can be accessed from.

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

Is the “Principal” needed in a IAM Policy for S3?

A

No. The S3 bucket policy includes a “Principal” element, which lists the principals that bucket policy controls access for. The “Principal” element is unnecessary in an IAM policy, because the principal is by default the entity that the IAM policy is attached to.

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

What are the 3 types of server side encryption (SSE) that S3 allows?

A

SSE-S3 - S3 Managed Keys, SSE-KMS - AWS KMS, and SSE-C - customer provided keys.

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

DAX vs. ElaticCache?

A

DAX is for DynamoDB only. Simple to implement. ElastiCache can be used for DynamoDB or Relational DBs. You have to reconfigure the app to use it.

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

What are the 3 request headers for SSE-C?

A

x-amz-server-side-encryption-customer-algorithm - This header specifies the encryption algorithm. The header value must be “AES256”.

x-amz-server-side-encryption-customer-key - This header provides the 256-bit, base64-encoded encryption key for Amazon S3 to use to encrypt or decrypt your data.

x-amz-server-side-encryption-customer-key-MD5 - This header provides the base64-encoded 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

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

What is AssumeRoleWithWebIdentity?

A

Returns a set of temporary security TheAssumeRoleWithWebIdentityAPI operation returns a set of temporary security credentials for federated users who are authenticated through a public identity provider. Examples of public identity providers include Login with Amazon, Facebook, Google, or any OpenID Connect (OIDC)-compatible identity provider. This operation is useful for creating mobile applications or client-based web applications that require access to AWS. Using this operation means that your users do not need their own AWS or IAM identities.

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

What is Athena?

A

interactive query service to analyze and query data located in S3 using SQL.
serverless - pay per query / TB scanned
ETL processes not needed
commonly used to query log data in S3

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

What is Macie?

A

security service which uses ML and NLP to discover, classify and protect sensitive data stored in S3.
uses AI to identify PII, suspicious API activity, preventing ID theft in PCI-DSS

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

What AWS Service is ideal for data lakes?

A

S3

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

Why would you get inconsistent results from a deleted object in S3?

A

because S3 has eventual consistency for overwrite PUTS and DELETES

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

What is S3 Object Lambda?

A

allows you to add your own code to S3 GET requests to modify and process data as it’s being returned to an application. This feature is designed for use cases where data needs to be transformed on-the-fly without the need to store a transformed copy of the data. It’s useful in scenarios like filtering rows, redacting confidential data, dynamically resizing images and other similar situations where data transformation or processing is required during data retrieval.

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

Which storage has lower latency, block or object?

A

Block because you only have to update part of the storage while object storage you would have to replace the whole object.

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

What is EFS?

A

Elastic File System - is a set-and-forget file system that automatically grows and shrinks as you add and remove files. There is no need for provisioning or managing storage capacity and performance. Amazon EFS can be used with AWS compute services and on-premises resources. You can connect tens, hundreds, and even thousands of compute instances to an Amazon EFS file system at the same time, and Amazon EFS can provide consistent performance to each compute instance. offers four storage classes, where you pay for only the storage you use based on the storage class.

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

What is Amazon FSx?

A

Amazon FSx is a fully managed service that offers reliability, security, scalability, and a broad set of capabilities that make it convenient and cost effective to launch, run, and scale high-performance file systems in the cloud. With Amazon FSx, you can choose between four widely used file systems: Lustre, NetApp ONTAP, OpenZFS, and Windows File Server. You can choose based on your familiarity with a file system or based on your workload requirements for feature sets, performance profiles, and data management capabilities.

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

SNS vs. EventBridge?

A

Use SNS when:

Supports a handful of different targets, including SQS and Lambda.
You can’t filter messages by their content. You can only filter by messages attributes and are limited to just 10 attributes per message.
You want to publish messages to MANY different subscribers with a single action
Require high throughput and reliability for publishing and delivery to consumers
Have many subscribers

Use Eventbridge when:

Supports a total of 20 target types at the time of writing! The list includes the likes of SNS, SQS, Kinesis, ECS, Lambda as well as EventBridge on another AWS account.
Gives you a way to pattern match against the event content.
Can discover and keep a schema registry. Can transform the event before passing it on.
You want to publish messages to many subscribers, and use the event data itself to match targets interested certain patterns.
Want integration with other SaaS providers such as Shopify, Datadog, Pagerduty, or others
Want to easily discover schemas that other teams produce and incorporate them into your application.
You want to use regularly scheduled events using a cron-like expression to periodically send messages to your event bus.
You want to create one-time events that fire at a specific time.

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

What is CodeArtifact?

A

AWS CodeArtifact is a secure, highly scalable, managed artifact repository service that helps organizations to store and share software packages for application development. You can use CodeArtifact with popular build tools and package managers such as the NuGet CLI, Maven, Gradle, npm, yarn, pip, and twine.

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

What is Inspector?

A

an automated security assessment service that helps improve the security and compliance of applications deployed on AWS. It doesn’t have the ability to capture IP traffic of your VPC.

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

What is Trusted Advisor?

A

provides recommendations that help you follow AWS best practices. Trusted Advisor evaluates your account by using checks. These checks identify ways to optimize your AWS infrastructure, improve security and performance, reduce costs, and monitor service quotas.

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

MemoryDB for Redis vs. ElastiCache for Redis?

A

Amazon ElastiCache for Redis, a fully managed in-memory caching service, as a low latency cache in front of a durable database service such asAmazon AuroraorAmazon DynamoDBto minimize data loss. However, this setup requires you to introduce custom code in your applications to keep the cache in sync with the database. You’ll also incur costs for running both a cache and a database.

Amazon MemoryDB for Redis, a new Redis-compatible, durable, in-memory database. MemoryDB makes it easy and cost-effective to build applications that requiremicrosecond readandsingle-digit millisecond writeperformance withdata durabilityandhigh availability.
Instead of using a low-latency cache in front of a durable database, you can now simplify your architecture and use MemoryDB as a single,primary database. With MemoryDB, all your data is stored in memory, enabling low latency and high throughput data access.

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

What is Elastic Beanstalk worker environment?

A

managing the Amazon SQS queue and running a daemon process on each instance that reads from the queue for you. When the daemon pulls an item from the queue, it sends an HTTP POST request locally to http://localhost/ on port 80 with the contents of the queue message in the body. All that your application needs to do is perform the long-running task in response to the POST. You can configure the daemon to post to a different path, use a MIME type other than application/JSON, connect to an existing queue, or customize connections (maximum concurrent requests), timeouts, and retries.

Also can define periodic tasks that add jobs to your worker env’s queue automatically at a regular interval.

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

What are the two tiers in Elastic Beanstalk?

A

Web Server Environment and Worker Environment.

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

What is anelastic network interface?

A

a logical networking component in a VPC that represents a virtual network card. (Includes ip addresses and security groups) A single EC2 instance can now be attached to two ENIs, each one on a distinct subnet. The ENI (not the instance) is now associated with a subnet.

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

What is Envelope Encryption?

A

encrypt plaintext data with a data key and then encrypt the data key with a top-level plaintext master key. Because the master key is stored in KMS, it’s safe and can be used in many envelope encrypted sets of data.

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

What is GenerateDataKeyWithoutPlaintext ?

A

it’s identical to the GenerateDataKey operation except that it does not return a plaintext copy of the data key.

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

What is GenerateDataKey?

A

Returns a unique symmetric data key for use outside of KMS. This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify.

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

What are the Lambda invocation types? Which is default?

A

By default, Lambda invokes your function synchronously (i.e. theInvocationType is RequestResponse). To invoke a function asynchronously, set InvocationType to Event.

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

What is Lambda Traffic shifting?

A

create different versions of your function and then allow it to shift traffic between two versions, based on weights (%) that you assign to it. Create an alias and it gives options to do this.

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

What is Step Functions?

A

a fully managed service that you can use to coordinate the components of distributed applications and microservices using VISUAL WORKFLOWS. You build small applications that each perform a discrete function (or step) in your workflow, which means that you can scale and change your applications quickly. Think of it as first this function runs, which invokes another function, which invokes two more functions to complete a series of stepsin your workflow.

Step Functions is based on state machines and tasks. A state machine is a workflow. A task is a state in a workflow that represents a single unit of work performed by another AWS service. Each step in a workflow is a state.

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

What are the two types of State Machine Workflows?

A

When you create a state machine, you can select either a Standard (default) or Express Workflow. In both cases, you define your state machine using the Amazon States Language (JSON based). Your state machine workflow runs will behave differently depending on which option you select. You cannot change the workflow type after you have created your state machine.

Standard Workflows are ideal for long-running, durable, and auditable workflows.

Express Workflows are ideal for high-volume, event-processing workloads such as IoT data ingestion, streaming data processing and transformation, and mobile application backends. There are two types of Express Workflows, asynchronous and synchronous.

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

What is Simple Workflow SWF?

A

A web service that makes it easy to coordinate work across distributed application components.
In Amazon SWF, tasks represent invocations of logical steps in applications. Tasks are processed by workers which are programs that interact with Amazon SWF to get tasks, process them, and return their results.
The coordination of tasks involves managing execution dependencies, scheduling, and concurrency in accordance with the logical flow of the application.

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

Why use Web Identity Federation?

A

build your app so that it requests temporary AWS security credentials dynamically when needed using web identity federation. The supplied temporary credentials map to an AWS role that has only the permissions needed to perform the tasks required by the mobile app.

you don’t need to create custom sign-in code or manage your own user identities. Instead, users of your app can sign in using a well-known external identity provider (IdP), such as Login with Amazon, Facebook, Google, or any other OpenID Connect (OIDC)-compatible IdP.

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

How would you use Web Identify Federation without Cognito?

A

then you must write code that interacts with a web IdP, such as Facebook, and then calls the AssumeRoleWithWebIdentity API to trade the authentication token you get from those IdPs for AWS temporary security credentials.

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

Can Lambda functions work with EFS?

A

You can configure functions to mount a file system during initialization with the NFS protocol over the local network within a VPC. Lambda manages the connection and encrypts all traffic to and from the file system.

The file system and the Lambda function must be in the same region. A Lambda function in one account can mount a file system in a different account. For this scenario, you configure VPC peering between the function VPC and the file system VPC.

40
Q

What header should you have if require server side encryption in your S3 bucket policy?

A

x-amz-server-side-encryption

41
Q

What header should you have if require a KMS key for encryption in your S3 bucket policy?

A

x-amz-server-side-encryption-aws-kms-key-id header which specifies the id of the KMS master encryption key. If the header is not present in the request, Amazon S3 assumes the default KMS key. Regardless, the KMS key ID that Amazon S3 uses for object encryption must match the KMS key ID in the policy, otherwise Amazon S3 denies the request.

To upload an object to the S3 bucket, which uses SSE-KMS, you have to send a request with an x-amz-server-side-encryption header with the value of aws:kms

42
Q

Compare SSE-S3 and SSE-KMS.

A

SSE-S3 is an encryption key that S3 creates, manages and uses for the customer. SSE-KMS is an encryption key that AWS protects for the customer.

43
Q

What is the difference between Cognito and Identity Center (formerly SSO)?

A

an Identity Broker which handles interaction between your applications and the Web ID provider (you don’t need to write your own code to do this)

Amazon Cognito is a service that helps you manage identities for your CUSTOMER facing applications; it is not a supported identity source in IAM Identity Center. Amazon Cognito is our identity management solution for developers building B2C or B2B apps for their customers, which makes it a customer-targeted IAM and user directory solution.

Identity Center (SSO) is focused on SSO for employees accessing AWS and BUSINESS apps, initially with Microsoft Active Directory as the underlying employee directory. You can create and manage your workforce identities in IAM Identity Center or in your external identity source including Microsoft Active Directory, Okta Universal Directory, Azure Active Directory (Azure AD), or another supported IdP. USES SAML

44
Q

Optimistic locking vs. Pessimistic Locking?

A

Optimistic locking depends on checking a value upon save to ensure that it has not changed. Pessimistic locking prevents a value from changing by locking the item or row in the database. DynamoDB does not support item locking, and conditional writes are perfect for implementing optimistic concurrency.

45
Q

What are two types of Lambda authorizers:

A

A token-based Lambda authorizer (also called a TOKEN authorizer) receives the caller’s identity in a bearer token, such as a JSON Web Token (JWT) or an OAuth token.

A request parameter-based Lambda authorizer (also called a REQUEST authorizer) receives the caller’s identity in a combination of headers, query string parameters, stageVariables, and $context variables.

For WebSocket APIs, only request parameter-based authorizers are supported.

46
Q

Why use IAM identity provider (IdP)?

A

When you use an IAM identity provider, you don’t have to create custom sign-in code or manage your own user identities. The IdP provides that for you. Your external users sign in through a well-known IdP, such as Login with Amazon, Facebook, or Google. You can give those external identities permissions to use AWS resources in your account. IAM identity providers help keep your AWS account secure because you don’t have to distribute or embed long-term security credentials, such as access keys, in your application.

To use an IdP, you create an IAM identity provider entity to establish a trust relationship between your AWS account and the IdP.

IAM supports IdPs that are compatible with OpenID Connect (OIDC)
OR
SAML 2.0 (Security Assertion Markup Language 2.0).

47
Q

What are Service control policies (SCPs)?

A

are a type of organization policy that you can use to manage permissions in your organization. SCPs offer central control over the maximum available permissions for all accounts in your organization. SCPs help you to ensure your accounts stay within your organization’s access control guidelines. SCPs are available only in an organization that has all features enabled. SCPs aren’t available if your organization has enabled only the consolidated billing features.

48
Q

What is a StackSet?

A

AWS CloudFormation StackSets extends the capability of stacks by enabling you to create, update, or delete stacks across multiple accounts and AWS Regions with a single operation. Using an administrator account, you define and manage an AWS CloudFormation template, and use the template as the basis for provisioning stacks into selected target accounts across specified AWS Regions.

49
Q

What is SSE-C?

A

Customer provided encryption keys.

50
Q

What are the 3 request headers for SSE-C?

A

x-amz-server-side-encryption-customer-algorithm - This header specifies the encryption algorithm. The header value must be “AES256”.

x-amz-server-side-encryption-customer-key - This header provides the 256-bit, base64-encoded encryption key for Amazon S3 to use to encrypt or decrypt your data.

x-amz-server-side-encryption-customer-key-MD5 - This header provides the base64-encoded 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

51
Q

What to consider with route tables and subnets?

A

A route table contains a set of rules, called routes, that are used to determine where network traffic is directed.

Each subnet in your VPC must be associated with a route table; the table controls the routing for the subnet. A subnet can only be associated with one route table at a time, but you can associate multiple subnets with the same route table.

52
Q

What is wrong with an inline policy for an application on an EC2 instance to upload data to S3?

A

This option doesn’t provide a secure way of allowing the application that is hosted in EC2 to upload data to an S3 bucket. You should use an IAM Role instead.

53
Q

What is a Kinesis Adapter?

A

The Kinesis Adapter is the recommended way to consume streams from DynamoDB for real-time processing. The DynamoDB Streams API is intentionally similar to that of Kinesis Streams, a service for real-time processing of streaming data at a massive scale. You can write applications for Kinesis Streams using the Kinesis Client Library (KCL). The KCL simplifies coding by providing useful abstractions above the low-level Kinesis Streams API. As a DynamoDB Streams user, you can leverage the design patterns found within the KCL to process DynamoDB Streams shards and stream records. To do this, you use the DynamoDB Streams Kinesis Adapter. The Kinesis Adapter implements the Kinesis Streams interface, so that the KCL can be used for consuming and processing records from DynamoDB Streams.

54
Q

A developer uses the AWS SDK for C++ to retrieve data from an Amazon DynamoDB table. The data is sometimes retrieved using a known key, and sometimes the key is not known, resulting in multiple items being returned. The developer wants to ensure the code returns only one item when retrieving data without keys.

Which DynamoDB setting will meet these requirements?

A

Set the limit parameter to 1 to set the maximum number of items that need to be retrieved with a DynamoDB scan operation.

55
Q

The company plans to use the URI path pattern to access the desired environment instead of the port number. The company has created the Lambda functions for the application backend. Each Lambda function has three aliases (production, testing, and development).

Which option includes the next steps the company must take to complete the process?

A

Create an API Gateway API and configure the routes to use Lambda proxy integration. Target the corresponding Lambda function Amazon Resource Name (ARN) that is concatenated with the expression ${stageVariables.LambdaAlias}.
Modify the Lambda resource-based policy by adding the permission lambda:InvokeFunction.
Create production, testing, and development stages. Add the LambdaAlias stage variable to the corresponding stage.

To add “stageVariable” to the Lambda ARN, you should use the following format: ${stageVariable.stageVariableName}.

56
Q

How can a Lambda function reuse a db connectin?

A

The Lambda environment can reuse the same database connection for subsequent invocations when defining the database connection details in the code but outside the handler method.

57
Q

If you get a question about performance of a relational DB, which would you choose, Electicache or DAX?

A

Elaticache. DAX is only for DynamoDB. dummy.

58
Q

How to enable Lambda access to resources in a private VPC?

A

provide VPC config info to the function (private subnet ID, and security group ID)

59
Q

What services does X-Ray integrate with?

A

API Gateway, ELB, S3, Lambda, EB, SNS, and SQS.

60
Q

Cloudfront HTTP methods are grouped into 3 groups, what are they?

A

GET, HEAD:You can use CloudFront only to get objects from your origin or to get object headers.

GET, HEAD, OPTIONS:You can use CloudFront only to get objects from your origin, get object headers, or retrieve a list of the options that your origin server supports.

GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE:You can use CloudFront to get, add, update, and delete objects, and to get object headers. In addition, you can perform other POST operations such as submitting data from a web form.

61
Q

What is Origin protocol policy?

A

Requiring HTTPS for communication between CloudFront and your custom origin

HTTPS Only– CloudFront uses only HTTPS to communicate with your custom origin.

Match Viewer– CloudFront communicates with your custom origin using HTTP or HTTPS, depending on the protocol of the viewer request. For example, if you chooseMatch ViewerforOrigin Protocol Policyand the viewer uses HTTPS to request an object from CloudFront, CloudFront also uses HTTPS to forward the request to your origin.
ChooseMatch Vieweronly if you specifyRedirect HTTP to HTTPSorHTTPS OnlyforViewer Protocol Policy.
CloudFront caches the object only once even if viewers make requests using both HTTP and HTTPS protocols.

62
Q

What is Viewer protocol policy?

A

Choose the protocol policy that you want viewers to use to access your content in CloudFront edge locations:

HTTP and HTTPS: Viewers can use both protocols.

Redirect HTTP to HTTPS: Viewers can use both protocols, but HTTP requests are automatically redirected to HTTPS requests.

HTTPS Only: Viewers can only access your content if they’re using HTTPS.

63
Q

How do you create a certificate for CloudFront?

A

must be created in us-east-1

64
Q

What is Lambda@EdgeLambda?

A

Lambda@EdgeLambda, a compute service that lets you
execute functions that customize the content that CloudFront delivers.
You can author Node.js or Python functions in one Region, US East (N. Virginia), and then execute them in AWS locations globally that are closer to the viewer, without provisioning or managing servers.

65
Q

How do you give permissions to an application that runs on an EC2 instance?

A

Using roles to grant permissions to applications that run on EC2 instances requires a bit of extra configuration. An application running on an EC2 instance is abstracted from AWS by the virtualized operating system. Because of this extra separation, an additional step is needed to assign an AWS role and its associated permissions to an EC2 instance and make them available to its applications.

This extra step is the creation of an instance profile that is attached to the instance. The instance profile contains the role and can provide the role’s temporary credentials to an application that runs on the instance. Those temporary credentials can then be used in the application’s API calls to access resources and to limit access to only those resources that the role specifies. Note that only one role can be assigned to an EC2 instance at a time, and all applications on the instance share the same role and permissions.

66
Q

What is AssumeRoleWithSAML?

A

TheAssumeRoleWithSAMLAPI operation returns a set of temporary security credentials for federated users who are authenticated by your organization’s existing identity system. The users must also useSAML2.0 (Security Assertion Markup Language) to pass authentication and authorization information to AWS. This API operation is useful in organizations that have integrated their identity systems (such as Windows Active Directory or OpenLDAP) with software that can produce SAML assertions. Such an integration provides information about user identity and permissions (such as Active Directory Federation Services or Shibboleth).

67
Q

What are the 3 types of EC2 Tenancy?

A

Shared(default) – Multiple AWS accounts can share the same physical hardware.

Dedicated Instance (dedicated) – Your instance runs on single-tenant hardware. Dedicated Instances might share hardware with other instances from the same AWS account that are not Dedicated Instances. You have no visibility into the underlying hardware nor control of instance placement.

Dedicated Host (host) – Your instance runs on a physical server with EC2 instance capacity fully dedicated to your use. This is an isolated physical server with configurations that you can control a
Dedicated Host gives you additional visibility and control over how instances are placed on a physical server. And you have greater visibility into the hardware that the instance is running on.

68
Q

What are the two types of Lambda Authorizers?

A

A token-based Lambda authorizer (also called a TOKEN authorizer) receives the caller’s identity in a bearer token, such as a JSON Web Token (JWT) or an OAuth token.

A request parameter-based Lambda authorizer (also called a REQUEST authorizer) receives the caller’s identity in a combination of headers, query string parameters, stageVariables, and $context variables.

69
Q

If you want to setup a DLQ for a failing Lambda function, where would you implement it for SQS or SNS?

A

Add the ARN of the SQS or SNS in the Lambda function’s DeadLetterConfig parameter.

70
Q

If you need to feed real-time data into your gaming platform that handles sudden influx of gamers, which service would you be best?

A

Kinesis Data Stream - which ingests and stores data streams for processing.

71
Q

What is CloudFront Functions?

A

CloudFront Functions allows you to write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. This feature is designed for operations that can be processed with low latency at the edge locations of AWS, such as:
Cache key normalization, Header manipulation, Status code modification and body generation, URL redirects or rewrites, and Request authorization.

When you associate a CloudFront function with a CloudFront distribution, it allows CloudFront to intercept requests and responses at CloudFront edge locations.

CloudFront functions can only be invoked during two specific events: when CloudFront receives a request from a viewer (viewer request) and before CloudFront returns the response to the viewer (viewer response).

72
Q

An account alias substitutes for an account ID in the web address for your account. You can create and manage an account alias from the AWS Management Console, AWS CLI, or AWS API. Your sign-in page URL has the following format by default:

A

https://Your_AWS_Account_ID.signin.aws.amazon.com/console/

73
Q

If you create an AWS account alias for your AWS account ID, your sign-in page URL looks like the following example:

A

https://Your_Alias.signin.aws.amazon.com/console/

74
Q

100 active shards in a stream. Lambda takes 10 seconds to process the data and the stream is receiving 50 new items per second. How many concurrent Lambda function invocations?

A

100 (not 500)
the number of concurrent executions for poll-based event sources is different from push-based event sources. This number of concurrent executions would have been correct if the Lambda function is integrated with a push-based even source such as API Gateway or Amazon S3 Events. Remember that the Kinesis and Lambda integration is using a poll-based event source, which means that the number of shards is the unit of concurrency for the function.

75
Q
A
76
Q

DynamoDB write request with return of consumed?

A

To return the number of write capacity units consumed by any of these operations, set the ReturnConsumedCapacity parameter to one of the following:

TOTAL — returns the total number of write capacity units consumed.

INDEXES — returns the total number of write capacity units consumed, with subtotals for the table and any secondary indexes that were affected by the operation.

NONE — no write capacity details are returned. (This is the default.)

77
Q

3 examples of deployment types that CodeDeploy supports?

A

In-place deployments to on-premises servers.
B/G deployments to ECS.
B/G deployments to Lambda.

78
Q

What is a Global secondary index?

A

an index with a partition key and a sort key that can be different from those on the base table. A global secondary index is considered “global” because queries on the index can span all of the data in the base table, across all partitions.

You can add up to 20 global secondary indexes per table.

A global secondary index (GSI) is primarily used if you want to query over the entire table, across all partitions. GSI only supports eventual consistency and not strong consistency. You have to use a local secondary index instead.

79
Q

What is a Local secondary index?

A

an index that has the same partition key as the base table, but a different sort key. A local secondary index is “local” in the sense that every partition of a local secondary index is scoped to a base table partition that has the same partition key value.
For greater query or scan flexibility, you can create up to five local secondary indexes per table.

80
Q

In ECS, what is a Cluster Query Language?

A

ECS feature which provides you with expressions that you can use to group container instances by a specific attribute

81
Q

What languages does AWS Lambda support?

A

AWS Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions.

82
Q

What is API Gateway Integration Types?

A

AWS_PROXY: This type of integration lets an API method be integrated with the Lambda function invocation action with a flexible, versatile, and streamlined integration setup. This integration relies on direct interactions between the client and the integrated Lambda function.
With this type of integration, AKA LAMBDA PROXY INTEGRATION, you do not set the integration request or the integration response. API Gateway passes the incoming request from the client as the input to the backend Lambda function. The integrated Lambda function takes theinput of this formatand parses the input from all available sources, including request headers, URL path variables, query string parameters, and applicable body. The function returns the result following thisoutput format.
This is the PREFFERED integration type to call a Lambda function through API Gateway and is not applicable to any other AWS service actions, including Lambda actions other than the function-invoking action.

HTTP: This type of integration lets an API expose HTTP endpoints in the backend. With theHTTPintegration, also known as the HTTP custom integration, you must configure both the integration request and integration response. You must set up necessary data mappings from the method request to the integration request, and from the integration response to the method response.

HTTP_PROXY: The HTTP proxy integration allows a client to access the backend HTTP endpoints with a streamlined integration setup on single API method. You do not set the integration request or the integration response. API Gateway passes the incoming request from the client to the HTTP endpoint and passes the outgoing response from the HTTP endpoint to the client.

MOCK: This type of integration lets API Gateway return a response without sending the request further to the backend.

83
Q

dynamodb putitem vs updateitem?

A

TheupdateItem function is used to update an existing item’s attributes. Overall, developers can add, edit, or delete attributes from an existing item using the updateItem function.

The putItem function creates an entirely new item or replaces an existing item from a DynamoDB table. So, unlike the updateItem function, you can not use the putItem function to update existing items.

The behavior of the putItem function is determined by the primary key you provide. For example, if you provide an existing primary key, it will completely replace the old item.

84
Q

Why GraphQL and what is it?

A

GraphQL is a query and manipulation language for APIs. (used by AppSync) GraphQL provides a flexible and intuitive syntax to describe data requirements and interactions. It enables developers to ask for exactly what is needed and get back predictable results. It also makes it possible to access many sources in a single request, reducing the number of network calls and bandwidth requirements, therefore saving battery life and CPU cycles consumed by applications.

It’s meant to improve drawbacks of a REST API.
Single endpoints: GraphQL uses a single endpoint to query data. There’s no need to build multiple APIs to fit the shape of the data. This results in fewer requests going over the network.

Fetching: GraphQL solves the perennial issues of over- and under-fetching by simply defining the data you need. GraphQL lets you shape the data to fit your needs so you only receive what you asked for.

Abstraction: GraphQL APIs contain a few components and systems that describe the data using a language-agnostic standard. In other words, the shape and structure of the data are standardized so both the front- and backends know how it will be sent over the network. This allows developers on both ends to work with GraphQL’s systems and not around them.

Rapid iterations: Because of the standardization of data, changes on one end of development may not be required on the other. For example, frontend presentation changes may not result in extensive backend changes because GraphQL allows the data specification to be modified readily. You can simply define or modify the shape of the data to fit the needs of the application as it grows. This results in less potential development work.

85
Q

What is the max code package size of a Lambda function? (and container image?)

A

250 MB unzipped. and container, 10 GB.

86
Q

Lambda Quotas?

A

Function memory allocation

128 MB to 10,240 MB, in 1-MB increments.

Note: Lambda allocates CPU power in proportion to the amount of memory configured. You can increase or decrease the memory and CPU power allocated to your function using the Memory (MB) setting. At 1,769 MB, a function has the equivalent of one vCPU.

Deployment package (.zip file archive) size

50 MB (zipped, for direct upload)

250 MB (unzipped)

Container image code package size

10 GB (maximum uncompressed image size, including all layers)

/tmp directory storage

Between 512 MB and 10,240 MB, in 1-MB increments

87
Q

Which Amazon ElastiCache data store supports set sorting and ranking of cached datasets?

A

Redis

88
Q

A company has two AWS accounts. IAM users from Account A need to access resources in Account B.

A
  1. In Account B, create an IAM role with a trust policy for the Developers in Account A.
  2. Update the IAM role’s permission to access the resources in Account B
  3. In Account A, update the permission of the IAM users to assume the IAM role in Account B
89
Q

How can a Developer verify permission to call a CLI command without actually making a request?

A

Use the –dry-run parameter along with the CLI command.

90
Q

A Developer needs to deploy a CloudFormation template from a local computer.

A

Use the aws cloudformation package and aws cloudformation deploy command

91
Q

A Developer has created an IAM Role for an application that uploads files to an S3 bucket. Which API call should the Developer use to allow the application to make upload requests?

A

Use the AssumeRole API

92
Q

An application uses Amazon CloudFront to distribute a static website. The developer wants to redirect requests to specific URLs based on the user’s location.

A

Create a CloudFront URL that redirects requests based on the CloudFront-Viewer-Country header’s value.

Associate the CloudFront URL with the distribution’s Viewer Request event.
93
Q

An application uses a DynamoDB table with Global Secondary Index. DynamoDB requests are returning an ProvisionedThroughputExceededException error even though the table has sufficient capacity. Why is this happening?

A

The write capacity of the GSI is less than the base table.

94
Q

A serverless application is composed of AWS Lambda, DynamoDB, and API Gateway. Users are complaining about getting HTTP 504 errors.

A

The API requests are reaching the maximum integration timeout for API Gateway (29 seconds)

95
Q

How do you configure Memory/CPU with Lambda?

A

Lambda allocates CPU power in proportion to the amount of memory configured. By increasing the function memory, you will increase the CPU allocation.