Define: A Serverless Architecture trades control and customization for increased development speed and reduced maintenance The cloud provider runs the server and dynamically manages the allocation of machine resources
- We need to own our own hardware, racks, cooling, access
- We own the OS layer meaning we are responsible for keeping our patched and secure
- We are owning the data layer. log data etc
- We are owning the application layer. the runtime etc
- IaaS - no longer relying on on premises hardware. azure, aws, google etc (still responsible for patching OS,managing data and application layer)
- PaaS - no longer managing hardware and OS. (Still have to manage application and data layer)
- Functions as a service - Hardware, OS is managed for us in addition we have a potion of data and application managed for us
- SaaS - The platform itself manages the hardware, OS, Data and application layer (This is not for running out custom code)
- Compute - Logic apps, function apps, lambda
- Storage - storage accounts, S Buckets for static assets
- Persistence - Sql, no sql, dynamo db etc
- Eventing - (API Management and Azure Event Grid) (API Gateway and Kinesis Stream) - SQS
- Speed of innovation over depth of customization
- Deferred risk over extensive ownership
- Cost for actual use over cost for predicted use
- Scalability by default over scalability by design
- Managed service over customer infrastructure
- Reduction in long term maintenance
- Increased speed of innovation
- Reduction is required core competencies (increased focus)
- Risk and compliance mitigation
- Cost tied to usage
- Handles scaling
- New architectural approach and new skills required
- Decreased flexibility and control
- Limited in compliance approach if not supported on platform
- Requires a platform selection (potential for vendor lock-in)
- Public Cloud - implemented on a public cloud provider - AWS compute with Lambda - Azure with functions and logic apps - Google Cloud platform - GCP
- Cross platform - Solution that works on multiple platforms
- Open Source - Implemented on a private or hybrid cloud
- Identify compliance needs (HIPPA etc)
- Review core competencies for cloud
- Identify 1 or 2 platforms
- Select a pilot team
- A pilot application
- Education and implementation
- Build a knowledge base
- Business a server community of practice
- Iron.io
- Cloud Flare Workers
- OpenFaaS
- simple and easy deployments
- Easy to reproduce architecture
- Local execution for deployment and debugging
- Amazon EC2
- Lambda
- Dynamo DB - No Sql
- RDS - Relational Database Service
- Simple Email Service
- Simple Storage Service (S3)
- EC2 - 750 Hours
- 1 Million Lambda function a month
- 25 GB - dynamo db
- 20 GB - RDS
- S3 - 5 GB of files
- Lambda
- IAM
- Simple Email Service
- Systems Manager Service - parameter store to save api keys
- API Gateway
- Dynamo DB Service
- Users - Individuals who log into AWS with an email and password combination
- Groups - These are a collection of users which share permission policies
- Roles - These are similar to users because they carry with them a set of permissions that determine what a role can do. They are different because they don't have access keys or logic credentials. They can be assumed by AWS users or services like lambda
Users can be put into an IAM group that offers them certain permissions. This way we can give only the resources needed by a developer to a developer and only the resources needed by a data scientist to a data scientist. Each of those groups would then have policies that are applicable for those different kinds of users and each of these group policies is determined by and IAM group policy JSON.
Users > Groups > Policies
Roles are a more flexible concept that allows permissions to be granted to AWS users or AWS account resources etc.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "service-prefix:action-name",
"Resource": "*",
"Condition": {
"DateGreaterThan": {"aws:CurrentTime":"2020-04-01T00:00:00Z"},
"DateLessThan": {"aws:CurrentTime":"2020-06-30T23:59:59Z"}
}
}
]
}
- Strong Passwords and unique passwords
- If you can, use 2 factor authentication with a ha rdware token or a mobile app like google authenticator
- Principle of least privilege - Limit access to permissions or services wherever possible
- Be careful when using your root account
The AWS Policy Generator is a tool that enables you to create policies that control access to Amazon Web Services (AWS) products and resources.
https://awspolicygen.s3.amazonaws.com/policygen.html
- Cloud watch logs
- Cloud watch alarms to trigger and alert