Developer Associate Flashcards
What additional logging can be enabled in S3?
Object level logging to CloudTrail
Server access logging - log files delivered to another bucket
Storage, Request and Data Transfer metrics in CloudWatch. Storage is free.
What is an ACL in S3?
Access Control List.
Is per object.
Can grant access to object, including public and cross-account access
Different permission to put an object’s ACL - can’t just do it with s3:PutObject
What happens if you attempt to put a public object in an S3 bucket where public access settings do not allow public objects?
Forbidden error
When are headers required when uploading an object that requires encrypting to S3?
Describe the headers used when uploading an object to S3 that is to be encrypted
Use headers if you’re not using default encryption - if you are you don’t need the headers.
You can enforce encryption without using default encryption by using a bucket policy that rejects requests that don’t have the headers. The headers are like this:
x-amz-server-side-encryption: AES256
x-amz-server-side-encryption: ams:kms
What CORS configurations are available for S3?
AllowedOrigin
AllowedMethod (e.g. GET)
MaxAgeSeconds (how long browser should cache preflight request)
AllowedHeader (e.g. x-amz-*)
How can you optimise GETTING objects from S3 when you have a lot of requests?
Use CloudFront
How can you optimise PUTTING objects into S3 when you have a lot of requests?
Random prefixes to distribute across partitions
but - not really necessary now there’s higher limits
What are the S3 limits for GET and PUT?
GET - 5,500
PUT - 3,500
What are the two types of ARN for lambda functions?
Unqualified - without version
Fully qualified - with version, e.g. 1 or $LATEST
Are lambda functions immutable?
Yes - once published they cannot be changed. Publishing a new version results in a new version number
How can lambda traffic be split using aliases?
Using a percentage between a maximum of 2 aliases.
$LATEST cannot be used, it must be a specific version
Do step functions support branching and parallel steps?
Yes. Can also define retry behaviour
How is a state machine described in step functions?
Amazon State Language (JSON)
What are the components of X-Ray?
X-ray API - hosted by amazon
X-ray daemon - can run on a server, sends data to the API
X-ray SDK and CLI - sends data to daemon and/or API (other AWS tools might do this too)
What tools does the X-Ray SDK provide?
SDK provides ways to hook in X-ray:
Interceptors to trace incoming HTTP requests
Client handlers to track calls via AWS SDK
HTTP client
Which services are automatically integrated with X-ray?
Lambda
API gateway
EC2
ELB
Elastic beanstalk
Describe the default throttling limits for API Gateway
10,000 requests per second across all APIs in account
5,000 concurrent requests at once across all APIs in account
Exceeding these will result in “429 too many requests” responses
E.g. 10,000 requests in one millisecond - only 5,000 served. 10,000 spread evenly over 1 second - all served.
5,000 in 1 millisecond and 5,000 spread over the other 999 milliseconds - all requests served
Limits can be adjusted for a cost
What support does API Gateway offer for SOAP?
SOAP web service passthrough can be used with API for legacy stuff
What does SOAP stand for?
Simple Object Access Protocol
What is a KMS CMK?
Customer Master Key
Used for encrypting data up to 4KB
Typically used to encrypt data keys that are managed outside of KMS
Describe how key material can be created for KMS CMKs
KMS can generate it for you
Import your own by downloading a public key, encrypting and then uploading
Can you export KMS keys?
No - could need to use Cloud-HSM to do this
What do KMS key policies do?
Allow you to set permissions for who can use and edit the key. It’s possible to completely lock yourself out - would need to contact AWS Support to get back in
Are KMS keys regional?
Yes
Can you delete KMS keys?
Deletion can be scheduled, but you have to wait a minimum period of 7 days
Describe some common CLI calls for KMS
aws kms encrypt
aws kms decrypt
aws kms re-encrypt (allows you to decrypt existing ciphertext and target a new key to re-encrypt - all happens server-side so no secrets exposed - value passed in must be from previous encrypt or generatedatakey call)
aws kms enable-key-rotation (results in a new key each year)
What is Web Identity Federation?
Allows access to AWS resources after authenticating with a web-based identity provider (e.g. Facebook or Google)
User trades authentication code from provider which is traded for short-term AWS credentials
This can be handled through Amazon Cognito (an identity broker) - e.g. a mobile app needs to access S3, the app can sign in user via Facebook and cognito, get AWS creds, and then access S3 directly.
No need to embed credentials
Describe Cognito identity and user pools
User pools - provides JWTs on successful authentication. Can use with web-based identity providers
Identity pools - provide short-lived AWS credentials to identities. It integrates with an identity provider, which can be cognito user pools
Describe Cognito push synchronisation
Push synchronisation - uses SNS to send a silent push notification to sync user data across all devices they are associated with
What is STS assume-role-with-web-identity?
Provides temp credentials for user authenticated with web identity provider (e.g. Facebook of Cognito user pools)
Cognito identity pools uses this under the covers
Response from this call will give you an arn and id for the “role” - but this isn’t an IAM role - just a way to programmatically refer to this temporary set of credentials
Response also contains actual credentials (key and secret) to use
The provider would have to be configured in IAM first to get credentials!
What does each Kinesis shard provide in terms of capacity?
READ: 5 transactions per second, up to 2mb per second
WRITE: 1,000 transactions per second, up to 1mb per second (including partition key)
How does Kinesis decide which partition data goes in?
Kinesis uses partition key to decide which shard data should go in. Apps must define a partition key when putting data into a stream
How does lambda/kinesis integration work?
In terms of lambda integration, lambda polls kinesis and processes per shard (so blocking is per shard if there’s an error). This is configured with event source mapping, along with SQS and DynamoDB. Lambda is invoked synchronously in these cases
What does the elastic beanstalk managed platform updates feature do?
Apply OS patches and runtime environment patches (e.g. Java)
Can a single elastic beanstalk app have multiple environments?
Yes
What are the 4 deployment policies available in elastic beanstalk?
All at once - new version deployed to all instances at same time - instances out of service while this is happening - rollback involves deploying previous code
Rolling - deploy to batch of instances at a time
Rolling with additional bath - extra batch to compensate for out of service batch that is being updated
Immutable - new instances started in new ASG, and once health checks passed the instances are moved to initial ASG