Questions from Exam Pro & Topics Flashcards
How to Prevent Uploads of Unencrypted Objects to Amazon S3
prevents users from uploading unencrypted objects, unless they are using server-side encryption with S3–managed encryption keys (SSE-S3) or server-side encryption with AWS KMS–managed keys (SSE-KMS).
x-amz-server-side-encryption
The release process workflow of an application requires a manual approval before the code is deployed, what can you set up?
Use an approval action in a stage
Amazon API Gateway now supports importing ___ ___ ___. This allows you to easily create and deploy new APIs as well as update existing APIs in Amazon API Gateway.
Swagger API definitions
penapi: 3.0.0 info: -title: Sample API -description: -version: 0.1.9 servers: - url: http://api.example.com/v1 description: x - url: http://staging-api.example.com description: x paths: /users: get: summary: x. description: y responses: '200': # status code description: x: application/json: schema:
AWS Serverless Application Model (AWS SAM) Supports Inline ___
- Swagger
- Use intrinsic functions to specify URIs - CodeUri and DefinitionUri now accept Amazon S3 objects with a Bucket, Key and Version. This means you can now use intrinsic functions to dynamically specify your code or Swagger file’s location.
What does the client have to do to invalidate the cache in API Gateway?
The client must send a request that contains the Cache-Control: max-age=0 header.
The client receives the response directly from the integration endpoint instead of the cache, provided that the client is authorized to do so. This replaces the existing cache entry with the new response, which is fetched from the integration endpoint.
What S3 bucket policy should I use to comply with the AWS Config SSL requests only?
By default, Amazon S3 allows both HTTP and HTTPS requests. To comply with the s3-bucket-ssl-requests-only rule, confirm that your bucket policies explicitly deny access to HTTP requests. Bucket policies that allow HTTPS requests without explicitly denying HTTP requests might not comply with the rule.
To determine HTTP or HTTPS requests in a bucket policy, use a condition that checks for the key “aws:SecureTransport”. When this key is true, this means that the request is sent through HTTPS. To be sure to comply with the s3-bucket-ssl-requests-only rule, create a bucket policy that explicitly denies access when the request meets the condition “aws:SecureTransport”: “false”. This policy explicitly denies access to HTTP requests.
If you have 4 ECS services and each one needs to have specific permissions, what do you have to do?
Create four distinct IAM roles, each containing the required permissions for the associated ECS service, then configure each ECS task definition to reference the associated IAM role.
What code changes do I need to make to my application to use X-Ray?
For applications running on other AWS services, such as EC2 or ECS, you will need to install the X-Ray agent and instrument your application code.
Developer must minimize the time between the message arrival in the queue and the dashboard update
OK: Retrieve the messages from the queue using long polling every 20 seconds.
NOK: Retrieve the messages from the queue using short polling every 10 seconds. (This doesn’t exist)
The maximum long polling wait time is 20 seconds.
A social media company is using Amazon Cognito in order to synchronize profiles across different mobile devices, to enable end users to have a seamless experience.
Which of the following configurations can be used to silently notify users whenever an update is available on all other devices?
Amazon Cognito Sync is an AWS service and client library that enables cross-device syncing of application-related user data. You can use it to synchronize user profile data across mobile devices and the web without requiring your own backend. The client libraries cache data locally so your app can read and write data regardless of device connectivity status. When the device is online, you can synchronize data, and if you set up push sync, notify other devices immediately that an update is available.
What are the top caching strategies?
Cache Aside (If data exists in the cache, read from it, else read from the db but the db will write that data in the cache after that)
Read Through (It gets only data from the cache, if it doesn’t exist, the db will write in the cache but the app continues reading from the cache)
An application runs on multiple EC2 instances behind an ELB.
Where is the session data best written so that it can be served reliably across multiple requests?
Write data to Amazon ElastiCache
A Developer has developed a web application and wants to deploy it quickly on a Tomcat server on AWS. The Developer wants to avoid having to manage the underlying infrastructure.
What is the easiest way to deploy the application, based on these requirements?
AWS Elastic Beanstalk
To log in to an Amazon ECR registry
This command retrieves an authentication token using the GetAuthorizationToken API, and then it prints a docker login command with the authorization token and, if you specified a registry ID, the URI for an Amazon ECR registry. You can execute the printed command to authenticate to the registry with Docker. After you have authenticated to an Amazon ECR registry with this command, you can use the Docker CLI to push and pull images to and from that registry as long as your IAM principal has access to do so until the token expires. The authorization token is valid for 12 hours.
aws ecr get-login
The upload of a 15 GB object to Amazon S3 fails. The error message reads: “Your proposed upload exceeds the maximum allowed object size.”
What technique will allow the Developer to upload this object?
The multipart upload API is designed to improve the upload experience for larger objects. You can upload an object in parts. These object parts can be uploaded independently, in any order, and in parallel. You can use a multipart upload for objects from 5 MB to 5 TB in size. For more information, see Uploading and copying objects using multipart upload.
Where can PortMapping be defined when launching containers in Amazon ECS?
Task definition
Typically, when you use the KCL, you should ensure that…
the number of instances does not exceed the number of shards (except for failure standby purposes). Each shard is processed by exactly one KCL worker and has exactly one corresponding record processor, so you never need multiple instances to process one shard. However, one worker can process any number of shards, so it’s fine if the number of shards exceeds the number of instances.
KCL, Kinesis, consumers
To scale up processing in your application, you should test a combination of these approaches:
- Increasing the instance size (because all record processors run in parallel within a process)
- Increasing the number of instances up to the maximum number of open shards (because shards can be processed independently)
- Increasing the number of shards (which increases the level of parallelism)
What does an Amazon SQS delay queue accomplish?
Delay queues let you postpone the delivery of new messages to a queue for a number of seconds, for example, when your consumer application needs additional time to process messages. If you create a delay queue, any messages that you send to the queue remain invisible to consumers for the duration of the delay period. The default (minimum) delay for a queue is 0 seconds. The maximum is 15 minutes. For information about configuring delay queues using the console see Configuring queue parameters (console).
A Developer is writing a serverless application that requires that an AWS Lambda function be invoked every 10 minutes.
What is an automated and serverless way to trigger the function?
Create an Amazon CloudWatch Events rule that triggers on a regular schedule to invoke the Lambda function.
What is deployment package?
Your AWS Lambda function’s code consists of scripts or compiled programs and their dependencies. You use a deployment package to deploy your function code to Lambda. Lambda supports two types of deployment packages: container images and .zip files.
Lambda supports two types of deployment packages:
container images
.zip files
In CloudFormation you can create lambda functions and yo can set the code via three ways
- Code inline (Python and JS)
- .Zip Archive (IN S3, S3Key, S3ObjectVersion)
- Container image (IN ECR)
What can you do if you want to run the X-Ray daemon on Amazon ECS?
In Amazon ECS, create a Docker image that runs the X-Ray daemon, upload it to a Docker image repository, and then deploy it to your Amazon ECS cluster and Ensure port mappings and network settings are correct and IAM task roles are defined.
Extra: On ECS you don’t have control of your EC2 then you can’t install de daemon