# findout who am I?
aws sts get-caller-identity
# also findout out who am I with more details
aws iam get-user
# get secret
aws secretsmanager get-secret-value --secret-id foo
# change secret
aws secretsmanager update-secret \
--secret-id foo \
--secret-string "{\"json\":\"string\",\"foo\":\"bar\"}"
Serverless means
P.S. similar to use a third party service/APIs
GetItem
, consider if ConsistentRead
needs to be setP.S. NoSQL seems less flexible on change of access pattern compared to SQL DBs
Three under the hood presentations in series
IAM is authentication + authorisation for resources
Feature: Add users to AWS account, set groups and permissions for these users, enable user to call AWS services APIs
IAM Principal: An identity in the IAM System
IAM Roles: IAM Principals that authenticate with temporary credentials
Use Cases For IAM Roles
IAM Users (less used): IAM Principle with long term credentials
STS: AWS Security Token Service: produce short term credentials for use by an IAM Role
AWS Accounts:
IAM Policy
There are two types of policies, one for principal, one for resources.
Example: Reading an object from an S3 bucket in another account.
Principal IAM policy for AWS Account 123456
{
"Effect": "Allow",
"Action": "S3: GetObject",
"Resource": "arn:aws:s3:::example-bucket/*"
}
Resource-based IAM policy
{
"Effect": "Allow",
"Principal": {
"AWS": "123456"
}
"Action": "S3: GetObject",
"Resource": "arn:aws:s3:::example-bucket/*"
}
Integration between Lambda and AWS IAM enables developers and administrators to explicit control the data and service accessible to an application by assigning it a security code. This approach ensures that credentials can be constrainted to the minimum necessary and that they posses limited lifespans.
cognito
login
worksMicrosoft Active Directory Federation Services
Single Sign
On (SSO), under the hood, the React FE uses aws Cognito Login UI in
AppAuth.jsx
cognito
knows that this
is user logged in and cognito
gives JWT Tokens to FE in
reactapp/src/App.jsx
reactapp/src/apollo.js
access_token_authentication.py
See also