fromWhizlabs Flashcards
Best services to implement serverless applications
- API Gateway
- Lambda
What is the best option to encrypt global secondary indexes at minimum cost?
DynamoDB uses the CMK to generate and encrypt a unique data key for the table, known as Table Key. AWS owned are free while AWS managed are chargeable.
What is the best option to monitor the incoming API connections to an elastic load balancer?
Use AWS Cloudtrail with your ELB. It captures all API calls fot the ELB as events.
Correct format for stage variables to an HTTP url
Always:
${stageVariables.}
as
a full uri, a full domain, a subdomain, a path, a querystring
Which options are required to have Cognito Events push to Kinesis Streams?
You can use an existent or new Kinesis Stream and create an IAM Role which grants permissions to Cognito to publish to the stream
How can you improve the performance of an application designed to make scans against a DynamoDB?
- Use parallel scans (if you cannot avoid them)
- Design to use queries
What is the best option If you want to move gradually from a version of APIs served by API gateway to newer versions?
Create another Stage in the API Gateway. An API stage is a logical reference to a lifecycle state of your API (for example dev, prod, v2, beta) API stages are identified by API ID and stage name.
How Cognito evalues multiple rules for each role which gets assigned to users?
Rules are evaluated in sequential order & IAM role for first matching rule is used, unless a CustomRoleArn is specified to override the order
Which is required to deploy a Lambda function using serverless deployment?
- Place the function code at the root level of the working directory along with the yaml file
- Use the cloudformation package command to package the deployment.
Which is required to automate CodeDeploy to deploy an application requiring secure parameters stored in ssm?
Use aws ssm get-parameters with the –with-decryption option. This allows CodeDeploy to decrypt the password so it can be used in the application. Also use IAM roles to ensure the CodeDeploy service can access the KMS service.
How can be fixed if queries to a DynamoDB table are using attributes which are not the partition key?
Add a global secondary index to the table.
Change all the queries to use the partition key is not an ideal approach, because involves changing the code
Global tables won’t work either because they are used o disaster recovery scenarios.
How can you ensure that traffic is shifted slowly from one lambda function to another?
You can create or update an ALIAS with the –routing-config parameter.
To enable CORS on a resource using API Gateway, for GET method, which action is required for all types of response except 200 ?
You have to manually configure to return Access-Control-Allow-Origin header with ‘*’ or specific origins to fulfill pre-flight handshakes.
The OPTIONS method is added for 200 responses only
What can you use to save strings that exceed 400 kb on DynamoDB tables?
You can use S3. Exceeded items can be saved in buckets while an object identifier is saved in the table which points to an item in S3
For applications that requires high-performance reads, what can be used to have consistent data writes and and avoid unpredictable spikes in DynamoDB?
Use Write Through Cache using DAX. As a write-through cache, DAX allows you to issue writes directly, so they are immediately reflected in the item cache. Also manage cache invalidations for you.
How can you encrypt at rest a DynamoDB Table?
DynamoDB encryption is mandatory at the time of table creation itself and it is two types:
- Default method: AWS owned CMK
- AWS managed CMK
What is the best option to diagnose performance between a backend that calls to a database?
Use the X-Ray service. It can be used to see the call trace and time spend on each layer.
If you need to configure common values on different nodes across a redis cluster using elasticache service, which component you would use?
Using Parameters groups, which ensures all the nodes in the cluster are configured in the same way.