saaStudy
#1 ๋ณด์ ์๊ฒฉ ์ฆ๋ช
Access Key๋ ๋ฃจํธ ๊ณ์ ์ ๋ง๋ค๋ฉด cli๋ sdk๋ก ๋ฃจํธ ๊ถํ์ ์ ๊ทผ ํ๋๊ฒ์ด๋ฏ๋ก ๋ง๋ค์ง ์๋ ๊ฒ์ด ์ข๋ค.
#2 IAM Roles
IAM Roles are like an user but they are intended to be used not by physical people,
but instead they will be by AWS services.
#3 ๋ณด์ ๊ด๋ฆฌ
Credential report : csv๋ก ์ ์ ๋ณ access ํ์คํ ๋ฆฌ ์ ๊ณต
Access Advisor : ๊ถํ ์ค์์ last accessed๋ก ์ด๋ค ์๋น์ค๊ฐ ํ์์๋ ์ง ์ ์ ์์
#4 IAM Policies
JSON documents that define a set of permissions for making requests to AWS services, and can be used by IAM Users, User Groups, and IAM Roles
#5 IAM User Groups can contain IAM Users and other User Groups. << False
IAM User Groups can contain only IAM Users. << True
#6 EC2 INSTANCE TYPE(33๊ฐ)
general : t class
compute optimized(high performance) : c class
memory optimized : r class
storage optimized : I, D, H class
#7 ๋ณด์ ๊ทธ๋ฃน
ํ ๋ณด์ ๊ทธ๋ฃน์ด ์ฌ๋ฌ ๊ฐ์ ์ธ์คํด์ค์ ๋ถ์ฐฉ ๊ฐ๋ฅ
ํ ์ธ์คํด์ค๊ฐ ์ฌ๋ฌ ๋ณด์ ๊ทธ๋ฃน์ ๊ฐ์ง ์๋ ์๋ค.
it's good to maintain one separate security group for ssh access
#8 classic port
22 : ssh
21 : ftp
22 : sftp(ssh๋ฅผ ์ฌ์ฉํ ftp)
80 : http
443 : https
3389 : rdp(remote desktop protocol) - log into a windows instance
#9 ๋ณด์๊ทธ๋ฃน์ ์ธ๋ฐ์ด๋๋ฃฐ์ ์ถ๊ฐํ๋ฉด ๋ณด์๊ทธ๋ฃน์ด ๋ถ์ฐฉ๋ ์ธ์คํด์ค๊ฐ ํ์ฉ๋๋ค. ๋ฐ๋ผ์ ip๋ port๋ฅผ ๋ชฐ๋ผ๋ ์ธ๋ฐ์ด๋๊ฐ ํ์ฉ๋ ์ ์๋ค.
#10 chmod 0400 << ssh ๋ก๊ทธ์ธ pemํค ์ฝ๊ธฐ ์ ์ฉ์ผ๋ก ๊ถํ ๋ณ๊ฒฝ ๋งฅ์์ ์ด๊ฑธ ํด์ผ ssh -i๋ก ๋ก๊ทธ์ธ ๊ฐ๋ฅ
#11 never do aws configure at ec2 instance
์๋ํ๋ฉด aws configure๋ก ec2์ iam์ ๊ถํ์ ์ค๋ฒ๋ฆฌ๋ฉด ec2์ ์ ๊ทผํ๋ ๋ค๋ฅธ ๊ถํ์ ๊ฐ์ง iam๋ ๊ทธ ๊ถํ์ ํ๋ํ๊ธฐ ๋๋ฌธ์ด๋ค.
#12
instance ssh ์ ๊ทผ : pem key
aws cli ์ค์ : access key id, secret access key
#13 aws ec2 purchasing option
#14 ec2 spot instances requests
spot instance used for batch jobs, data analysis, or workloads that are resilieent to failures
resilient to failures means that '์คํจํด๋ ๊ด์ฐฎ์ ๊ฒ' ์ ๋?
#15 how to terminate spot instances
44๊ฐ ์ฐธ๊ณ
#16 Spot Fleets
set of spot instances(optionaaly on-demand instance can be here)
spot fleets allow us to automatically request spot instances with the lowest price
#17 machines connect to www using NAT + internet gateway(proxy)
#18 placement groups : ์ธ์คํด์ค๋ค์ ๋ํด ๋ฌผ๋ฆฌ์ ์ผ๋ก ๊ทธ๋ฃนํํ๋ ๊ฒ
cluster
spread
partition >> hadoop, kafka์ ์ฌ์ฉ
๋์ ๊ทธ๋ฃน์ ๋ง๋ค๊ณ ์ธ์คํด์ค ์์ฑ ์ ์ ์ฉ๊ฐ๋ฅํ๋ค.
#19 elastic network interfaces
logical component in VPC
it represents a virtual network card
it gives ec2 instances access to the network
also used out of ec2 instance(์ธ์คํด์ค ๋ฐ์์๋ ์ฌ์ฉ๊ฐ๋ฅ, but ๋์ค์ ๋ค๋ฃธ)
์์ฑ
ํ ec2๊ฐ primary private ipv4, one or more secondary ipv4๋ฅผ ๊ฐ์ง ์ ์์
each eni can have one elastic ip per private ipv4 or public ipv4
one or more security groups ํ ๋น๊ฐ๋ฅ
a MAC address is attached
failover๋ฅผ ์ํด eni๋ฅผ ๋ค๋ฅธ ec2์ ๋ถ์ฐฉ๊ฐ๋ฅ ์ฆ eni๋ ์ด๋๊ฐ๋ฅํ๋ค๋ ๊ฒ
bound to a specific availability zone(AZ)
#20 elastic network interface ์ค์
description
subnet >> ์์ธ availability zone์์ a,b,c,d ์ ํ
ipv4ํ ๋น auto assign
security group ์ค์
#21 EC2 Nitro
it is next generation EC2 instance
new virtualization technology
higher speed EBS (MAX 64000 IOPS, whereas 32000 IOPS on none nitro / IOPS : io operation per second)
better security
Virtualized์ Bare metal ๋ชจ๋ ์ง์
#22 optimizing cpu option
core๋ ์ค๋ ๋(vCPU)๋ฅผ billing ๋๋ฌธ์ ์ค์ผ ์ ์๋ค.
#23 spot block instance
์๋ฅผ ๋ค๋ฉด batch ์์ ์ค 1~6์๊ฐ ์ ๋๋๋ ์๊ฐ์๋ interrupt๋ฅผ ๋ง์ ์ ์์
#24 EBS Volumes
they can only be mounted to one instance at a time
bound to a specific availability zone
network drive์ด๊ธฐ ๋๋ฌธ์ io์ use networkํ๋ค. ๋ฐ๋ผ์ a bit of latency๊ฐ ์๊ธด๋ค.
snapshot์ az์ ์๊ด์์ด ์ฎ๊ธธ ์ ์์
can increase capacity of drive over time
#25 AMI
creating an AMI will also create EBS snapshots
like ebs, ami is built for a specific region and also can be copied across region
#26 EC2 hibernate
EC2 instance root volume type must be an ebs volume
#27 EC2 Instance Store
๋ฌผ๋ฆฌ์ ์ผ๋ก ec2์ ๋ถ์ด์๊ธฐ ๋๋ฌธ์ high io performance ๊ธฐ๋ ๊ฐ๋ฅ
ํ์ง๋ง instance๋ฅผ stopํ๊ธฐ๋ง ํด๋ ๋ณผ๋ฅจ์ด ๋ค ์ญ์ ๋จ
์บ์, ๋ฒํผ, ์ผ์์ ๋ฐ์ดํฐ ์ ์ฅ์ ์ฌ์ฉ
It is ephemeral drive
256,000 IOPS ์ด์ ๊ธฐ๋๊ฐ๋ฅ
๋ฌผ๋ก ๋ฐฑ์ ์ ๋ฐ๋ธ์ต์ค์๊ฒ ๋ฌ๋ ค ์์
#28 EBS Volume Type
gp2,3 : ssd / gp2 >> max 16,000 IOPS
io1,2 : ์ฑ๋ฅ ๋์ข์ ssd, great for databases workloads /
io1 >> max 64,000 IOPS
io2 block express drive >> max 256,000 IOPS
32000์ด์์ iops๋ฅผ ์ํ๋ค๋ฉด nitro ec2์ io volume์ ์ฌ์ฉํ ๊ฒ
io1,2์ ๊ฒฝ์ฐ์๋ multi-attach๊ฐ ๊ฐ๋ฅํด์ ์ฌ๋ฌ ์ธ์คํด์ค๊ฐ ํ ๋ณผ๋ฅจ์ ์ฌ์ฉํ๊ฒ ํ ์๋ ์์
Using EBS Multi-Attach, you can attach the same EBS volume to multiple EC2 instances in the same AZ.
Each EC2 instance has full read/write permissions.
์ฆ EBS์ ์์ฑ์ same az์ด์ด์ผ ํ๋ค๋ ๊ฒ์ด ์ ์ฉ๋๋ค.
๊ทธ๋ด ๊ฒฝ์ฐ ๋์ write๋ฅผ manageํด์ผํจ
๊ทธ๋ด ๊ฒฝ์ฐ achieve high application availability
๊ทธ๋ด ๊ฒฝ์ฐ cluster awareํ file system์ ์จ์ผ ํจ(XFS, EX4๋ ์๋จ)
st1, sc1 : hdd, cannot be a boot volume
#29 EBS Encryption
EBS Encryption์ enableํ๋ฉด ๋ชจ๋ ๋ถ๋ถ์์ ์ํธํ๊ฐ ์ ์ฉ๋จ ๋ชจ๋ ๋ฐ์ดํฐ, ๋ณผ๋ฅจ, ์ค๋ ์ท, ๋ฐ์ดํฐ ์ ์ก ์์๋ ์ํธํ๊ฐ ์ ์ฉ๋จ
volume์ unencrypted๋ก ์์ฑ, ๋ ์ด volume์ ๋ํ snapshot์ unencrypted๋ก ์์ฑํ๋ฉด
snapshot copy๋ณธ์ encryptedํ๊ฒ ๋ง๋ค๊ณ ์ด encrypted๋ snapshot์ผ๋ก๋ถํฐ ์ํธํ๋ volume์ ์์ฑ๊ฐ๋ฅ
๋๋ unencrypted snapshot์์ ๋ฐ๋ก encrypted๋ ๋ณผ๋ฅจ์ ์์ฑ ๊ฐ๋ฅ
#30 EFS(Elastic File System)
Managed NFS(network file system) that can be mounted on many EC2
highly available, expensive, pay per use ๋ฐ๋๋ก EBS๋ PROVISIONED๋ ๋งํผ ์ง๋ถ
EFS works with EC2 instance in multi AZ ๋ฐ๋๋ก EBS๋ bound to specific region
EFS์ ๋ํด ๋ณด์ ๊ทธ๋ฃน ์ค์ ์ด ํ์ํจ
Attributes
uses security group to control access to EFS
Use cases : content management, web serving, data sharing, Wordpress
Only compatible with Linux based AMI not windows (POSIX ํ์ผ ์์คํ ์ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ)
scales automatically
Performance & Storage Classes
Performance mode
Throughput mode
Storage Tiers
66๊ฐ ํ๋
EFS-IA(Infrequent Access)์๋ ๊ธฐ๋ณธ ์ต์ ์ผ๋ก 30์ผ ๋์ ์ ๊ทผ๋์ง ์์ ํ์ผ์ IA์์ญ์ผ๋ก ์ฎ๊ฒจ์ ธ ๊ด๋ฆฌ๋จ(Storage Tier) to save some costs
EBS Multi-attach๋ single-az์ ์ธ์คํด์ค๋ง ์ง์ํ์ง๋ง EFS๋ multi-az์ ์ธ์คํด์ค์ ํตํฉ ๊ฐ๋ฅํ๋ค.
Uses security group to control access to EFS
Compatible with Linux based AMI(not Windows) : ์๋์ฐ ami๋ ์ง์ํ์ง ์๋๋ค.
#31 AMI
AMIs are built for a specific AWS Region, they're unique for each AWS Region.
You can't launch an EC2 instance using an AMI in another AWS Region,
but you can copy the AMI to the target AWS Region and then use it to create your EC2 instances.
๊ทธ๋ฌ๋๊น us-east-1๋ก ๋ง๋ AMI๋ฅผ ๋ค๋ฅธ ์ง์ญ์์ ์ฌ์ฉ ๋ถ๊ฐ๋ฅํ๋๊น ๋ค๋ฅธ ์ง์ญ์์๋ ์ฌ์ฉ๊ฐ๋ฅํ๋๋ก AMI๋ฅผ copyํ ํ ์จ์ผ ํ๋ค๋ ๋ป
#32 Scalability & High Availability
Horizontal Scaling : Auto Scaling Group, Load Balancer
High Availability : Auto Scaling Group Multi AZ, Load Balancer Multi AZ
#33 Application Load Balancer(v2)
ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ก๋ ๋ฐธ๋ฐ์๋ฅผ ํตํด ๋ค์ด์ค๋ฏ๋ก ์ธ์คํด์ค๊ฐ ์๋ณธ ip from์ ๋ชจ๋ฅด๋ฏ๋ก X-Forwarded-For(client ip), X-Forwarded-Port, X-Forwarded-Proto๋ฅผ ์ ์ด์ฃผ์ด์ผ ์์ฒญํ ip๋ฅผ ์ ์ ์๋ค.
ALB๋ multipleํ target group์ ๊ฐ์ง ์ ์์ง๋ง ํ๋์ ํฌํธ์๋ ํ๋์ target group๋ง ํ ๋นํ ์ ์๋ค.
#34 Target Group
Instance
Ip address(Must be private IPs)
Lambda functions
Load balancer
#35 Network Load Balancer
NLB has one static IP per AZ, and supports assigning Elastic IP : ๋คํธ์ํฌ ๋ก๋๋ฐธ๋ฐ์๋ az๋น ํ๋์ ๊ณ ์ IP๋ฅผ ๊ฐ๊ณ elastic ip ํ ๋น์ ์ง์ํ๋ค.
Performance is better than ALB
๋ก๋ ๋ฐธ๋ฐ์ ์์ฑ ์ AZ์ IPํ ๋นํ ๋, ALB๋ assigned by AWS์ด์ง๋ง
NLB๋ ๊ฐ AZ๋น elastic ip๋ฅผ ํ ๋นํ ์ ์์
NLB๋ ALB์ ๋ฌ๋ฆฌ ๋ณด์ ๊ทธ๋ฃน์ ์ค์ ํ์ง ์๋๋ค.
๋ฐ๋ผ์ HTTP๋ฅผ ์ด์ฉํด ๋์ ๊ทธ๋ฃน ๋ด๋ถ์ ์ธ์คํด์ค๋ค์ ์๋ต์ ๋ฐ์ผ๋ ค๋ฉด ์ธ์คํด์ค๋ค์ ๋ณด์ ๊ทธ๋ฃน์ HTTP, 80ํฌํธ๋ฅผ from anywhere๋ก ์ค์ ํด์ผ ํ๋ค.
์ฆ NLB๋ TCP,TLS,UDP๋ฅผ ์ด์ฉํด ๋ฐ๋ก ๋์ ๊ทธ๋ฃน์ ์ ๋ฌํ๋ ์ญํ ์ ํ๋ ๊ฒ์ด๋ค.
๊ฒ์์ ๋ณด๊ธฐ์๋ ๋ก๋ ๋ฐธ๋ฐ์๋ฅผ ํตํด์ ์ค๋ ๊ฒ์ฒ๋ผ ๋ณด์ด์ง ์๊ณ , ์ธ๋ถ ํด๋ผ์ด์ธํธ์ ์์ฒญ์์ ์ค๋ ๊ฒ์ฒ๋ผ ๋ณด์ธ๋ค.
#36 Gateway Load Balancer
in IP protocol (layer 3 Network layer)
it is transparent network gateway becauase it has single entry and single exit
์์ฒญ์ด ๋ณด์๊ทธ๋ฃน๊ฐ์ ์กฐ๊ฑด์ ๋ถํฉํ์ง ์์ผ๋ฉด drop
78๊ฐ ๋ค์ด์ด๊ทธ๋จ ์ฐธ๊ณ
it uses GENEVE protocol on port 6081
#37 Cross-Zone Load Balancing
Classic Load Balancer
disabled by default
no charges for inter AZ
Application Load Balancer
always on
no charges for inter AZ
Network Load Balancer
disabled by default
pay charges for inter AZ
#38 SNI(Server Name Indication)
CLB ๋ฏธ์ง์
SNI๋ก ์ธํด ALB,NLB๋ multipleํ ssl์ธ์ฆ์๋ฅผ ๋ก๋๋ฐธ๋ฐ์์ ์ฅ์ฐฉํด ๋ค๋ฅธ ๋๋ฉ์ธ์ ๋์๊ทธ๋ฃน์ผ๋ก ๋ณด๋ผ ์ ์๋ค.
#39 Connection Draining
CLB : Connection Draining
ALB & NLB : Deregistration Delay
์ด๊ฑธ ์ค์ ํ๋ฉด ์ ์์ฒญ์ ๊ฑฐ์ ํ๊ณ ๊ธฐ์กด ์์ฒญ์ ์์ ํ๊ฒ ์ฒ๋ฆฌํ ํ ์ธ์คํด์ค๋ฅผ ์ข ๋ฃํ ์ ์์
#40 Auto Scaling Group
work with Load Balancer
Automatic Scaling
dynamic scaling policy
target tracking policy : cpu์ ์ฌ์ฉ๋์ ๊ธฐ๋ฐํด ์ธ์คํด์ค๋ฅผ ๋๋ฆด๊ฑฐ๋ ์ค์ผ ์ ์์
step policy
simple policy
predicted scaling policy
์ด์ ์ฌ์ฉ ๊ธฐ๋ก์ ๊ธฐ๋ฐํ ์คํ ์ค์ผ์ผ๋ง, ๋จธ์ ๋ฌ๋์ ์ด์ฉ
scheduled actions
Good Mertics To Scale On
CPUUtilization: Average CPU utilization across your instances
RequestCountPerTarget: to make sure the number of requests per EC2 instances is stable
Average Network In / Out (if youโre application is network bound)
Any custom metric (that you push using CloudWatch)
After a scaling activity happens, you are in the cooldown period (default 300 seconds)
During the cooldown period, the ASG will not launch or terminate additional instances (to allow for metrics to stabilize)
Advice: Use a ready-to-use AMI to reduce configuration time in order to be serving request fasters and reduce the cooldown period
์ฆ scaliingํ ์ cooldown ๊ธฐ๊ฐ์ด ์๊ฒจ ๊ทธ ๊ธฐ๊ฐ์ค ๋ ๋ค๋ฅธ scaling action์ด ์๊ธฐ๋ฉด ๋ฌด์ํ๋ค๋ ์๋ฏธ
ASG Default Termination Policy
ASG tries the balance the number of instances across AZ by default
์ฆ ์ธ์คํด์ค๊ฐ ๋ง์ AZ๋ถํฐ ์ธ์คํด์ค๋ฅผ ์ ๊ฑฐํ๋ ๊ฒ์ด ๊ธฐ๋ณธ ์ ์ฑ
ASG lifecycle hooks
auto scaling group์์ ์ธ์คํด์ค๊ฐ inService๋ Terminatedํ ์ํ๊ฐ ๋๊ธฐ ์ ์ Wait, Proceedํ๋ ๊ธฐ๊ฐ์ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ๊ฑฐ๋ ์์ฒญ์ ์ฒ๋ฆฌํ ์ ์๋ค.
Launch Configuration (legacy) VS Launch Template (newer)
Launch Configuration (legacy)
Must be re-created every time
Launch Template (newer)
Can have multiple versions
Create parameters subsets (partial configuration for re-use and inheritance)
Provision using both On-Demand and Spot instances (or a mix)
Can use T2 unlimited burst feature
Recommended by AWS going forward
์ฐธ๊ณ ๋ก RequestCountPerTarget์ CPUUtilization๊ณผ ๋ฌ๋ฆฌ ์์ฑ ๊ธฐ๋ณธ ์ต์ ์ ์๊ธฐ ๋๋ฌธ์ ์ด๊ฑธ Scaling์ ์งํ๋ก ์ฌ์ฉํ๋ ค๋ฉด CloudWatch๋ฅผ ์ฌ์ฉํด์ custom metric์ ๋ง๋ ํ CloudWatch์๋์ ์ฌ์ฉํด์ผ ํ๋ค.
Use a ready-to-use AMI to reduce configuration time in order to be serving request fasters and reduce the cooldown period : ready-to-use ami๋ฅผ ์ฌ์ฉํ๋ฉด ์ค์ ์๊ฐ์ ์ค์ฌ cooldown period๋ฅผ ์ค์ผ ์ ์๋ค.
ASG tries the balance the number of instances across AZ by default : AZ๊ฐ ์ธ์คํด์ค ์์ ๊ท ํ์ ๋ง์ถ๋ ๊ฒ์ด default์ด๋ค.
#41 RDS
can't ssh to an instance
RDS Backups
์๋ ๋ฐฑ์ ์กด์ฌ
๋งค์ผ ๋ชจ๋ ๋ฐ์ดํฐ๊ฐ ๋ฐฑ์ ๋จ
๋ฐฑ์ ๋ฐ์ดํฐ๋ 7์ผ ๋์ ์ ์ฅ๋๊ณ 35์ผ๊น์ง ์ฐ์ฅ๊ฐ๋ฅ
๋งค 5๋ถ๋ง๋ค ํธ๋์ญ์ ๋ก๊ทธ๊ฐ ์์
DB Snapshot
์ ์ ๊ฐ ์ง์ ๋ฐฑ์ ํจ
๋ณด์ ๊ธฐ๊ฐ ๋ฌด์ ํ
Storage Auto Scaling
Helps you increase storage on your RDS DB instance dynamically
When RDS detects you are running out of free database storage, it scales automatically
You have to set Maximum Storage Threshold
Useful for applications with unpredictable workloads
Read Replicas
up to 5 read replicas : ์ต๋ 5๊ฐ์ replica ์์ฑ ๊ฐ๋ฅ
within az, cross az, cross region
network cost : async replication to different az but same region no fee
network cost : async replication to different region will fee
replication is async
RDS Multi AZ (Disaster Recovery)
SYNC replication
One DNS name โ failover to standby(dns๋ฅผ ์ฌ์ฉํด์ rds์ธ์คํด์ค๊ฐ ์ฌ์ฉ ๋ถ๊ฐ๋ฅํ๋ฉด ์๋ ๊ต์ฒดํ๊ธฐ ๋๋ฌธ์ ์ฌ์ฉ์๋ dns๋ง ์๋ฉด ๋จ)
Increase availability
Not used for scaling
Important : The Read Replicas be setup as Multi AZ for Disaster Recovery (DR)
From Single-AZ to Multi-AZ
Zero downtime operation (no need to stop the DB)
Just click on โmodifyโ for the database
Multi AZ์ Read Replica์ ํฐ ์ฐจ์ด์ ์ sync์ async๋ผ๋ ํน์ง
Multi-AZ replication is free
Encryption has to be defined at launch time
IAM-based authentication can be used to login into RDS MySQL & PostgreSQL
RDS - IAM Authentication์ผ๋ก ์ป์ ์ ์๋ ์ฅ์
์ฐธ๊ณ : aws rds generate-db-auth-token << ์ด๋ฐ ๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํจ
Network in/out must be encrypted using SSL
IAM to centrally manage users instead of DB : rds ์๋น์ค๋ก๋ถํฐ ํ ํฐ ๋ฐ๊ธ์ ํตํด IAM policy์ผ๋ก ๋ง๋ค์ด์ง rds์ ๊ทผ ๊ถํ์ ๊ฐ์ง๋ฏ๋ก db์ ๊ทผ ๊ถํ์ db๊ฐ ์๋ IAM์ด ๊ด๋ฆฌํด ๊ด๋ฆฌ๋ฅผ ์ค์ํํ ์ ์๋ค.
Can leverage IAM Roles and EC2 Instance profiles for easy integration
#42 RDS Security
๋ง์คํฐ๊ฐ ์ํธํ๋์ด ์์ง ์์ผ๋ฉด, ๋ ํ๋ฆฌ์นด๋ ์ํธํํ ์ ์๋ค.
rds์์์ enforce ssl
postgre : parameter group ์ฌ์ฉ
mysql : sql command ์ฌ์ฉ(grant user ... require ssl)
91๊ฐ summary ์ฝ์ด๋ณด๊ธฐ
#43 Aurora
aurora ๊ตฌ์กฐ 92๊ฐ
aurora hands on 93๊ฐ : replica์ฌ์ฉ ์ํด๋ storage๋ replica๋ 3๊ฐ์ az์ ์ ์ฅ๋๋ค. that's guarantee.
aurora์ shared storage volume์ master, read replica๊ฐ ๊ณต์ ํ๊ณ , 10GB to 64TB๊น์ง ์๋ ํ์ฅ๋๋ค.
One Aurora Instance takes writes(master)
Automated failover for master in less than 30 seconds
Master + up to 15 Aurora Read Replicas serve reads : ๋ง์คํฐ 1๊ฐ + read replica ์ต๋ 15๊ฐ = ์ด 16๊ฐ
Support for Cross Region Replication
6 copies of your data across 3 AZ : ์ฝ๊ฐ์ ์ธ์คํด์ค๊ฐ failํด๋ ์๊ด์๋ค๋ ๊ฒ์ ๋ณด์ฌ์ค
4 copies out of 6 needed for writes : ์ฐ๊ธฐ์ 6๊ฐ ์ค ์ต์ 4๊ฐ์ ์นดํผ๋ณธ์ด ํ์
3 copies out of 6 need for reads : ์ฝ๊ธฐ์ 6๊ฐ ์ค ์ต์ 3๊ฐ์ ์นดํผ๋ณธ์ด ํ์
Aurora Security
Possibility to authenticate using IAM token (same method as RDS)
Aurora Cross Region Read Replicas
Useful for disaster recovery : ์ฌํด ๋ณต๊ตฌ์ ์ ์ฉํ๋ค.
Aurora Global Database (recommended) : ์ฌํด ๋ณต๊ตฌ์ Aurora Cross Region Read Replicas๋ณด๋ค ๋ ์ ์ฉํ๋ค.
1 Primary Region (read / write)
Up to 5 secondary(read-only) regions*, replication lag is less than 1 second
Up to 16 Read Replicas per secondary region
Helps for decreasing latency : ๋ชจ๋ ๋ฆฌ์ ์์ ๋น ๋ฅธ ์ ๊ทผ ๊ฐ๋ฅ
Promoting another region (for disaster recovery) has an RTO of < 1 minute
#44 Aurora Replicas - Auto Scaling
#45 Section 9 : quiz 6 - 5๋ฒ, 8๋ฒ, 11๋ฒ
#46 Route 53
Multi Value policy์ Simple policy์ ์ฐจ์ด์ ์ Multi Value๋ health check๊ฐ ๊ฐ๋ฅํ๋ค๋ ๊ฒ
๋ฐ๋ฉด simple policy๋ ์ฌ๋ฌ ๊ฐ๋ค์ ๋ฆฌํดํ๊ณ ํด๋ผ์ด์ธํธ๋ ๊ทธ ์ค ๋๋คํ ๊ฐ์ ๋ฐ์์ ์ฌ์ฉํ๋ค.
Health Check 3๊ฐ์ง
Monitor on EndPoint
Calculated Health Check
Cloud Watch Alarm์ ๋ชจ๋ํฐ๋งํ๋ Health Check / Private Endpoint๊ฐ์ ๊ณณ์ health check์ด ๋ถ๊ฐ๋ฅํ๋ฏ๋ก cloudwatch metric์ ์ฌ์ฉํด ์ฐ๋
#47 S3
If uploading more than 5GB, must use โmulti-part uploadโ : s3์ ์ ๋ก๋ํ๋ ์ค๋ธ์ ํธ๊ฐ 5GB ์ด์์ด๋ฉด multi-part upload๋ฅผ ์ฌ์ฉํด์ผ ํ๋ค.
Cloudfront๋ 1GB ๋ฏธ๋ง์ธ static ์์์ ์บ์ํ๊ธฐ ์ ํฉํ๋ค. 1GB ์ด์์ธ ์์์ ๋ํด์๋ S3 Transfer Acceleration(Cloudfront์ ๋ง์ฐฌ๊ฐ์ง๋ก ๊ธ๋ก๋ฒํ ์๋น์ค์ด๊ธฐ ๋๋ฌธ์ ๊ธ๋ก๋ฒํ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ํฉ)์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข๋ค.
s3 versioning : delete marker๊ฐ ์กด์ฌํด์ restore๊ฐ ๊ฐ๋ฅํจ
135๊ฐ s3 CORS ์ด๋ก ์ฝ์ด๋ณด๊ธฐ
Explicit DENY in an IAM Policy will take precedence over an S3 bucket policy.
IAM Policy๊ฐ s3 bucket policy์ ์ฐ์ ํ๊ฒ ํ๋ ค๋ฉด explicit deny๋ฅผ iam policy์ ์ ์ฉํ๋ฉด ๋๋ค.
99.999999999% durability / 99.99% availability : durability๋ ์ถํ ์ธ์ ๊ฐ๋ ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ ์ ์์์ ์๋ฏธํ๊ณ , availabilty๋ ์ฆ์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ ์ ์์์ ์๋ฏธํ๋ค.
S3 Replication : S3 Replication์ cross region, same region ๋ชจ๋ ๊ฐ๋ฅํ๊ณ , async replication์ ์ฌ์ฉํ๋ค.
#48 S3 Storage Classes : One Zone IA๋ฅผ ์ ์ธํ ๋ชจ๋ ํด๋์ค๋ 3๊ฐ ์ด์์ az๋ฅผ ๊ฐ์ง๋ค.
S3 Standard
S3 Intelligent Tiering : S3 Intelligent-Tiering์ ์ก์ธ์ค ํจํด์ด ๋ณ๊ฒฝ๋ ๋ ๋ ์ก์ธ์ค ํฐ์ด(Frequent Access ๋ฐ Infrequent Access) ๊ฐ์ ๋ฐ์ดํฐ๋ฅผ ์ด๋์์ผ ๋น์ฉ์ ์๋์ผ๋ก ์ ์ฝํด ์ฃผ๋ ์ต์ด์ ํด๋ผ์ฐ๋ ๊ฐ์ฒด ์คํ ๋ฆฌ์ง ํด๋์ค๋ก์, ์ก์ธ์ค ํจํด์ ์ ์ ์๊ฑฐ๋ ์ก์ธ์ค ํจํด์ด ๋ณ๊ฒฝ๋๋ ๋ฐ์ดํฐ์ ์ ํฉ
S3 Standard IA
S3 One Zone IA : 1๊ฐ์ az๋ฅผ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ๋ค๋ฅธ ํด๋์ค์ ๋นํด์ ๋ฎ์ availability๋ฅผ ๊ฐ์ง
S3 Glacier : ๋น ๋ฅด๋ฉด ๋ถ๋จ์์๋ retrieveํ ์ ์์ง๋ง, standard๋ 3 to 5 hours
S3 Glacier Deep Archive : bulk์ต์ ์ ํ ์ retrieve์ ์ต๋ 48์๊ฐ ๊ฑธ๋ฆผ, standard๋ 12 hours
#49 S3 Lifecycle Rules
S3 ์๋๋ฆฌ์ค๋ฅผ ์ฃผ๊ณ ๋ผ์ดํ ์ฌ์ดํด์ ์ด๋ป๊ฒ ๊ตฌ์ฑํ ๊ฒ์ธ์ง ๋ฌผ์ด๋ณด๋ ๋ฌธ์ ์์ฃผ ์ถ์ p.311
#50 S3 Analytics
S3 ๋ถ์์ ์ ๊ณตํด์ ์ด ์ต์ ์ ํ์ฑํํ๋ฉด ๋ถ์์ ๊ทผ๊ฑฐํด์ ๋ผ์ดํ ์ฌ์ดํด์ ๋ฉฐ์น ์ ๊ธฐ์ค์ผ๋ก ํด์ผํ ์ง ๊ฒฐ์ ํ ์ ์๋ค.
Standard to Standard_IA๋ก๋ง ๊ฐ๋ฅํ๋ค.
Onezone_IA, Glacier๋ ์ ๊ณตํ์ง ์๋๋ค.
#51 S3 Baseline Performance
Your application can achieve at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per prefix in a bucket.
์ฆ 4๊ฐ์ prefix๋ฅผ ์ฌ์ฉํ๋ค๋ฉด 22,000 requests per second for GET and HEAD์ ์ฑ๋ฅ์ ๊ฐ์ง๋ค๊ณ ๋ณผ ์ ์๋ค.
์์ : object path == prefix:
bucket/folder1/sub1/file => /folder1/sub1/
bucket/folder1/sub2/file => /folder1/sub2/
bucket/1/file => /1/
bucket/2/file => /2/
์์์ ๋ณผ ์ ์๋ฏ์ด ์ 4๊ฐ๋ ์ ๋ถ ๋ค๋ฅธ prefix์ด๋ค.
#52 S3 Performance
p.315, p.317 ๊ทธ๋ฆผ ์ฐธ๊ณ
Multi-Part upload
recommended for files > 100MB
must use for files > 5GB
Can help parallelize uploads (speed up transfers) : ํ์ผ์ ์ฌ๋ฌ ๋ถ๋ถ์ ์๋ผ ๋๋ ํ ๋์์ ๋ณด๋ธ๋ค.
S3 Transfer Acceleration
Increase transfer speed by transferring file to an AWS edge location which will forward the data to the S3 bucket in the target region
๊ฐ๊น์ด region์ edge location์ ๋ณด๋ด๊ณ aws๊ฐ ์์์ private๊ฒฝ๋ก๋ฅผ ํตํด์ ๋ชฉํ region์ bucket์ ๋ณด๋ธ๋ค๋ ๊ฒ์ด๋ค.
๋ฐ๋ผ์ ์ ๋ก๋ ์๋ ํฅ์์ ๊ธฐ๋ํ ์ ์๋ค.
Compatible with multi-part upload
edge location์ cloudfront์์ ๋ค์ ๋ค๋ฃฐ ๋ฏํ๋ค.
S3 Performance โ S3 Byte-Range Fetches
Parallelize GETs by requesting specific byte ranges
Better resilience in case of failures
ํ์ผ์ ๋ฐ์ดํธ ๊ธฐ์ค์ผ๋ก ๋ถ๋ถ์ผ๋ก ๋๋์ด ๋ณด๋ด๊ฑฐ๋, ํ์ผ์์ ์ฒซ ๋ช ๋ฐ์ดํธ๋ง ๊ฐ์ ธ์ฌ ์ ์๋ค.
#53 S3 Select & Glacier Select
Retrieve less data using SQL by performing server side filtering
๊ฐ๋จํ ํ์ผ ํ์ ์ ๋ ex).csv๋ฅผ ์ฟผ๋ฆฌ ๊ฐ๋ฅํ๋ฉด ๋ณต์กํ ์ฟผ๋ฆฌ๋ s3 serverless์ธ athena์์ ๋ค๋ฃฌ๋ค.
#54 S3 Event Notifications
์์๋ก ๋์์์ s3์ ์ ๋ก๋ํ๋ฉด sns, sqs, lambda์ ์๋ฆผ์ ์ฃผ๋ ์ฉ๋๋ก ์ฌ์ฉํ ์ ์๋ค.
์ด๋ฒคํธ ๋ฐ์ ์์ ์ ์ค๋ธ์ ํธ ์ ๋ก๋๋, ์ญ์ , ๋ณต์ ๋ฑ์ผ๋ก ์ค์ ๊ฐ๋ฅํ๋ค.
์ธ์ notification์ด ๋ฐ์ํ๋ ์ง, rule์ ์ปค์คํ ํ ์ ์๋ค.
#55 S3 Request Pays
s3์ ํ์ผ์ ์์ฒญํ๋ ์ฌ๋์ด ๋คํธ์ํฌ ๋น์ฉ์ ์ง๋ถํ๊ฒ ํ ์ ์๋ค.
aws์ ์ธ์ฆ๋ ์ฌ๋๋ง ๊ฐ๋ฅ(must not be anonymous)
#56 Amazon Athena
Serverless query service to perform analytics against S3 objects
์ ํ ๋ฌธ์ : analyze data in S3 using serverless SQL, use Athena
์๋ฒ๋ฆฌ์ค์ด๊ธฐ ๋๋ฌธ์ db๋ฅผ ์ง์ ๋ง๋ค๊ณ ๊ด๋ฆฌํ ํ์ ์์ด, rdb๋ฅผ GUI๋ก ๋ง๋ค ์ ์๊ณ sql์ ์ฌ์ฉ๊ฐ๋ฅํ๋ค.
์ฌ๋ฌ ์ ๋ณด๊ฐ ์ ์ฅ๋๊ธฐ ๋๋ฌธ์ s3 ์ ๊ทผ ์๊ฐ, http status๋ฑ ๋ค์ํ ์ก์ธ์ค ์ ๋ณด๋ฅผ ์ ์ฅํ๊ณ ์กฐํํ ์ ์๋ค.
#57 S3 Object Lock
WORM (Write Once Read Many) model ๊ตฌํ
versioning์ด ํ์ฑํ๋ ์ํ์์๋ง ๋์
Object retention(๋ณด์ ๊ธฐ๊ฐ)
Retention Period: specifies a fixed period > ํน์ ๊ธฐ๊ฐ ๋์๋ง ๋ณด์
Legal Hold: same protection, no expiry date > ์์ ๊ฐ์ง๋ง ๋ง๋ฃ์ผ์ด ์์
Mode:
Governance mode: ๋ฃจํธ ๊ณ์ ์ ๋ชจ๋ ๋ณ๊ฒฝ ๊ฐ๋ฅ, ํ์ผ ๋ณ๊ฒฝ ๊ฐ๋ฅ
Compliance mode: ํ ๋ฒ ์ค์ ํ๋ฉด ๋ฃจํธ ๊ณ์ ์ด๋ผ๋ ๋ชจ๋ ๋ณ๊ฒฝ ๋ถ๊ฐ, ํ์ผ ๋ณ๊ฒฝ ๋ถ๊ฐ
#58 CloudFront vs S3 Cross Region Replication
CloudFront๋ฅผ ์ฌ์ฉํด์ผ ํ ๊ณณ
Great for static content that must be available everywhere
Cross Region Replication์ ์ฌ์ฉํด์ผ ํ ๊ณณ
great for dynamic content that needs to be available at low-latency in few regions
๋จ์ ์ผ๋ก๋ CloudFront์ ๋ฌ๋ฆฌ region๋ง๋ค ์ผ์ผ์ด ์ธํ ํด์ค์ผ ํจ
#59 CloudFront Signed URL / Signed Cookies
๋จ์ผ ์์์ ์ก์ธ์คํ๊ธฐ ์ํ ํน์ ํ์๋ง์ ์ํ URL
Multiple ์์์ ์ก์ธ์คํ๋ ํน์ ํ์๋ง์ ์ํ URL(one signed cookie for many files)
#60 CloudFront โ Origin Groups
high availability๋ฅผ ์ํด origin์ ์ฌ๋ฌ ๊ฐ ๋ ์ ์์
#61 CloudFront
Origin Access Identity : ์ฌ์ฉ์๊ฐ S3 ๋ฒํท์์ ์ง์ ์ก์ธ์คํ์ง ์๊ณ , CloudFront๋ฅผ ํตํด์๋ง ํ์ผ์ ์ก์ธ์คํ ์ ์์ต๋๋ค.
๋ํ, ๋ณดํต S3 bucket policy์ ํจ๊ป ์ฌ์ฉํ๋ค.
CloudFront Geo Restriction : ํ์ดํธ ๋ฆฌ์คํธ, ๋ธ๋ ๋ฆฌ์คํธ๋ก ์ ๊ทผํ ์ ์๋ ๊ตญ๊ฐ ์ ํ
S3 Cross Region Replication vs CloudFront
S3 Cross Region Replication : Great for dynamic content that needs to be available at low-latency in few regions
CloudFront : Great for static content that must be available everywhere
CloudFront Signed URL vs Signed Cookies
Signed URL : access to individual files (one signed URL per file)
Signed Cookies : access to multiple files (one signed cookie for many files)
CloudFront Origin Groups
cloudfront origin group์ primary origin๊ณผ secondary origin์ ๋์ด region ๋ ๋ฒจ์ ๊ณ ๊ฐ์ฉ์ฑ์ ์คํํ๊ฒ ํด์ค๋ค.
S3 + CloudFront : Region-level High Availability
Origin Group์ ๋์์ ec2๊ฐ ๋ ์๋ s3๊ฐ ๋ ์๋ ์๋ค.
#62 Unicast IP vs Anycast IP
AWS Global Accelerator๋ Anycast IP๋ฅผ ์ฌ์ฉํด์ ๊ฐ์ ip์ค geo location์ด ๋ ๊ฐ๊น์ด ์ชฝ์ผ๋ก ๋ผ์ฐํ ๋๋ ๋ฐฉ์์ ์ฑํ
#63 CloudFront vs Global Accelerator
Global Accelerator
Improves performance for a wide range of applications over TCP or UDP
Good fit for non-HTTP use cases
CloudFront uses Edge Locations to cache content while Global Accelerator uses Edge Locations to find an optimal pathway to the nearest regional endpoint.
CloudFront is designed to handle HTTP protocol meanwhile Global Accelerator is best used for both HTTP and non-HTTP protocols such as TCP and UDP.
#64 AWS Snow Family
๋ช์ญ ํ ๋ผ๋ฐ์ดํธ๋ถํฐ ์์ํ๋ ๋ฐ์ดํฐ๋ค์ ๋น ๋ฅด๊ฒ ์ฎ๊ธฐ๊ณ ์ถ์ ๋ ์ฌ์ฉํ๋ ๊ฒ์ผ๋ก ๋ฌผ๋ฆฌ์ ์ฅ์น๋ฅผ ์ฌ์ฉํด ์๋๋ฅผ ๋์ธ๋ค.
์ฆ, ๋คํธ์ํฌ๋ฅผ ํตํด s3๊ฐ์ ์ ์ฅ์์ ์ฎ๊ธฐ๋ ๊ฒ์ด ์๋๋ผ ์ง์ aws์ ํ๋์จ์ด์ ์ผ๋ก ๊ฐ์๋ผ์ฐ๋ ๊ฒ์ด๋ผ๊ณ ์๊ฐํ๋ฉด ํธํ๋ค.
๋ณดํต ๋ฐ์ดํฐ ๋ง์ด๊ทธ๋ ์ด์ ์ ์ผ์ฃผ์ผ ์ด์์ด ๊ฑธ๋ฆด ๋ ์ฌ์ฉํ๋ฉด ์ข๋ค.
Snowcone - ์์ญ ํ ๋ผ๋ฐ์ดํธ ๋ง์ด๊ทธ๋ ์ด์ ์ ์ฌ์ฉ
Snowball Edge - ์์ญ ํํ๋ฐ์ดํธ ๋ง์ด๊ทธ๋ ์ด์ ์ ์ฌ์ฉ
Snowmobile - ์์ญ ์์ฌ๋ฐ์ดํธ ๋ง์ด๊ทธ๋ ์ด์ ์ ์ฌ์ฉ
#64 Snow Family Edge Computing
์ค์ง์์ ํด๋ผ์ฐ๋ ์ปดํจํ ์ ์ฌ์ฉํ๊ธฐ ์ํด์ snow family๋ฅผ ์ฌ์ฉํ ์ ์๊ณ , snowcone๊ฐ์ ๋ฌผ๋ฆฌ์ ์ฅ์น์ ์ ๊ทผํ ๋ AWS OpsHub๋ฅผ ์ฌ์ฉํ๋ค.
#64 Snowball into Glacier
snowball์์ ๋ฐ๋ก glacier๋ก ์ฎ๊ธธ ์ ์๊ณ , s3๋ก ์ฎ๊ธด ํ s3 lifecycle์ ์ด์ฉํด์ glacier๋ก ์ฎ๊ธฐ๋ ๊ฒ์ด ์ ์ผ ์ข์ ๋ฐฉ๋ฒ์ด๋ค.
#65 SQS - Standard Queue
FIFO๊ฐ ์๋ Standard๋ฒ์ ์ ํน์ฑ
At least once delivery : ํ ๋ฒ๋ง receiveํ๋ ๊ฒ์ ๋ณด์ฅํ๋ค.
Consumers receive and process messages in parallel : ๋ณ๋ ฌ์ consumer๊ฐ ์กด์ฌํ ๋ ํ ๋ฉ์์ง๋ ํ consumer์๊ฒ๋ง ์ ๋ฌ๋๋ค.(ํ ๋ฒ๋ง ๋ฐ๋ ๊ฒ ๋ณด์ฅ)
Consumers delete messages after processing them
We can scale consumers horizontally to improve throughput of processing
FIFO Queue์ ๋ฌ๋ฆฌ throughput์ ์ ํ์ด ์๋ค.
๋ฎ์ ์ง์ฐ์๊ฐ(publish, receivee0ํ๋๋ฐ์ 10ms๋ฐ์ ๊ฑธ๋ฆฌ์ง ์๋๋ค.)
๊ฐ ๋ฉ์์ง๋ 256KB๋ก ์ ํ
๋ฉ์์ง๋ ๊ธฐ๋ณธ 4์ผ์์ ์ต๋ 14์ผ๊น์ง ๋ณด๊ด๊ฐ๋ฅ
#66 SQS - Message Visibility Timeout
387p. consumer๊ทธ๋ฃน ๋ด์์ ํ consumer๊ฐ ๋ฉ์์ง๋ฅผ consumeํ๋ฉด ๋ค๋ฅธ consumer๋ visibility timeout๊ธฐ๊ฐ ๋์ ๋ฉ์์ง๋ฅผ ๋ณผ ์ ์๋ค.
์ฆ ํ consumer๊ฐ ์๋นํ๋ ๋์ visibility timeout๊ธฐ๊ฐ(์ฌ์ฉ์ ์ค์ ๊ฐ๋ฅ)๋์ ๋ค๋ฅธ consumer์ ์ ๊ทผ์ ๋ง๋ ๊ฒ์ด๋ค.
visibility timeout๊ธฐ๊ฐ ์ดํ message๊ฐ delete๋์ง ์์์ ๋ ๋ค์ ๋ฉ์์ง๋ฅผ consumeํ consumer๊ฒฐ์ ๋ฐฉ์์ polling์ค์ธ consumer์ค ๋๋ค์ผ๋ก ๊ฒฐ์ ๋๋ ๊ฒ ๊ฐ๋ค.
#67 SQS - Dead Letter Queue
sqs๋ฅผ ๋ ๊ฐ ๋ง๋ค๊ณ ํ๋๋ dead letter queue์ ์ฉ ํ๋ก ๋ง๋ค ์ ์๋ค.
์ฌ๊ธฐ์ dead letter์ด๋ผ ํจ์, ํ message์ ๋ํด์ threshold(์ฌ์ฉ์ ์ค์ ๊ฐ๋ฅ)๋งํผ consumer๊ฐ receiveํ์์๋ ๋ถ๊ตฌํ๊ณ , message๊ฐ ์ ์์ ์ผ๋ก process๋์ง ์์ ๊ฒ์ ๋งํ๊ณ ์ฌ๊ธฐ์์์ message๊ฐ dead letter์ด๋ค.
#68 SQS - Long Polling
Long Polling decreases the number of API calls made to SQS while increasing the efficiency and latency of your application.
Long Polling์ ๋ฉ์์ง๊ฐ ์์ ๋ ๋๊น์ง ๊ธธ๊ฒ ๊ธฐ๋ค๋ฆฌ๊ฒ ๋ค๋ ์๋ฏธ(๋ณดํต 20์ด๋ก ์ค์ )์ด๋ค.
๋ฉ์์ง๊ฐ ์๋ค๋ฉด ๋ช ๋ฒ์ด๊ณ ๊ณ์ ์์ฒญํ๋ ์ํฉ์ด ๋ฐ์ํ ์ ์๋๋ฐ Long Polling์ผ๋ก ์ด๋ฅผ ๋ฐฉ์งํ ์ ์๋ค.
Increasing the efficiency and latency : ์ค๋ ๊ธฐ๋ค๋ฆด ์ ์๊ธฐ ๋๋ฌธ์ ๋น์ฐํ๊ฒ๋ ํจ์จ์ฑ์ด๋ ์ง์ฐ์๊ฐ์ด ๋์ด๋ ์ ์๋ค.
#69 SQS - Request-Response Systems
391p. Request-Response Systems์ ๊ตฌํํ๋ ํด๋ผ์ด์ธํธ๊ฐ ์กด์ฌํ๋ค.
SQS Temporary Queue Client๋ผ๋ ํด๋ผ์ด์ธํธ(์๋ฐ๋ก ๊ตฌํ)๋ฅผ ์ฌ์ฉํ๋ฉด Request-Response Systems๋ฅผ ๊ตฌํํ ์ ์๊ณ ๋ด๋ถ์ ์ผ๋ก ์ด ์์คํ ์ ๊ตฌํํ๋ ๊ฐ์์ ํ๋ค์ด ๋ง๋ค์ด์ง๋ค.
#70 SQS - FIFO Queue
Standard Queue๊ฐ ์ต์ ํ ๋ฒ ์ด์์ delivery๋ฅผ ๋ณด์ฅํ๋ ๊ฒ๊ณผ ๋ฌ๋ฆฌ, FIFO Queue๋ ์ ํํ ํ ๋ฒ์ delivery๋ฅผ ๋ณด์ฅํ๋ค.(by removing duplicates)
throughput์ด 300msg per second(batching์ ์ฌ์ฉํ๋ฉด 3000msg per second)๋ก standard์ ๋นํด ์ ๋ค.
#71 SNS - Simple Notification Service
SQS์ ๋ฌ๋ฆฌ pub/sub๋ชจ๋ธ์ ์ฌ์ฉํด์ topic์ ๋ฐํํ๋ฉด ์ฌ๋ฌ ๊ตฌ๋ ์๊ฐ ์ฝ๋ ๋ฐฉ์์ด๋ค. topic์ SNS๊ฐ ๋ฐํํ๋ ๋ฉ์์ง๋ผ๊ณ ๋ณด๋ฉด ๋๋ค.
์ต๋ 100,000๊ฐ์ ํ ํฝ๊ณผ 10,000,000๊ฐ์ ๊ตฌ๋ ์๋ฅผ ๊ฐ๋นํ ์ ์๋ค.
๊ตฌ๋ ์๋ SQS, HTTP/HTTPS๋ฅผ ์ฌ์ฉํ ์ ํ๋ฆฌ์ผ์ด์ , Lambda ๋ฑ์ด ๋ ์ ์๋ค.
AWS Service์ค์์๋ SNS๋ก ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ผ ์ ์๋ ์๋น์ค๋ค์ด ๋ค์ ์กด์ฌํ๋ค.
CloudWatch for alarm, Auto Scaling Group Notifications, S3 Bucket Events ๋ฑ
Message Filtering์ด ๊ฐ๋ฅํด์ ๊ตฌ๋ ์๋ณ๋ก ๋ฐ๊ณ ์ถ์ ๋ฉ์์ง๋ฅผ ์ ๋ณํด์ ๋ฐ์ ์ ์๋ค.(ex. ํน์ ๋ฌธ์๊ฐ ๋ค์ด๊ฐ ๋ฉ์์ง๋ง ๋ฐ๊ณ ์ถ์ ๊ฒฝ์ฐ)
#72 SNS + SQS: Fan Out
Push once in SNS, receive in all SQS queues that are subscribers : SNS์ ๋ฉ์์ง๋ฅผ ํธ์ํ๋ฉด SQS ๊ตฌ๋ ์๋ค์ด ๋ฉ์์ง๋ฅผ ๋ฐ๋ ํํ์ด๋ค.
๊ธฐ์กด SQS๋ง ์ฌ์ฉํ ๋๋ ํ๋์ ๋ฉ์์ง๋ฅผ ํ๋์ consumer(SQS)๊ฐ ๊ฐ์ ธ๊ฐ์ง๋ง, sns๋ฅผ ์ฌ์ฉํจ์ผ๋ก์จ ํ๋์ ๋ฉ์์ง๋ฅผ ์ฌ๋ฌ ๊ตฌ๋ ์๋ค์ด ์๋นํ๋ ํํ๊ฐ ๊ฐ๋ฅํด์ก๋ค.
๋ง์ฐฌ๊ฐ์ง๋ก S3 Event(ex. object creation)๋ฅผ ์ฌ๋ฌ SQS์ ๋ณด๋ด๊ณ ์ถ๋ค๋ฉด fan out ํจํด์ ์ฌ์ฉํด, SNS์์ ๋ฉ์์ง๋ฅผ ๋ฐ๊ณ SNS์์ ์ฌ๋ฌ ๊ตฌ๋ ์์๊ฒ ๋ณด๋ผ ์ ์๋ค.
#73 SNS โ FIFO Topic
SNS์ญ์ SQS์ ๋ง์ฐฌ๊ฐ์ง๋ก Standardํํ์ FIFOํํ๊ฐ ์๊ณ , ๊ฑฐ์ ๋น์ทํ ํน์ง์ ์ง๋๋ค.
๋ค๋ง FIFOํํ์ SNS๋ FIFOํํ์ SQS๋ง ๊ตฌ๋ ์๋ก ๊ฐ์ง ์ ์๋ค. ์๋ํ๋ฉด FIFO Queue๋ฐฉ์์ผ๋ก ์ ๋ฌ๋๋ ๋ฉ์์ง๋ฅผ FIFO๋ก ์ฒ๋ฆฌํ๋ ค๋ฉด FIFOํํ์ SQS๊ฐ ์ฌ์ฉ๋ ์ ๋ฐ์ ์๊ธฐ ๋๋ฌธ์ด๋ค.
#74 Kinesis
Makes it easy to collect, process, and analyze streaming data in real-time : ๋ฐ์ดํฐ ์์ง, ์ฒ๋ฆฌ, ๋ถ์์ ์ค์๊ฐ์ผ๋ก ๊ฐ๋ฅํ๊ฒ ํด์ฃผ๋ ์๋น์ค
#75 Kinesis Data Streams
capture, process, and store data streams : ๋ฐ์ดํฐ ์บก์ณ, ์ฒ๋ฆฌ, ์ ์ฅ์ ์ง์ํ๋ ์๋น์ค
Kinesis Data Streams์๋ Record๋ฅผ ๋ฐ๋ shard๊ฐ ์กด์ฌํ๊ณ , shard๋ค์ ๋ชจ์๋์ Stream์ด ์๋ค.
Producer๊ฐ ๋ง๋๋ Record๋ 1. Partition key, 2. Data Blob์ผ๋ก ๊ตฌ์ฑ๋๋ค.(Kinesis Data Streams์ ์ ๋ฌ)
Kinesis Data Streams๊ฐ ๋ง๋๋ Record๋ 1. Partition key, 2. Data Blob 3. Sequence no์ผ๋ก ๊ตฌ์ฑ๋๋ค.(Consumers์๊ฒ ์ ๋ฌ)
throughput์ 1MB/sec ๋๋ 1000msg/sec์ด ๊ฐ๋ฅํ๊ณ , ์ด throughput์ per shard์ด๊ธฐ ๋๋ฌธ์ 30๊ฐ์ shard๋ 30MB/sec์ throughput์ ๊ฐ์ง๋ค.
Retention between 1 day (default) to 365 days : ๋ฐ์ดํฐ๊ฐ Kinesis Data Streams์ ์ต์ 1์ผ ์ด์ ์์ด๊ธฐ ๋๋ฌธ์ ์์ธ ๋ฐ์ดํฐ๋ฅผ ๋์์ผ๋ก replay data๊ฐ ๊ฐ๋ฅํ๋ค.
Data that shares the same partition goes to the same shard (ordering) : Partition key๋ฅผ ์ด์ฉํด ์์๋ณด์ฅ์ด ํ์ํ ๋ฐ์ดํฐ๋ ์์๋ณด์ฅ ์ง์
Once data is inserted in Kinesis, it canโt be deleted (immutability) : ๋ฐ์ดํฐ๊ฐ ํ ๋ฒ ์์ด๋ฉด retention๊ธฐ๊ฐ ๋์ ์ง์ธ ์ ์๋ค.
Real-time : ~200ms์ ์ค์๊ฐ ์ฒ๋ฆฌ๊ฐ ๊ฐ๋ฅํ๋ค.
Destination
SDK๋ฅผ ์ฌ์ฉํ ์ ํ๋ฆฌ์ผ์ด์ (real time์ฒ๋ฆฌ๊ฐ ๊ฐ๋ฅํ๊ธฐ ๋๋ฌธ)
Lambda
Kinesis Data Firehose
Kinesis Data Analytics
Shard๋ฅผ ์ฌ์ฉ์๊ฐ ์ง์ ํ์ฅํ๊ฑฐ๋ ์ถ์ํด์ผ ํ๊ธฐ ๋๋ฌธ์ fully managed service๋ ์๋๋ค.
#76 Kinesis Data Firehose
Fully Managed Service, no administration, automatic scaling, serverless : Kinesis Data Streams์ ๋ฌ๋ฆฌ fully managed service์ด๋ค.
๋ฐฐ์น ์ฒ๋ฆฌ๋ฅผ ํ๊ธฐ ๋๋ฌธ์ ์ฒ๋ฆฌ์ ์๊ฐ์ด ๊ฑธ๋ฆฐ๋ค. ๋ฐ๋ผ์ Near Real Time์ด๋ผ๊ณ ๋ถ๋ฅธ๋ค.
60 seconds latency minimum for non full batches
Or minimum 32 MB of data at a time
Kinesis Data Streams์ ๋ฌ๋ฆฌ ๋ฐ์ดํฐ๋ฅผ ๊ฐ๊ณตํ ํ batch ์ฒ๋ฆฌํด์ consumers์๊ฒ ์ ๋ฌํ๋ค.(์ด ๊ฐ๊ณต ๊ณผ์ ๊ณผ, batch์ฒ๋ฆฌ ๊ธฐ๊ฐ์ด ์๊ธฐ ๋๋ฌธ์ real time์ผ๋ก ์ฌ์ฉ์ด ๋ถ๊ฐ๋ฅํ๋ค.)
Destination
datadog๊ฐ์ ๋ชจ๋ํฐ๋ง 3rd-party destination
S3, Redshift(ํํ๋ฐ์ดํธ ์ด์์ ๋๊ท๋ชจ ๋ฐ์ดํฐ ์ ์ฅ์ ๋ฐ ๋ถ์ ์๋น์ค), ElasticSearch์ ๊ฐ์ aws destination
http endpoint
๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ์ง ์์ผ๋ฏ๋ก Kinesis Data Streams์ ๋ฌ๋ฆฌ data replay๊ฐ ๋ถ๊ฐ๋ฅํ๋ค.
#77 Kinesis Data Analytics
Kinesis Data Streams๋๋ Kinesis Data Firehose๋ก๋ถํฐ ์ ๋ฌ๋ฐ์ ๋ฐ์ดํฐ๋ฅผ ๋ฐํ์ผ๋ก SQL์ ์คํํ ์ ์๋ ์๋น์ค
Fully Managed Service์ด๋ค.
Real-time์ด๊ธฐ ๋๋ฌธ์ ์ค์๊ฐ ๋ฐ์ดํฐ ๋ถ์์ด ๊ฐ๋ฅํ๋ค.
Kinesis Data Streams๋๋ Kinesis Data Firehose๋ฅผ source๋ก ํ๊ณ ์ด ๋ฐ์ดํฐ๋ฅผ ๋์์ผ๋ก SQL์ ์คํํ๊ณ ๋ค์ Kinesis Data Streams๋๋ Kinesis Data Firehose์ ์ ๋ฌํ๋ ๊ตฌ์กฐ์ด๋ค.
ํฌ๊ฒ ๋ ๊ฐ์ง ๊ตฌ์กฐ๋ฅผ ์ฌ์ฉํ๋ค.
SQL์คํ ํ ๋ค์ Kinesis Data Streams์ ์ ๋ฌํด Kinesis Data Streams๊ฐ APP์ด๋ Lambda๋ก ์ ๋ฌํ๋ ๋ฐฉ์
SQL์คํ ํ ๋ค์ Kinesis Data Firehose์ ์ ๋ฌํด Kinesis Data Firehose๊ฐ S3๋ Redshift๊ฐ์ ์ ์ฅ์๋ก ์ ๋ฌํด ์ ์ฅํ๋ ๋ฐฉ์
#78 Ordering data into Kinesis
Partition key๋ฅผ kinesis์ ๋ณด๋ด๋ฉด hashํด์ ์๋ง์ shard๋ก ๋ฐฐ์นํ๋ค.
The same key will always go to the same shard : ์๋ฅผ ๋ค์ด 1๋ฒ partition key๊ฐ 1๋ฒ ์ค๋์ ๋ฐฐ์น๋๊ณ , 2๋ฒ partition key๊ฐ 2๋ฒ ์ค๋์ ๋ฐฐ์น๋์๋ค๋ฉด, ๊ทธ ์ดํ์๋ 1๋ฒ partition key๋ 1๋ฒ ์ค๋์ ๋ฐฐ์น๋๊ณ , 2๋ฒ partition key๋ 2๋ฒ ์ค๋์ ๋ฐฐ์น๋๋ ์์คํ ์ด๋ค.
#79 Ordering data into SQS
kinesis์ ์ ๋ ฌ ๋งค์ปค๋์ฆ์ด ๋ค๋ฅด๋ค.
For SQS FIFO, if you donโt use a Group ID, messages are consumed in the order they are sent, with only one consumer : sqs๋ consumer๊ฐ ๋ฉ์์ง๋ฅผ consumeํ ํ ๊ทธ ๋ฉ์์ง๋ฅผ ์ง์ฐ๋ ๊ฒ์ด ์ผ๋ฐ์ ์ด๊ณ , ํ consumer์ ์ํด์ ์ด ์์ ์ด ์ด๋ฃจ์ด์ง๋ค. group id๊ฐ ์๋ค๋ฉด ๋ฉ์์ง๋ ๋ณด๋ธ ์์๋๋ก ์ฝํ์ง ๊ฒ์ด๋ค.
413p ์ฐธ๊ณ
#80 SQS VS SNS VS KINESIS
SQS
Data is deleted after being consumed
No need to provision throughput
SNS
Data is not persisted (lost if not delivered) : ๋ฐ์ดํฐ๋ ์ด๋ค ์ด์ ๋ก ์ ๋ฌ๋์ง ๋ชปํ์ ๊ฒฝ์ฐ ์ ์ฅ๋์ง ์๊ธฐ ๋๋ฌธ์ ๋ฐ์ดํฐ๊ฐ ์ฌ๋ผ์ง ์ ์๋ค.
No need to provision throughput
Integrates with SQS for fan- out architecture pattern : ํ ๋ฉ์์ง๋ฅผ ์ฌ๋ฌ consumer๊ฐ ์๋นํ๋ ๊ฒ์ด ๊ฐ๋ฅํจ.
KINESIS
Throughput
Standard: pull data - 2 MB per shard
Enhanced-fan out: push data - 2 MB per shard per consumer
Possibility to replay data : Kinesis Data Streams์ ๊ฒฝ์ฐ ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋๋ฏ๋ก ์ ์ฅ๋ ๋ฐ์ดํฐ๋ฅผ ๋์์ผ๋ก ์์ ๊ฐ๋ฅ
#81 Amazon MQ
Amazon MQ = managed Apache ActiveMQ
on-premise mq๊ฐ MQTT, AMQP๊ฐ์ ๊ธฐ์กด์ ์กด์ฌํ๋ ํ๋กํ ์ฝ์ ์ฌ์ฉํ๊ณ ์๋๋ฐ ํด๋ผ์ฐ๋๋ก ์ด์ ํ๊ณ ์ถ๋ค๋ฉด AMAZON MQ๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค.(SNS, SQS๋ก์ ์ด์ ์ด ์๋๋ผ๋ ์ ์ฃผ์)
High Availability๋ฅผ ์ง์ํ๋ค.
#82 Docker
Docker is a software development platform to deploy apps : ์ํํธ์จ์ด ๋ฐฐํฌ๋ฅผ ์ํ ํ๋ซํผ, ์ ํ๋ฆฌ์ผ์ด์ ์ ์ปจํ ์ด๋ ์์ ๋ด์ ์ ์๊ฒ ํด์ฃผ๋ ํ๋ซํผ
#83 Docker vs Virtual Machines
Docker is โsort ofโ a virtualization technology, but not exactly : ๋์ปค๋ ์ผ์ข ์ ๊ฐ์ํ ๊ธฐ์ ์ด์ง๋ง, ๊ฐ์ํ ๊ทธ ์์ฒด๋ ์๋๋ค.
421p. Resources are shared with the host => many containers on one server : ํ ์๋ฒ์ ์ฌ๋ฌ ์ปจํ ์ด๋๊ฐ ์ฌ๋ผ๊ฐ ์๋ค๋ฉด, ์ ์ฅ์๋ ๋คํธ์ํฌ๋ฅผ ๋์ปค ์ปจํ ์ด๋ ๊ฐ์, ํน์ ํธ์คํธ์ ๊ณต์ ํ ์ ์๋ค.
๋ฐ๋ฉด ๊ฐ๋ณ Virtual Machine(Guest OS)์ ํธ์คํธ OS์ ์์์ ๊ณต์ ํ์ง ์๋๋ค.
#84 ECS
2๊ฐ์ launch type
ec2 launch type : ์ง์ ec2๋ฅผ ํ์ฅํ๊ฑฐ๋ ์ถ์์ํจ๋ค.
fargate : ec2 ๊ด์ฌ ํ์ ์์ด serverless๋ก ๋์ํ๋ค.
EC2 launch type : ECS Cluster ๋ด๋ถ์ ์ฌ๋ฌ ๊ฐ์ Container Instance๊ฐ ์๊ณ , ๊ฐ๋ณ Container Instance ๋ด๋ถ์๋ ECS Agent๊ฐ ์๊ณ , ์ด ECS Agent๊ฐ Container Instance ๋ด๋ถ์ task๋ค์ ์ธ๋ถ์ ๋ ธ์ถ์ํค๋ ์ญํ ์ ํ๋ค. a task๋ ํ ๊ฐ์ ์คํ ์ค์ธ ๋์ปค ์ปจํ ์ด๋๋ผ๊ณ ์๊ฐํ๋ฉด ํธํ๋ค.
Fargate : ECS Cluster ๋ด๋ถ์์, ํ ๊ฐ์ task์ ํ ๊ฐ์ ENI๊ฐ ๋ถ๋๋ค. ๋ฐ๋ผ์ ๋ง์ task๊ฐ ์กด์ฌํ๋ค๋ฉด ๊ทธ ๋งํผ์ ip๋ฅผ ๊ฐ๋นํด์ผ ํ๋ฏ๋ก ๋คํธ์ํฌ๊ฐ ์ถฉ๋ถํ ์ปค์ผ ํ๋ค.
EC2 Instance Profile : ECS agent๊ฐ ๊ฐ์ง๋ ๊ถํ์ด๋ค. 427p ์ฐธ๊ณ
ECS Task Role : ๊ฐ๋ณ ํ์คํฌ๊ฐ ๊ฐ์ง๋ ๊ถํ(role)์ด๋ค. ์ด role์ ํด๋นํ๋ ๊ถํ๋ง ๊ฐ์ง๊ณ ๋ค๋ฅธ aws ์๋น์ค์ ์ ๊ทผํ๋ค.
ECS์์ CloudWatch์ ์ํ Scaling์์ ์ ํ ๋, ๋ ๋จ๊ณ์ Scaling์ด ์ด๋ฃจ์ด์ง๋ค.
task์ ๊ฐ์๋ฅผ ๋๋ ค ์๋น์ค ์ปจํ ์ด๋์ ์๋ฅผ ๋๋ฆฌ๋ ์์ : ์ปจํ ์ด๋๊ฐ ์ธ์คํด์ค์ capacity๋ฅผ ์ด๊ณผํด์ ์์ฑ๋ ์๋ ์๋ค.
Scale ECS Capacity Providers : ๋ฐ๋ผ์ ์ธ์คํด์ค๋ฅผ ์ํ์ ์ผ๋ก ๋๋ฆฌ๋ ์์ ์ ECS Capacity Providers๊ฐ ๋์์ค๋ค.
์ด ์์ ์ด ๊ฐ๋ฅํ๋ ค๋ฉด fargate๋ฅผ ์ฌ์ฉํ์ง ์๋ ec2 launch type์ด์ด์ผ ํ๊ณ , ๋น์ฐํ๊ฒ๋ auto scaling group์ ์ฌ์ฉํด์ผ ํ๋ค.
ECS Rolling Update
์ปจํ ์ด๋ ์ ๋ฐ์ดํธ๋ฅผ ์คํํ๊ธฐ ์ํด ์ฌ์ฉํ ์ ์๋ ํ๋์ ๋ฐฉ๋ฒ์ผ๋ก, ํ์คํฌ๋ฅผ ์ ๋ฐ์ดํธํ๋ ๋ฐฉ๋ฒ์ด๋ผ๊ณ ์๊ฐํ๋ฉด ํธํ๋ค.
์ปจํ ์ด๋ ์ ๋ฐ์ดํธ๋ฅผ ์ํด์๋ ์ปจํ ์ด๋๊ฐ remove๋๊ณ , ์๋ก์ด ์ปจํ ์ด๋๋ก ์คํ๋์ด์ผ ํ๋ค.
์ด๊ธฐ ํ์คํฌ ์ ๊ธฐ์ค์ผ๋ก, ํผ์ผํธ ๋จ์๋ก ํ์คํฌ์ ์คํ ๊ฐ์๋ฅผ ์ ํ ์ ์๋ค.
#85 EKS
ECS์ ๋ง์ฐฌ๊ฐ์ง๋ก ์๋์ launch type์ ์ง์ํ๋ค.
ec2 launch type : ์ง์ ec2๋ฅผ ํ์ฅํ๊ฑฐ๋ ์ถ์์ํจ๋ค.
fargate : ec2 ๊ด์ฌ ํ์ ์์ด serverless๋ก ๋์ํ๋ค.
์์ธํ ๊ตฌ์กฐ 441p ์ฐธ๊ณ
ECS์์๋ task๋ผ๊ณ ๋ถ๋ฅด๋ ์ปจํ ์ด๋๊ฐ, EKS์์๋ pod๋ผ๊ณ ๋ถ๋ฆฌ๊ณ , ํ ๊ฐ์ EC2 Instance๋ฅผ EKS node๋ผ๊ณ ๋ถ๋ฅธ๋ค.
#86 Lambda
Virtual functions โ no servers to manage! : ์์ฒญ ํ์ ๋๋ GB-seconds๋ก ์๊ธ์ด ๊ณ์ฐ๋๊ธฐ ๋๋ฌธ์ ์์ฒญ ํ์๋ฅผ ์์ํ ์ ์๊ฑฐ๋, ์์ฒญ ํ์๊ฐ ์ ์ ๋ ํจ๊ณผ์ ์ด๋ค.
#87 Lambda@Edge
Lambda๋ฅผ CloudFront์ฒ๋ผ ์ธ ์ ์๊ฒ ํด์ฃผ๋ ์๋น์ค
#88 DynamoDB
Fully managed, highly available with replication across multiple AZs : ์๋ฒ ๋ฆฌ์ค NoSQL ๋ฐ์ดํฐ๋ฒ ์ด์ค with multi AZ
Provisioned Mode(default)
Pay for provisioned Read Capacity Units (RCU) & Write Capacity Units (WCU) : ๋ฏธ๋ฆฌ capacity๋ฅผ ์ ํด์ ์์๋ ํธ๋ํฝ์ ๋์ํ๋ค.
On-Demand Mode
Read/writes automatically scale up/down with your workloads : ํธ๋ํฝ์ ์์ํ ์ ์์ ๋ ์๋์ผ๋ก scaleํด์ฃผ๋ ๋ชจ๋, ๋น์ฐํ default๋ณด๋ค ๋ ๋น์ธ๋ค.
#89 DynamoDB Accelerator (DAX)
Fully-managed, highly available, seamless in memory cache for DynamoDB : DynamoDB์ ์ฉ ์บ์
DynamoDB Accelerator(DAX) vs ElastiCache
DynamoDB์ **DynamoDB Accelerator(DAX)**๋ฅผ ์ฌ์ฉํ๋ฉด DynamoDB์ ๊ฐ๋ณ object, ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ์บ์ํ ์ ์๋ค.
ElastiCache๋ ๊ฐ์ด ์ฌ์ฉ ๊ฐ๋ฅํ๋ฐ, ElastiCache๋ Application์ด DynamoDB ๋๋ DynamoDB Accelerator(DAX)์ผ๋ก๋ถํฐ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌ๋ฐ๊ณ ์ด ๋ฐ์ดํฐ๋ฅผ ๊ฐ๊ณตํ ํ ์ด ๋ฐ์ดํฐ๋ฅผ ์บ์ํ๊ณ ์ถ์ ๋ ์ฌ์ฉํ๋ค. ์ด๋ฅผ Store Aggregation Result๋ผ๊ณ ๋ถ๋ฅธ๋ค.
์ ์ผ์ด์ค์์ ๋์ ์ฐจ์ด์ ์ ๋ฐ์ดํฐ ๊ฐ๊ณต์ฌ๋ถ๋ผ๊ณ ๋ณผ ์ ์๋ค.
#90 DynamoDB Streams
Ordered stream of item-level modifications (create/update/delete) in a table
DynamoDB์ object๋ฅผ create/update/deleteํ ๋ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํด DynamoDB Streams๊ฐ ๋ฐ์ํ๊ฒ ํ ์ ์๋ค.
๊ตฌ์กฐ 464p ์ฐธ๊ณ
#91 DynamoDB Features
DynamoDB Global Tables
active-active replication์ multi region๋ฐฉ์์ ์ง์ํ๋ค.(region์ 2๊ฐ ์ด์ ๊ฐ๋ฅ)
Applications can READ and WRITE to the table in any region : ์๋ฌด๋ฐ๋ READ, WRITEํด๋ active-active replication์ด๊ธฐ ๋๋ฌธ์ ์๊ด ์๊ณ , multi region์ด๊ธฐ ๋๋ฌธ์ low latency๋ผ๋ ์ฅ์ ์ด ์๋ค.
Must enable DynamoDB Streams as a pre-requisite : DynamoDB Streams์ ํ์์ ์ผ๋ก ํ์ฑํํด์ผ ํจ
Time To Live
expire time์ ์ง์ ํด์ 1.item์ด ๋๋ฌด ๋ง์์ง๊ฑฐ๋ 2.์ธ์ ๊ด๋ฆฌ๋ฅผ ํด์ผํ ๊ฒฝ์ฐ, item์ ์ญ์ ํ๋ ์ฉ๋๋ก ์ฌ์ฉํ ์ ์๋ค.
Indexes
DynamoDB์์ ์ฟผ๋ฆฌ๋ Primary key๋ฅผ ๋์์ผ๋ก๋ง ๊ฐ๋ฅํ๋ฐ ์ธ๋ฑ์ค๋ฅผ ์ค์ ํ๋ฉด attributes๋ฅผ ๋์์ผ๋ก ์ฟผ๋ฆฌ๊ฐ ๊ฐ๋ฅํ๋ค.
Transactions
A Transaction is written to both tables, or none! : rds๋ก ์๋ฅผ ๋ค๋ฉด ์ธ๋ํค๋ฅผ ์ค์ ํ์ ๋ ์์ ํ ์ด๋ธ๊ณผ ๋ถ๋ชจ ํ ์ด๋ธ์ ๋ฐ์ดํฐ๋ฅผ ๋๊ธฐํํ๊ธฐ ์ํด์ ๋ถ๋ชจ ํ ์ด๋ธ์ ์ธ๋ํค update๊ฐ cascade๋๋ ๊ฒฝ์ฐ๊ฐ ์๋ค. ์ด๋ฅผ DynamoDB์์๋ transaction์ด๋ผ๋ ๊ฐ๋ ์ผ๋ก ๋์์ ์ฐ๊ฑฐ๋ ๋์์ ์ฐ์ง ์๋ ๋ฐฉ์์ผ๋ก ๊ตฌํํ๋ค๊ณ ๋ณด๋ฉด ๋๋ค.(๋ฐ์ดํฐ๋ฅผ ์ฐธ์กฐํ๋ ๊ฒฝ์ฐ ๋์ผ ๋ฐ์ดํฐ ๋ณด์ฅ)
#92 AWS API Gateway
Edge-Optimized(default) mode: For global clients
Requests are routed through the CloudFront Edge locations (improves latency) : ์์ฒญ์ ๋ฐ์ ๋ CloudFront๋ฅผ ์ฌ์ฉํด latency๋ฅผ ์ค์ด๊ณ , ์ค์ ๋ก๋ ํ region์๋ง api gateway๋ฅผ ๋๋ ๋ฐฉ์์ด๋ค.
Regional mode
Edge-Optimized(default)์ ๋น์ทํ๊ฒ CloudFront๋ฅผ ์ฌ์ฉํ๋ ์ ๊น์ง ๊ฐ์๋ฐ, ์ง์ญ ํ์ ์ผ๋ก ๋์ํ๋ฏ๋ก ์บ์๋ฅผ ๋ค๋ฃฐ ๋ ๋์ฑ ์ธ๋ถ์ ์ผ๋ก ๋ค๋ฃฐ ์ ์๋ค๊ณ ํ๋ค.
Private mode
Can only be accessed from your VPC : private VPC์์ ENI๋ฅผ ์ฌ์ฉํด์ ์ ๊ทผํ๋ค.
#93 API Gateway โ Security
IAM Permissions
Sig v4๋ผ๋ ์ผ์ข ์ ์๋ช ํค๋ฅผ ์์ฒญ ํค๋ ๋๋ ์ฟผ๋ฆฌ ๋ฌธ์์ด์ ์ถ๊ฐํ๋ค.
์ด ์๋ช ํค๋ฅผ API Gateway์ ๋ณด๋ด๋ฉด API Gateway๊ฐ IAM service์๊ฒ IAM policy check์ ์์ฒญํ๋ค.
์ธ์ฆ๊ณผ ์ธ๊ฐ ๋ ๋ค ๊ฐ๋ฅ
Lambda Authorizer (formerly Custom Authorizers)
Token์ ์์ฒญ ํค๋์ ๋ด์ API Gateway์ ๋ณด๋ด๋ฉด API Gateway๊ฐ Lambda Authorizer์๊ฒ token check์ ์์ฒญํ๋ค.
ํ ํฐ์ด ์ ํจํ๋ค๋ฉด IAM Permission๊ณผ ๋์ผํ๊ฒ IAM policy๋ฅผ ๋ฆฌํดํ๋ค.
IAM Permissions์ Sig v4๋ผ๋ AWS์ ์ฉ ์๋น์ค๊ฐ ์๋๋ผ OAuth๊ฐ์ third party ์ธ์ฆํ์ ์ ์ง์ํ๋ ๊ฒ์ด ์ฃผ์ ๊ธฐ๋ฅ์ด๋ค.
์ธ์ฆ๊ณผ ์ธ๊ฐ ๋ ๋ค ๊ฐ๋ฅ
Cognito User Pools
Cognito fully manages user lifecycle : serverless ์ ์ ์ธ์ฆ ๋ฐ์ดํฐ๋ฒ ์ด์ค(๋ชจ๋ฐ์ผ ํนํ)
Cognito User Pools์ ์ธ์ฆ ์์ฒญ์ ํ๊ณ ํ ํฐ์ ๋ฐ๋๋ค.
API Gateway์ ํ ํฐ๊ณผ ์์ฒญ์ ํจ๊ป ๋ณด๋ธ๋ค.
API Gateway๋ Cognito User Pools์ ์ด ํ ํฐ์ด ์๋ ์ง ํ์ธํ๋ค.
IAM Permissions, Lambda Authorizer์ ๋ค๋ฅธ ์ ์ ๋ฐ๋ก API Gateway์ ์์ฒญํ๋ ๊ฒ์ด ์๋๋ผ, ๊ทธ ์ด์ ์ Cognito User Pools์ผ๋ก๋ถํฐ ๋ฐ๊ธ๋ฐ์ ํ ํฐ์ด ํ์ํ๊ธฐ ๋๋ฌธ์ Cognito User Pools์ ๋จผ์ ์ธ์ฆ์์ฒญ์ ๋ณด๋ด์ผ ํ๋ค.
์ธ์ฆ๋ง ๊ฐ๋ฅ
#94 AWS Cognito
Cognito User Pools
Sign in functionality for app users : ๋ชจ๋ฐ์ผ ์ฑ์ ์ํ ์ธ์ฆ ์ ๊ณต
Sends back a JSON Web Tokens (JWT) : (๋ชจ๋ฐ์ผ App์ ์ํด์) ๋ก๊ทธ์ธ ์ jwt๋ฅผ ์ ๊ณตํด์ค๋ค.(์ฑ์ ์ฟ ํค ์ธ์ ๊ด๋ฆฌ๊ฐ ํ๋ค๋ค๊ณ ์๊ณ ์์ - ํ์ต ํ์)
Integrate with API Gateway์ ํจ๊ป ๋์
Cognito Identity Pools (Federated Identity)
AWS resources์ ์ง์ ์ ๊ทผํ๊ธฐ ์ํ AWS credentials์ ์ ๊ณตํ๋ค.
identity provider๋ก Cognito User Pools๋ฅผ ์ฌ์ฉํ๋ค.
ํด๋ผ์ด์ธํธ๊ฐ identity provider์ ๋ก๊ทธ์ธ ์์ฒญ์ ๋ณด๋ธ๋ค.
identity provider๋ ์๋ต์ผ๋ก ํ ํฐ์ ๋ฐํํ๋ค.
ํ ํฐ์ Federated Identity๋ก ๋ณด๋ธ๋ค.
Federated Identity๋ identity provider์๊ฒ ํ ํฐ์ ๊ฒ์ฆํ๋ค.
ํ ํฐ์ด ์ ํจํ๋ค๋ฉด STS์์ credential๋ฅผ ํ๋ํด temp credential์ client์๊ฒ ๋ฆฌํดํ๋ค.
client๋ temp credential์ ์ด์ฉํด์ aws service์ ์ง์ ์ ๊ทผ์ด ๊ฐ๋ฅํ๋ค.
์ฌ์ฉ ์ฌ๋ก : ํ์ด์ค๋ถ ๋ก๊ทธ์ธ์ผ๋ก s3์ ์ง์ ์ฐ๊ธฐ ๊ถํ์ ์ป๊ณ ์ถ์ ๋
Cognito Sync == Appsync
Requires Federated Identity Pool in Cognito (not User Pool) : Federated Identity Pool์ด ์๊ตฌ์กฐ๊ฑด์ด๋ค.
Store preferences, configuration, state of app : app์ ์ํ, ์ค์ ์ ์ ์ฅํ๋ค.
Cross device synchronization : ๋ฉํฐ ๋๋ฐ์ด์ค ๊ฐ ์ฑํฌ ๊ฐ๋ฅ
Offline capability : ์คํ๋ผ์ธ ์ํ์ฌ๋ ์จ๋ผ์ธ๋๋ฉด ์ฑํฌ ๊ฐ๋ฅ
Store data in datasets : dataset์ data๋ฅผ ์ ์ฅํ๊ณ dataset์ ์ต๋ 20๊ฐ๊น์ง ๊ฐ๋ฅ
#95 AWS SAM - Serverless Application Model
Framework for developing and deploying serverless application : ์ด๋ฐ ํ๋ ์์ํฌ๋ ์๋ค๋ ๊ฒ๋ง ์์๋๊ธฐ
#96 AWS Database Types
RDBMS : RDS, Aurora โ ์์ ๋ก์ด join
NoSQL : DynamoDB(JSON), ElasticCache(Key, Value), Neptune(graphs) - ๋ถ์์ ํ ์ฟผ๋ฆฌ, ์กฐ์ธ
Object Store : S3, Glacier - ํ์ผ ์ ์ฅ
Data Warehouse : Redshift(OLAP), Athena - ๋ฐ์ดํฐ ๋ถ์์ ์ํ ๋ฐ์ดํฐ ์จ์ดํ์ฐ์ค
Search : ElasticSearch (JSON)
Graph : Neptune โ displays relationships between data : ๋ฐ์ดํฐ ๊ฐ ๊ด๊ณ๋ฅผ ๋ณด์ฌ์ฃผ๋ ๊ทธ๋ํ ํ์
#97 RDS Features
Managed PostgreSQL / MySQL / MariaDB / Oracle / SQL Server
(์ฐธ๊ณ ๋ก ํ์ฌ RDS ์์ฑ ํ์ด์ง์์ Amazon Aurora๊ฐ managed db์ค์์ ์ ์ผ ๋จผ์ ์ ํ๋๋ ๊ธฐ๋ณธ์ต์ ์ด๋ค. ์ด๊ฒ๋ง ๋ด๋ ์๋ง์กด์ด aurora๋ฅผ ์ฅ๋ คํ๊ณ ์๋ค๋ ๊ฒ์ ์ ์ ์๋ค. (2022-01-19))
DB instance & EBS Volume type and size๋ฅผ ์ฌ์ ์ provisionํด์ผ ํ๋ค.
Read Replicas & Multi AZ ์ง์
OLTP - Online Transaction Processing(ํธ๋์ญ์ ์ฒ๋ฆฌ ๊ฐ๋ฅ)
๋์ ๋ฐฉ์
small downtime when failover happens : failover๊ฐ ๋ฐ์ํ ๋ ์ฝ๊ฐ์ ๋ค์ด ํ์์ด ์๋ค.(์ค๋ก๋ผ๋ 30์ด ์ด๋ด)
์ฆ maintenance happens, scaling in read replicas / ec2 instance / restore EBS์ด ๋ฐ์ํ ๋ ๋ค์ด ํ์์ด ์กด์ฌํ๋ค๋ ๊ฒ์ด๋ค.
Performance: depends on EC2 instance type, EBS volume type, ability to add Read Replicas. Storage auto-scaling & manual scaling of instance : ์ธ์คํด์ค ํ์ , ๋ณผ๋ฅจ ํ์ ์ ๋ฐ๋ผ ์ฑ๋ฅ์ด ๋ค๋ฅด๊ณ , read replica๋ฅผ ์ถ๊ฐํด ์ฝ๊ธฐ ์ฑ๋ฅ์ ํฅ์์ํฌ ์ ์๋ค๋ ์ , ์ ์ฅ์ ์คํ -์ค์ผ์ผ๋ง & manual ์ค์ผ์ผ๋ง์ด ๊ฐ๋ฅํ๋ค๋ ์ ์ผ๋ก ์ธํด ์ฑ๋ฅ์ ์ฒ์ฐจ๋ง๋ณ์ด๋ค.
Backups are automatically enabled in RDS : ์๋ ๋ฐฑ์ , ๋ฐฑ์ ๋ณธ default ์ ์ง ๊ธฐ๊ฐ 7์ผ(์ต๋ 35์ผ), ํธ๋์ญ์ ๋ก๊ทธ๊ฐ 5๋ถ๋ง๋ค ๋ฐฑ์ ๋จ
DB Snapshot : ์ ์ ๊ฐ ์ง์ ์ค๋ ์ท ์บก์ฒํ๋ ๊ฒ
Maximum Storage Threshold : rds์ storage๋ auto-scaling๋์ง๋ง auto-scaling์ ์ต๋์น๋ฅผ ํ์์ ์ผ๋ก ์ ํด์ฃผ์ด์ผ ํ๋ค.
Read Replica๋ ์ต๋ 5๊ฐ(multi AZ or multi Region)
Replication์ ๋น๋๊ธฐ ์์ ์ด๋ค. ์ฆ ๋ง์คํฐ ์ธ์คํด์ค์๋ง ์ฐ๊ณ ์ฝ๊ธฐ๋ง ๊ฐ๋ฅํ read replica์ ๋น๋๊ธฐ์ ์ผ๋ก ๋ณต์ ํ๋ ๋ฐฉ๋ฒ์ ํํ๋ค.
For RDS Read Replicas within the same region, you donโt pay that fee : same region์ ๊ทธ ๋๊ฐ๋ก ๋์ ์ง๋ถํ์ง ์๋๋ค, cross region read replication์ญ์ ๊ฐ๋ฅํ์ง๋ง cost๊ฐ ๋ ๋ค.
RDS Multi AZ๋ ๋๊ธฐ ์์ ์ด๋ค. - Zero downtime operation, no cost, ๊ฐ์ฉ์ฑ ์ฆ๊ฐ(Increase availability), scaling์ด ์๋ Disaster Recovery์ ์ํด ์ฌ์ฉ
173p Multi-AZ ๋์ ๊ณผ์ ํํ ์ฐธ๊ณ
Security
No SSH access : ssh ์ ์ ์ ๋๋ค. ํํ ๊ธฐ์ต.
If the master is not encrypted, the read replicas cannot be encrypted : ๋ง์คํฐ ์ธ์คํด์ค๊ฐ encrypt๋์ง ์์ผ๋ฉด replica๋ encrypt๋์ง ์๋๋ค.
Possibility to encrypt the master & read replicas with AWS KMS - AES-256 encryption : ์ ์ฅ๋ ๋ฐ์ดํฐ ์ํธํ๋ฅผ at rest encryption์ด๋ผ๊ณ ๋ถ๋ฅธ๋ค.
In-flight encryption : SSLํต์ ์ ํ๊ธฐ ์ํด์๋ MySQL๊ฐ์ DB์ GRANT USAGE ON . TO 'mysqluser'@'%' REQUIRE SSL; ๊ฐ์ด ์ค์ ์ ํด์ค์ผ ํ๋ค.
Network Security : security group can communicate with RDS (ec2์ ๋ณด์ ๊ทธ๋ฃน๊ณผ ๊ฐ์ ๊ฐ๋ )
RDS์ IAM Authentication์ ์ ์ฉ์ํค๋ฉด ec2์์ iam role์ด iam์ผ๋ก๋ถํฐ ํ ํฐ์ ๋ฐ์์ rds์ ssl๋ก ์ ์ํ๋ค.
#98 Amazon Aurora Features
Define EC2 instance type for aurora instances
Data is held in 6 replicas, across 3 AZ
5x performance improvement over MySQL on RDS, over 3x the performance of Postgres on RDS : ์ฑ๋ฅ์ด ์ข๋ค.
Aurora storage automatically grows in increments of 10GB, up to 128 TB : rds์ ๋ง์ฐฌ๊ฐ์ง๋ก ์คํ ์ค์ผ์ผ๋ง์ ์ง์ํ๋ค.
Aurora can have 15 replicas while MySQL has 5, and the replication process is faster
Failover in Aurora is instantaneous. Itโs HA (High Availability) native.
Support for Cross Region Replication
Shared Storage Volume
ํ ๊ฐ์ ๋ง์คํฐ๋ง ๋ฐ์ดํฐ๋ฅผ ์จ๋ ๋ชจ๋ ์ธ์คํด์ค๊ฐ ๋ณผ๋ฅจ์ ๊ณต์ ํ๋ฏ๋ก ๋ฐ์ดํฐ๋ฅผ ์ฝ์ด๋ผ ์ ์๋ค.
Shared Storage Volume์ Replication + Self Healing + Auto Expanding์ ํน์ฑ์ ์ง๋๋ค.
Aurora DB Cluster : 181p ์ฐธ๊ณ
Aurora Multi-Master : ๋ฉํฐ ๋ง์คํฐ ์ฆ๊ฐ์ ์ธ failover์ ๊ฐ๋ฅํ๊ฒ ํด์ค๋ค. 30์ด๋ ๊ธธ๋ค๊ณ ์๊ฐํ๋ค๋ฉด ๋ฉํฐ ๋ง์คํฐ ์ฌ์ฉ๊ฐ๋ฅ.
Aurora Global Database (recommended)
disaster recovery๊ฐ 1๋ถ ์์ ๊ฐ๋ฅ
decreasing latency
1๊ฐ์ ๋ง์คํฐ ์ธ์คํด์ค, ์ต๋ 16๊ฐ์ read-only์ธ์คํด์ค in ์ต๋ 5๊ฐ์ region, region๊ฐ์ replication lag์ 1์ด ๋ฏธ๋ง์ด๋ค.
Aurora Serverless โ for unpredictable / intermittent workloads
#99 ElastiCache Features
Managed Redis / Memcached (similar offering as RDS, but for caches)
Must provision an EC2 instance type
Key/Value store, Frequent reads : ์ธ์ ๊ด๋ฆฌ ์ต์ ํ
Clustering(Redis), Multi AZ, Read Replicas
Redis
Multi AZ with auto-failover, Read Replicas, Backup and restore features
Read Replicas to scale reads and have high availability
AOF(Append Only File) : redis๋ in-memory db์ด๋ฏ๋ก ์ธ์คํด์ค ์ข ๋ฃ ์ ๋ฐ์ดํฐ ์ ์ค์ ๋ฐฉ์งํ๊ธฐ ์ํด์ ๋ช ๋ น๋ฌธ์ด ์คํ๋ ๋๋ง๋ค 1์ด ์ ๋ ๋จ์๋ก ํ์ผ์ ์ ์ฅํ๋ค.
MEMCACHED
Multi-node for partitioning of data(sharding) : ์ค๋ฉ์ด๋ ํ ์ด๋ธ์ ์ํ ๋ถํ ์ ์๋ฏธํ๋ค. ๋ฐ์ดํฐ๊ฐ ๋ง์์ง ๊ฒฝ์ฐ๋ฅผ ๋๋นํ์ฌ ํ ํ ์ด๋ธ์ ๋ฐ์ดํฐ๋ฅผ ์ฌ๋ฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋๋์ด ์ ์ฅํจ์ ๋งํ๋ค. ํ ๋ ์ฝ๋๋ฅผ ์ฌ๋ฌ ๋๋น์ ์ ์ฅํ๋ read replica๊ฐ ์๋๋ผ, ๋ ๋ ์ฝ๋๋ฅผ ๋ ๊ฐ์ db์ ๋๋์ด ์ ์ฅํ๋ ๊ฒ์ด ์ค๋ฉ์ด๋ค.
No high availability(replication), No backup and restore : ๋ฐ์ดํฐ๊ฐ ์ ์ค๋๋ฉด ๊ทธ๋๋ก ์ ์ค๋๋ค.
Multi-threaded architecture
Supports SASL(Simple Authentication and Security Layer)-based authentication : ์ ํ๋ฆฌ์ผ์ด์ ํ๋กํ ์ฝ๋ค๋ก ๋ถํฐ ์ธ์ฆ ๋ฉ์ปค๋์ฆ์ ๋ถ๋ฆฌํ ๊ฒ์ด SASL์ด๋ค. ์ฆ https๊ฐ์ ํ๋กํ ์ฝ์ ์ฌ์ฉํ์ง ์๊ณ , ๋ค๋ฅธ ๋ณด์ ๋ ์ด์ด๋ฅผ ์ฌ์ฉํ ๊ฒ์ด๋ค.
Cache Security
Do not support IAM authentication : RDS, AURORA์ ๋ค๋ฅด๊ฒ ElastiCache๋ IAM Authentication์ ์ง์ํ์ง ์๋๋ค. IAM Authentication์ ์ฌ์ฉํ๋ฉด ๊ถํ์ ๊ฐ์ง aws์ ์ ๊ฐ redis์ ์ด๋ค ๊ฐ์ด๋ ์ง ๋ฃ์ ์ ์๊ธฐ ๋๋ฌธ์ ๊ทธ๋ฐ ๊ฒ์ด ์๋๊ฐ ์ถ์ธกํด๋ณธ๋ค. redis๋ ์ธ์ ์ ๊ด๋ฆฌํ๋ ๋ฐ์ ์ฃผ๋ก ์ฐ์ด๊ธฐ ๋๋ฌธ์ ๋ณด์์ด ์ค์ํ ์ ๋ฐ์ ์๋ค.
IAM policies on ElastiCache are only used for AWS API-level security : API-level security ์ ๋๋ง iam policy๋ก ๊ด๋ฆฌํ ์ ์๋ค.
Redis AUTH
IAM policies on ElastiCache are only used for AWS API-level security : IAM Policy๋ ๊ทธ๋ฅ elasticache api๋ฅผ ํธ์ถ๊ฐ๋ฅํ iam์ธ์ง๋ง ํ์ธํ๊ณ , elasticache์ ์ ๊ทผํด์ ๋ฐ์ดํฐ๋ฅผ ์กฐ์ํ ์ ์๋ ๊ถํ์ ๋ถ์ฌํ์ง๋ ์๋๋ค๋ ๋ป์ป๋ค.
You can set a password/token when you create a Redis cluster
This is an extra level of security for your cache
Support SSL in flight encryption
Redis Sorted sets guarantee both uniqueness and element ordering
#100 DynamoDB Features
AWS proprietary(์ ์ฉ, ๋ ์ ์ ๋์ ๋ป) technology, managed NoSQL database
Serverless, provisioned capacity, auto scaling, on demand capacity
Can replace ElastiCache as a key/value store (storing session data for example)
Multi AZ by default
Backup / Restore feature
Read and Writes are decoupled : ์ฝ๊ธฐ์ ์ฐ๊ธฐ ๋ถ๋ฆฌ
DAX for read cache : elasticache์ ๋์ฒด์ฌ๊ฐ ๋ ์ ์๋ ์ด์ ์ค ํ๋์ธ ๊ฒ ๊ฐ๋ค.
Security, authentication and authorization is done through IAM
DynamoDB Streams : ๋ณดํต kinesis ๋๋ lambda๋ก ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ผ ์ ์๋ค.
Global Table feature : ์ฝ๊ธฐ์ ์ฐ๊ธฐ๋ฅผ ์ด๋ค region์๋ ํ ์ ์๋ค๋ ๊ฒ์ด global table์ด๋ค. ์ด๋ active-active replication์ด ์๊ธฐ ๋๋ฌธ์ ๊ฐ๋ฅํ๋ค. ์ฌ๋ฌ ์ง์ญ ๊ฐ์ ์๋ฐฉํฅ์ replication์ด ๊ฐ๋ฅํ๋ค๋ ๊ฒ์ด๋ค.
Can only query on primary key, sort key, or indexes
#101 Athena Features
Fully Serverless database with SQL capabilities
Used to query data in S3, Pay per query, Output results back to S3
Secured through IAM
#102 Redshift
Redshift is based on PostgreSQL, but itโs not used for OLTP(Online transaction processing)
Itโs OLAP โ online analytical processing (analytics and data warehousing) : ์ฆ ์ฐ๊ธฐ๋ฅผ ์ํ db๊ฐ์๋๋ผ ๋ถ์์ ์ํ db์ด๋ค.
Columnar storage of data (instead of row based)
Massively Parallel Query Execution (MPP) : ๋ถ์์ ์ํ ์ฟผ๋ฆฌ๋ฅผ ๋ง์ด ํ๋ฏ๋ก ๋ณ๋ ฌ ์ฟผ๋ฆฌ๋ฅผ ์ง์ํ๋ค.
BI(Business Intelligence : ๋ฐ์ดํฐ๋ฅผ ๋ถ์ํ์ฌ ํจ๊ณผ์ ์ธ ์์ฌ๊ฒฐ์ ๋๋ชจ) tools such as AWS Quicksight or Tableau integrate with it
Data is loaded from S3, DynamoDB, DMS, other DBsโฆ
From 1 node to 128 nodes, up to 128 TB of space per node
Redshift Cluster
Leader node: for query planning, results aggregation
Compute node: for performing the queries, send results to leader
Redshift Spectrum: perform queries directly against S3 (no need to load), S3๋ฅผ ๋์์ผ๋ก ๋ก๋ฉ์์ด ์ฟผ๋ฆฌ ๊ฐ๋ฅ
Redshift Cluster๊ฐ ํ์์ ์ผ๋ก enable๋์ด์ผ ํ๋ค.
Backup & Restore์ ์ง์ํ์ง๋ง Multi AZ๋ฅผ ์ง์ํ์ง ์๋๋ค.
๋ฐ๋ผ์ disaster recovery๋ฅผ snapshot๋ฅผ ์บก์ฒํด์ ์ง์ ์ค์ ํด์ค์ผ ํ๋ค. ์ค๋ ์ท์ ์บก์ฒํด ๋ฉํฐ ๋ฆฌ์ ์ ๋ฐฑ์ ํ๋ ๊ณผ์ ์ ์๋ํ(aws ๊ณต์ ์ง์)๋ ์ ์๋ค. 531p ์ฐธ๊ณ
disaster recovery๋ฅผ ์ด์ฐ ๋์๋ ์๋ํ๊ฐ๋ฅํ๊ธฐ ๋๋ฌธ์ auto healing features, cross-region snapshot copy์ ํน์ฑ์ ๊ฐ์ง๋ค.
vs Athena : ์ํ ๋๋ ์ญ์ s3๋ฅผ ๋์์ผ๋ก ์ฟผ๋ฆฌํ๋๋ฐ ์ํ ๋์ ๋นํด faster queries/joins/aggregations thanks to indexes์ ์ฅ์ ์ ๊ฐ์ง๋ค.(Redshift๋ ์ธ๋ฑ์ค๋ฅผ ๊ฐ์ง๋ ํน์ฑ์ด ์๋ค.)
#103 Glue, Neptune
535p ์ฐธ๊ณ
#104 ElasticSearch
Example: In DynamoDB, you can only find by primary key or indexes
With ElasticSearch, you can search any field, even partially matches : ElasticSearch๋ ๊ธฐ๋ณธ์ ์ผ๋ก NoSQL database๋ผ๊ณ ํ๋ค. ๊ฒ์ ์์ง์ด๊ธฐ๋ ํ๋ฐ NoSQL database๋ผ.. ๋ ์กฐ์ฌ๊ฐ ํ์ํ ๊ฒ ๊ฐ๋ค.
๋ฐ๋ผ์ DynamoDB๊ฐ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ฐ์ดํฐ๋ฅผ storeํ๊ณ ElasticSearch๋ก ๋ฐ์ดํฐ๋ฅผ ์์นํ๋ ์์ ์ ํ ์ ์๋ค๊ณ ํ๋ค.
Cognito๋ฅผ ์ง์ํ๋ค.
#105 CloudWatch Metrics
Metric์ด๋? : Metric is a variable to monitor (CPUUtilization, NetworkInโฆ)
Metrics belong to namespaces : ํ ๋ฉํธ๋ฆญ์ ํ ๋ค์์คํ์ด์ค์ ์ํ๋ค.
Metrics have timestamps : metric์ ์๊ฐ ์์ฑ์ ํ์์ ์ผ๋ก ๊ฐ์ง๋ค. ์ด๋ ๋ชจ๋ํฐ๋งํ๋ metric๊ฐ์ ๊ฐ์ timestamp๋ฅผ ๊ณต์ ํด์ผ ํ๊ธฐ ๋๋ฌธ์ ์ค์ํ๋ค. dashboard๋ก ์ฌ๋ฌ metric๋ค์ ๊ด์ฐฐํ ๋ ๊ฐ์ ์๊ฐ๋์ธ ๊ฒ์ด ๋ณด์ฅ๋์ด์ผ ํธํ๊ธฐ ๋๋ฌธ์ด๋ค.
Dimension is an attribute of a metric (instance id, environment, etcโฆ) : Up to 10 dimensions per metric
EC2 Detailed monitoring : 5๋ถ๋ง๋ค metric ๊ฐฑ์ ์ด default, Detailed monitoring์ ์ฌ์ฉํ๋ฉด 1๋ถ๋ง๋ค ๊ฐฑ์ ๊ฐ๋ฅ
EC2 Memory usage is by default not pushed : ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ default์งํ๊ฐ ์๋๊ณ , unified agent๋ฅผ ec2 instance๋ด๋ถ์ ์ค์น ํ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ custom metric์ผ๋ก ์ฌ์ฉํด์ผ ํ๋ค.
Custom Metrics
Use API call PutMetricData
StorageResolution : 1๋ถ๋ง๋ค metric ๊ฐฑ์ ์ด default, High Resolution์ ์ฌ์ฉํ๋ฉด 1/5/10/30์ด๋ง๋ค ๊ฐฑ์ ๊ฐ๋ฅ
Accepts metric data points two weeks in the past and two hours in the future (make sure to configure your EC2 instance time correctly) : Cloudwatch๋ก ๋ณด๋ด์ง๋ metric์ ๊ณผ๊ฑฐ 2์ฃผ, ๋ฏธ๋ 2์๊ฐ ์ฌ์ด์ metric๋ง ๋ฐ๋๋ค. ๋ฐ๋ผ์ metric์ ๋ณด๋ผ ๋ timestamp๋ฅผ ์ ์ค์ ํด์ผ ํ๋ค.
CloudWatch Dashboards
Great way to setup custom dashboards for quick access to key metrics and alarms : ๊ณ์ ๊ด์ฐฐํด์ผ ํ key metric์ ๋น ๋ฅด๊ฒ ์ ๊ทผ ๊ฐ๋ฅ
Dashboards are global, Dashboards can include graphs from different AWS accounts and regions : ํ ๋์๋ณด๋์ ์ฌ๋ฌ region์ metric์ ๋ฃ์ ์ ์๋ค. ์๋ฅผ ๋ค์ด ํ๊ตญ region metric๊ณผ ๋ฏธ๊ตญ region metric์ด ํ ๋์๋ณด๋์ ๊ณต์กดํ๋ ๊ฒ์ด๋ค.
Dashboards can be shared with people who donโt have an AWS account : aws๊ณ์ ์ด ์์ด๋ ๋ค๋ฅธ ์ฌ๋๋ค๊ณผ ๊ณต์ ๊ฐ๋ฅ, aws๊ณ์ ์ด ์๋ ๋ค๋ฅธ ํ๊ณผ์ ํ์ ์ ์ข์ ๋ฏ?
You can setup automatic refresh : ๋์๋ณด๋๋ฅผ ์๊ฐ๋ง๋ค ์๋ ๊ฐฑ์ ๊ฐ๋ฅ
#106 CloudWatch Logs
Log groups: arbitrary name, usually representing an application : ์๋ฅผ ๋ค์ด lambda์์ ๋ก๊ทธ๊ฐ ์์ธ ๊ฒ์ด๋ผ๋ฉด lambda๊ฐ prefix๋ postfix๋ก ๋ถ์ naming์ ์ฌ์ฉํ๋ค. ๋ฌผ๋ก ์ปค์คํ ๋ก๊ทธ๋ ์ฌ์ฉ์๊ฐ ์ง์ ์ด๋ฆ์ ์ค์ ํ๋ค.
Log stream: instances within application / log files / containers - ๋ก๊ทธ ํ์ผ์ ์ฉ๋์ด ์ด๋ ์ ๋ ์ปค์ง๋ฉด ๋ก๊ทธ ํ์ผ์ ๋ณด๋ผ์๋ ์๊ณ , ๋ก๊ทธ๊ฐ ์๊ธธ ๋๋ง๋ค ๋ณด๋ผ ์๋ ์๋ ๊ฒ ๊ฐ๋ค.
Log group์์ Log stream์ด ๋ก์ฐ์ฒ๋ผ ์์ด๋ ๋ฐฉ์์ด๋ค.
Can define log expiration policies (never expire, 30 days, etc..) : never expire๋ก ์ค์ ํ ์ ์ผ์ข ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก ์ฌ์ฉ๊ฐ๋ฅํ๋ค.
CloudWatch Log์ metric filter๋ฅผ ์ฌ์ฉํ๋ฉด, custom metric์ ๋ง๋ค์ด๋ผ ์ ์๋ค.
CloudWatch Insights
CloudWatch Logs Insights can be used to query logs and add queries to CloudWatch Dashboards : CloudWatch Logs๋ฅผ ๋์์ผ๋ก ์ฟผ๋ฆฌํ ์ ์๊ณ , ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ dashboard์ ์์ ์๋ ์๋ ๊ฒ ๊ฐ๋ค.
S3 Export
API NAME : CreateExportTask์ ์ฌ์ฉํด์ s3๋ก ๋ก๊ทธ๋ฅผ exportํ ์ ์๋ค.
ํ์ง๋ง ์ต๋ 12์๊ฐ์ด ๊ฑธ๋ฆฌ๊ธฐ ๋๋ฌธ์ Not near-real time or real-time์ด๊ธฐ ๋๋ฌธ์ ์ค์๊ฐ์ผ๋ก ์ ์กํ๋ ค๋ฉด Logs Subscriptions์ ์ฌ์ฉํด์ผ ํ๋ค.
CloudWatch Logs Subscriptions
CloudWatch Subscription Filter์ ์ฌ์ฉํ๋ฉด Lambdaํน์ Kinesis์ ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ด real-time์ ๊ฐ๊น๊ฒ ์ฌ์ฉํ ์ ์๋ค. 549p ์ฐธ๊ณ
CloudWatch Logs Agent & Unified Agent
By default, no logs from your EC2 machine will go to CloudWatch : ๋ฐ๋ผ์ agent๋ฅผ ec2ํน์ on-premise server์ ์ค์นํด ์ํ๋ ๋ก๊ทธ๋ฅผ ๋ณด๋ผ ์ ์๋ค.
Unified Agent๋ ์ต์ ๋ฒ์ ์ Logs Agent์ด๊ณ ๋ ๋ง์ ๊ธฐ๋ฅ์ ์ง์ํ๋ค.
Unified Agent
Collect additional system-level metrics : CPU, Disk metrics, RAM, Netstat, Processes, Swap Space
#107 CloudWatch Alarms
Period
metirc์ ๋ช ์ด๋ง๋ค ํ๊ฐํ ๊ฒ์ธ๊ฐ๋ฅผ ์ ํ๋ค.
High resolution custom metrics: 10, 30, 60์ด ๋จ์๋ก ์ค์ ๊ฐ๋ฅ
Alarm States
OK : ๋ฌธ์ ์๋ ์ํ
ALARM : ๋ฌธ์ ์๋ ์ํ
INSUFFICIENT_DATA : metric์ ๋ณด๊ณ ํ๋จํ๊ธฐ์ ๋ฐ์ดํฐ๊ฐ ๋ถ์ถฉ๋ถํ ๊ฒฝ์ฐ
Alarm Targets
Stop, Terminate, Reboot, or Recover an EC2 Instance
Trigger Auto Scaling Action
Send notification to SNS
#108 CloudWatch Events
Event Pattern: Intercept events from AWS services : aws service์์ ๋ฐ์ํ๋ ์ด๋ฒคํธ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์๋ค.
Example sources: EC2 Instance Start, CodeBuild Failure
Can intercept any API call with CloudTrail integration
Schedule or Cron
์์๋ก ํน์ ์ด๋ฒคํธ๋ฅผ ๋งค ์๊ฐ๋ง๋ค ๋ฐ์ํ๊ฒ ๋ง๋ค ์ ์๋ค.
A JSON payload is created from the event and passed to a target : ๊ธฐ๋ณธ์ ์ผ๋ก json ํ์์ผ๋ก ์ด๋ฒคํธ๊ฐ ๋์์๊ฒ ์ ๋ฌ๋๋ค.
#109 Amazon EventBridge
EventBridge is the next evolution of CloudWatch Events : EventBridge๋ CloudWatch Events์ ์ต์ ๋ฒ์ ์ด๋ค.
Amazon EventBridge builds upon and extends CloudWatch Events
Over time, the CloudWatch Events name will be replaced with EventBridge
Default event bus: generated by AWS services (CloudWatch Events) > EC2 Instance Start, CodeBuild Failure๊ฐ์ aws specificํ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ ์ฌ์ฉ
EventBridge specificํ ๊ธฐ๋ฅ
Partner event bus: receive events from SaaS service or applications (Zendesk, DataDog, Segment, Auth0โฆ)
์๋ฅผ ๋ค์ด, ๋ฐ์ดํฐ๋ ์์ ๋ชจ๋ํฐ๋งํ๋ค ๋ฌธ์ ์์ ๊ฒฝ์ฐ ์ด๋ฒคํธ๋ฅผ ๋ฐ์์์ผ EventBridge๋ก ์ ๋ฌ์ํฌ ์ ์๋ค๋ ๊ฒ์ด๋ค.
Custom Event buses: for your own applications
The Schema Registry
The Schema Registry allows you to generate code for your application, that will know in advance how data is structured in the event bus
์คํค๋ง ๋ ์ง์คํธ๋ฆฌ๋ event๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ ์ ๋ฌ๋ json์ ์ด๋ค ๊ตฌ์กฐ๋ก ์ค๊ณํ ๊ฒ์ธ์ง๋ฅผ ๋ฏธ๋ฆฌ ์ ํด๋๊ธฐ ์ํด ์ฌ์ฉํ๋ ์๋น์ค์ด๋ค.
EventBridge can analyze the events in your bus and infer the schema
Event buses can be accessed by other AWS accounts : ๋ค๋ฅธ ๊ณ์ ์ ์ํด event bus๊ฐ access๊ฐ๋ฅํ ๊ฒ์ Partner event bus ๋๋ฌธ์ ๊ถํ์ ์ด์ด์ค์ผํด์ ๊ทธ๋ฐ ๊ฒ์ด ์๋๊ฐ ์ถ์ธกํด๋ณธ๋ค.
#110 AWS CloudTrail
CloudTrail is enabled by default!
์ฐธ๊ณ
IAM Credential Report : ํ ๊ณ์ ๋ด๋ถ์ IAM user๋ค์ ์๊ฒฉ ์ฆ๋ช ์ ์ํ๋ฅผ ๊ด๋ฆฌ
IAM Access Advisor : last-access๋ฅผ ํ์ ํด ๊ถํ ๊ด๋ฆฌ ๊ฐ๋ฅ
Provides governance(๊ด๋ฆฌ), compliance(๊ท์ ์ค์) and audit(๊ฐ์ฌ) for your AWS Account
Get an history of events / API calls made within your AWS Account by:
Console
SDK
CLI
AWS Services
Events are stored for 90 days in CloudTrail
์ฅ๊ธฐ ๋ณด๊ด์ ํ ๊ฒ์ด๋ผ๋ฉด s3์ ๋ณด๋ด๋ฉด ๋๋ค.
Can put logs from CloudTrail into CloudWatch Logs or S3
A trail can be applied to All Regions (default) or a single Region. : ๋ชจ๋ Region์ access๋ฅผ ํ์ ํ ์ ์๋ค.
If a resource is deleted in AWS, investigate CloudTrail first! : ์์์ ๋๊ฐ ์ญ์ ํ๋์ง ๋ณด๊ณ ์ถ๋ค๋ฉด cloudtrail์ ์ฌ์ฉํ๋ฉด ๋๋ค.
CloudTrail Events
Management Events
Operations that are performed on resources in your AWS account : ์๋ฅผ ๋ค์ด ec2์ iam role์ ์ค์ ํด์ฃผ๋ ๊ฒ. ์ฌ๋งํ aws service๋ api call๊ฐ ํธํ๋๋ฏ๋ก, api call์ด ๊ฐ๋ฅํ ๋ชจ๋ ์๋น์ค๋ cloudtrail๋ก ์ถ์ ์ด ๊ฐ๋ฅํ๋ค๊ณ ๋ณด๋ฉด ๋๋ค.
Read Eventsd์ Write Events๋ฅผ ๋ถ๋ฆฌํ ์ ์๋ค.
Data Events
By default, data events are not logged (because high volume operations) : ๋ฐ์ดํฐ ์ด๋ฒคํธ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์์ด์ง ์๋๋ค.
์ด ์ต์ ์ ํ์ฑํํ๋ฉด getObject, putObject ๋ฑ์ s3 event๊ฐ ๋ฐ์ํ ๋๋ง๋ค ๋ก๊ทธ๋ฅผ ์์ ์ ์๋ค.
CloudTrail Insights Events
CloudTrail Insights : CloudTrail Insights to detect unusual activity in your account > ๊ณ์ ๋ ๋ฒจ์์ ๊ณ์ ๋ด๋ถ ์ ์ ์ ๋น์ ์์ ์ธ ํ๋์ ๊ฐ์งํ ์ ์๋ค. ์์ 565p ์ฐธ๊ณ
Continuously analyzes write events to detect unusual patterns : CloudTrail์ ์ง์์ ์ผ๋ก Management Events๋ฅผ ๋ถ์ํ๋ฉด ์ด์์ด ์๋์ง ํ์ ํ๊ณ ์ด์ ๊ฐ์ง ํ ์ด๋ฒคํธ๋ฅผ CloudTrail Console ๋๋ s3 ๋๋ eventbridge์ ๋ณด๋ธ๋ค.
#111 AWS Config
Helps with auditing and recording compliance(๊ท์ ์ค์) of your AWS resources : ๊ท์ ์ค์๋ผ๊ณ ํจ์ aws๋ฅผ ์ฌ์ฉํ๋ฉด์ ์์ ์ด ์๊ฐํ๋๋ก ๊ฐ์ข ์๋น์ค๋ค์ ์ ์ฌ์ฉํ๊ณ ์๋ ์ ๋๋ก ์๊ฐํ๋ฉด ๋๋ค.
Helps record configurations and changes over time : ์๋์์ compliance๋ฅผ auditํ๋ ์์๋ฅผ ๋ค ์ ์๋ค.
Is there unrestricted SSH access to my security groups?
Do my buckets have any public access?
How has my ALB configuration changed over time?
You can receive alerts (SNS notifications) for any changes
AWS Config is a per-region service
Can be aggregated across regions and accounts : CloudTrail, CloudWatch Dashboard์ ๋ค๋ฅด๊ฒ per region ์๋น์ค์ด์ง๋ง cross regionํ๊ฒ ๋ง๋ค ์ ์๋ค.
Possibility of storing the configuration data into S3 (analyzed by Athena) : CloudWatch, CloudTrail๊ณผ ๋์ผ
#112 AWS Config Rules
Managed config rules (over 75)
Make custom config rules (must be defined in AWS Lambda)
Example: evaluate if each EBS disk is of type gp2
Example: evaluate if each EC2 instance is t2.micro
Rules can be evaluated / triggered
For each config change
At regular time intervals : triggered
AWS Config Rules does not prevent actions from happening(no deny) : ์์๋ก ec2ํ์ ์ t2๋ก aws config๋ก ์ค์ ํ๊ณ r๊ณ์ด์ ์ธ์คํด์ค๋ฅผ ์์ฑํ ์๋ ์๋ค๋ ๋ป.
AWS Config Resource
View compliance of a resource over time
View configuration of a resource over time
View CloudTrail API calls of a resource over time : compliance, configuration๋ compliance(๊ท์ ์ค์) check์ ์ํด์ ๋น์ฐํ ๋ณผ ์ ์๋ ๊ฒ์ธ๋ฐ Cloudtrail API calls๊น์ง ๋ณผ ์ ์๋ ๊ฒ๋ ์๊ฐํด์ผ ํ๋ค.
Config Rules Remediations : Non-compliant resource์ ๋ํ ํ๋ณต
Non-compliantํ resource์ ๋ํด ์๋์ผ๋ก Auto-Remediation Action(SSM Document: AWSConfigRemediationRevokeUnusedIAMUserCredentials)์ ์คํํ ์ ์๋ค.
SSM Automation์ ์ฌ์ฉํ์ง ์๊ณ , Custom Automation์ ์ฌ์ฉํด์ lambda function์ ์ฌ์ฉํ ์๋ ์๋ค.
Remediation์คํ ํ์๋ ํ๋ณต์ด ์๋๋ฉด 5๋ฒ์ dafault๋ก ์๋
Config Rules Notifications
aws config๋ eventbridge์ event๋ฅผ ์ ๋ฌํ ์ ์๋ค.
aws config์์ ๋ฐ์ํ๋ ๋ชจ๋ ์ด๋ฒคํธ๋ฅผ eventbridge์ ์ ๋ฌํ๊ณ eventbridge๋ sns์ ์ ๋ฌํ ์ ์๋๋ฐ ์ด ๊ณผ์ ์์ ํน์ ์ด๋ฒคํธ๋ง ์ํ๋ค๋ฉด sns filter๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค.
CloudWatch vs CloudTrail vs Config 571p ํํ ์ฐธ๊ณ .
#113 AWS STS โ Security Token Service
Allows to grant limited and temporary access to AWS resources : aws ์์์ ๋ํ ์ผ์์ ์ ๊ทผ์ ์ํ ๋ ์ฌ์ฉ
Token is valid for up to one hour (must be refreshed) : ์ต๋ 1์๊ฐ๊น์ง ์ ํจํ ํ ํฐ์ ์ฌ์ฉ
AssumeRole : ์๋ ๋ ๊ฐ์ง ๊ฒฝ์ฐ์ ์ฌ์ฉ๋๋ค.
Within your own account: ๊ฐํ๋ ๋ณด์์ ์ํด์
Cross Account Access: ์๋ฅผ ๋ค์ด, development๊ณ์ ์ ์ ์ ๊ฐ ๋ฐฐํฌ๋ฅผ ์ํด์ production๊ณ์ ์ ์ญํ ์ด ํ์ํ ๊ฒฝ์ฐ production๊ณ์ ์ ์ฃผ๋ ๊ฒ ์๋๋ผ ๋ฐฐํฌ์ ํ์ํ role๋ง ์ ๊น sts๋ก ์ค ์ ์๋ค.
https://docs.aws.amazon.com/ko_kr/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html ์ฐธ๊ณ
Assume Role ์ฌ์ฉ๋ฒ
Define an IAM Role within your account or cross-account
Define which principals(a person or application that can make a request for an action or operation on an AWS resource) can access this IAM Role : ๋๊ฐ ์ ๊ทผํ ์ ์๋์ง ์ค์
Use AWS STS (Security Token Service) to retrieve credentials and impersonate(๋ชจ๋ฐฉ) the IAM Role you have access to (AssumeRole API) : 576p ์ฐธ๊ณ
๊ฐ๋จํ๊ฒ ์๊ฐํ๋ฉด ๋๋ค. ์๋ฅผ ๋ค์ด development๊ณ์ ์ ์ ์ ๊ฐ production s3 bucket์ ์ ๊ทผํด์ผํ ์ผ์ด ์๊ธด๋ค๋ฉด ๋ฏธ๋ฆฌ production s3 bucket์ ์ ๊ทผํ ์ ์๋ IAM Role์ ๋ง๋ค์ด๋๊ณ , sts token์ development๊ณ์ ์ ๋ถ์ฌํด์ production s3 bucket์ ์ผ์์ ์ผ๋ก ์ ๊ทผํ๋ ๊ฒ์ด๋ค.
#114 Identity Federation in AWS
Federation lets users outside of AWS to assume temporary role for accessing AWS resources. : ์ธ๋ถ ์๋น์ค ๋ก๊ทธ์ธ์ผ๋ก aws ์์์ ์ง์ ์ ๊ทผํ ๋ ์ฌ์ฉํ๋๋ฐ์ ์ต์ ํ๋์ด ์๋ค.
Using federation, you donโt need to create IAM users (user management is outside of AWS) : ์๋ฅผ ๋ค์ด ๋ฐฑ๋ง๋ช ์ ์ฌ์ฉ์๊ฐ aws์์์ ์ ๊ทผํด์ผ ํ ๋ ์ผ์ผ์ด ๊ณ์ ์ ์์ฑํด์ฃผ๊ธฐ๋ ์ด๋ ต๋ค.
Identity Federation์ ์ธ๋ถ์์ ์ด๋ค ์ธ์ฆ ๋ฐฉ๋ฒ(SAML 2.0, Web Identity Federation, Custom Identity Broker)์ ์ฌ์ฉํ๋ ์ง ๋งค์ปค๋์ฆ์ ๋น์ทํ๋ค. ์ธ๋ถ ์๋น์ค์ ๋ก๊ทธ์ธํ๊ณ , aws์ ์ก์ธ์ค ์์ฒญ ํ, sts๋ก ํ ํฐ์ ๋ฐ์ aws์์์ ์ง์ ์ ๊ทผํ๋ ๋ฐฉ์์ด๋ค.
SAML2.0(Security Assertion Markup Language, ๋ค๋ฅธ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ธ์ฆ ํ ํฐ์ ์ ๋ฌํ ์ ์๊ฒ ํด์ฃผ๋ ๋ก๊ทธ์ธ ํ์ค)์ deprecated์ด๊ณ , Amazon Single Sign On (SSO)์ ๊ถ์ฅํ๋ค.
Custom Identity Broker Application : ์ด๊ฒ์ SAML 2.0์ ์ง์ํ์ง ์๋ ๊ณณ์ ์ฌ์ฉํ๋๋ฐ, identity broker๊ฐ sts token์ ๋ฐ์์จ๋ค๋ ์ ๋นผ๊ณ ๋ ๊ธฐ์กด identity federation ๋์ ๋ฐฉ์๊ณผ ๋น์ทํ๋ค.(AssumeRole or GetFederationToken API์ฌ์ฉ)
The identity broker must determine the appropriate IAM policy : The identity broker๊ฐ IAM policy๋ฅผ ์ ์ํ๋ค.(๋น์ฐํ์ง๋ง ์ด๋ค ์ญํ ์ ์ํ๋์ง aws์ ๋งํด์ค์ผ ํ๋ฏ๋ก)
AssumeRoleWithWebIdentity : deprecated์ด๊ณ Cognito๋ก ๋์ฒด ๊ฐ๋ฅํ๋ค.
Federated Identity Pools using Cognito
์ค์ํ ์ธ ๊ฐ์ง ๊ณผ์ ๋ง ๊ธฐ์ตํ์.
Identity Provider(Cognito User Pool, ํ์ด์ค๋ถ ๋ก๊ทธ์ธ, ๊ตฌ๊ธ ๋ก๊ทธ์ธ, SAML ๋ก๊ทธ์ธ ๋ฑ)์ ๋ก๊ทธ์ธ ํ ํ ํฐ์ ๋ฐ๋๋ค.
ํ ํฐ์ Cognito Federated Identity์ ๋๊ธด ํ Cognito Federated Identity๋ Identity Providerํ ํฐ์ด ์ ํจํ ์ง ๊ฒ์ฆํ๋ค.
sts๋ก temporary credential ๋ฆฌํด
#115 Microsoft Active Directory
Overview๋ ๊ฐ๋ตํ๊ฒ ์ง๊ณ ๋์ด๊ฐ๋ค. AWS Directory Services 3๊ฐ์ง๋ง ์ธ์ฐ๊ณ ๋์ด๊ฐ๋ฉด ๋๋ค.
Active Directory helps you organize your company's users, computer and more : Database of objects, ํ์ฌ ๋ด์ ์ ์ ๊ณ์ , ์ปดํจํฐ, ํ๋ฆฐํฐ ๋ฑ์ ๋ฐ์ดํฐ๋ก ์ ์ฅ
Centralized security๋ก domain controller์์ ๋ชจ๋ ๊ถํ์ ๊ฐ์ง๊ณ ํ์ ์ค๋ธ์ ํธ๋ค์ ๊ด๋ฆฌํ๋ค.
Lightweight Directory Access Protocol(LDAP) ์ฌ์ฉ : TCP/IP ์์์ ๋๋ ํฐ๋ฆฌ ์๋น์ค๋ฅผ ์กฐํํ๊ณ ์์ ํ๋ ์์ฉ ํ๋กํ ์ฝ
AWS Directory Services
AWS Managed Microsoft AD
on-premise AD ์ฌ์ฉ
MFA ์ง์
Establish โtrustโ connections with your on-premise AD
AD Connector
on-premise AD ์ฌ์ฉ
ํ๋ก์ ์ฌ์ฉ
Simple AD
on-premise AD๋ฅผ ์ฌ์ฉํ ์ ์์ ๋ ์ฌ์ฉ
ec2 instance์ฌ์ฉ๊ฐ๋ฅ
#116 AWS Organizations
Global service
Allows to manage multiple AWS accounts : 1๊ฐ์ master account์ ์ ๋ง์ member account๋ก ์ด๋ฃจ์ด์ง๋ค.
ํ member account๋ ํ organization์๋ง ์ํ ์ ์๋ค.
API is available to automate AWS account creation
Multi Account Strategies : aws organization์ ํ์ฉํ ๋ค์ํ ๋ฐฉ๋ฒ์ด ์กด์ฌํ๋ค.
Create accounts per department,
per cost center, per dev / test / prod, based on regulatory restrictions (using SCP : Security Control Policy)
for better resource isolation (ex: VPC), to have separate per-account service limits, isolated account for logging
Organizational Units(OU) : OU๋ ํ๋์ ๊ทธ๋ฃน์ด๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค. OU์์ ๊ทธ๋ฃน์ ๋ง๋ค๋ฉด ๊ทธ๋ฃน ์์ ๊ณ์ ๋ค์ OU์ ์์ฑ์ ๊ณต์ ํ๋ค.
Security Control Policy : Whitelist or blacklist IAM actions - allowํ๊ฑฐ๋ deny
Applied at the OU or Account level : OU(์ฌ์ค์ Account๋ฅผ ๋ฌถ์ ๊ทธ๋ฃน์ ๊ฐ๊น์)์ account๋ชจ๋์ ์ ์ฉ๊ฐ๋ฅํ๊ณ ๊ฐ๋ณ ๊ถํ ํ์ํ ๊ฒฝ์ฐ account์ ์ ์ฉ
Does not apply to the Master Account : master account์๋ scp๋ฅผ ์ ์ฉํด๋ ์ ์ฉ๋์ง ์๋๋ค.
SCP is applied to all the Users and Roles of the Account, including Root user : ๊ณ์ ์์ iam user๋ฅผ ๋ง๋ค๋ ๋ฃจํธ ๊ณ์ ์ ์ฌ์ฉํ๋ ์๊ด ์์ด scp๋ ํ ๊ณ์ ์ ์ ์ฉํ๋ฉด ๊ทธ ๊ณ์ ์ ์ ์ญ์ ์ผ๋ก ์ ์ฉ๋๋ค.
๊ธฐ๋ณธ์ ์ผ๋ก deny๊ฐ default๋ก ์ ์ฉ๋๊ณ deny, allow๊ฐ ๊ณต์กดํ๋ ๊ฒฝ์ฐ deny๋ฅผ ์ฐ์ ์ ์ฉํ๋ค.
Moving Accounts
ํ ์กฐ์ง์ ๋ฉค๋ฒ๋ฅผ ๋ค๋ฅธ ์กฐ์ง์ผ๋ก ์ฎ๊ธฐ๋ ค๋ฉด ์กฐ์ง์์ ๋ฉค๋ฒ๋ฅผ ์ญ์ ํด์ผ ๊ฐ๋ฅ
ํ ์กฐ์ง์ master account๋ฅผ ๋ค๋ฅธ ์กฐ์ง์ผ๋ก ์ฎ๊ธฐ๋ ๊ฒ ์ญ์ ์์ ๊ฐ์ด ๊ธฐ์กด ์กฐ์ง์์ ์์ ํ ๋ฒ์ด๋์ผ ๊ฐ๋ฅ
#117 IAM Roles vs Resource Based Policies
When you assume a role (user, application or service), you give up your original permissions and take the permissions assigned to the role : assume role์ ์์ ์ ๊ถํ์ ํฌ๊ธฐํ๊ณ ๋ค๋ฅธ ์ฌ๋์๊ฒ ๋๊ธฐ๋ ๊ฒ
When using a resource based policy, the principal doesnโt have to give up his permissions : ์์ ์ ๊ถํ์ ํฌ๊ธฐ ์ํด๋ ๋จ
#118 IAM Permission Boundaries
IAM Permission Boundaries are supported for users and roles (not groups)
Advanced feature to use a managed policy to set the maximum permissions an IAM entity can get : IAM ์ํฐํฐ(์ ์ ํน์ role)๊ฐ ๊ฐ์ง ์ ์๋ ๊ถํ์ ์ต๋์น๋ฅผ ์ค์ ํ ์ ์๋ค.
์๋ฅผ ๋ค์ด administrator๊ถํ์ ๋ถ์ฌํด๋ Permission Boundary๊ฐ s3ํ์ ์ด๋ฉด s3์ ํ์ ๋ ๊ถํ์ ๊ฐ๊ฒ ๋๋ค.
#119 Organization SCP & Permissions Boundary & Identity-based policy
Organization SCP & Permissions Boundary & Identity-based policy 3๊ฐ์ง๋ฅผ ๋์์ ํ์ฉํด์ ๋ณด์ ๊ฐํ ๊ฐ๋ฅ
Identity-based policy : ์ด๋ค identity๋ฅผ ๊ฐ์ง ๊ณ์ ํน์ role์ ๋ถ์ฌํ๋, identity๋ฅผ ๋์์ผ๋ก ๊ถํ์ ๋ถ์ฌํ๋ policy
Resource-based policy : ๋ฆฌ์์ค์ ๋ถ์ฌํ๋, ๋ฆฌ์์ค๋ฅผ ๋์์ผ๋ก ํน์ identity๋ง ํ์ฉํ๊ฒ ๋ค๋ policy
https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html : ๊ณต์ ๋ฌธ์ ์ฐธ๊ณ
#120 IAM Policy Evaluation Logic
Deny Evaluation : ๋ฌด์ธ๊ฐ๋ฅผ denyํ๋ effect๊ฐ ์๋ค? ๊ทธ๋ ๋ค๋ฉด ๋ฌด์กฐ๊ฑด allow๋ณด๋ค ์ฐ์ ์ ์ฉ๋์ด ๋ฌด์กฐ๊ฑด deny๋๋ค.
Organization SCP
Resource-based policies
IAM permissions boundaries
Session policies
Identity-based policies\
#121 AWS Resource Access Manager(RAM)
Share AWS resources that you own with other AWS accounts : ํ aws๊ณ์ ์ด ๊ฐ์ง ๋ฆฌ์์ค๋ฅผ ๋ค๋ฅธ aws๊ณ์ ๊ณผ ์์ดํ๋ค.
Avoid resource duplication : ๋ฆฌ์์ค ๋ณต์ ๊ฐ ์๋๋ผ ๊ณต์ ๋ฅผ ์งํฅํ๋ค.
VPC Subnets์ ๊ฒฝ์ฐ RAM์ด ์์ฃผ ์ฌ์ฉ๋๋ฏ๋ก ์ด ์ผ์ด์ค๋ ๊ผญ ๊ธฐ์ตํ๋๋ก ํ์.
๋ค์ด์ด๊ทธ๋จ 604p๋ฅผ ์ฐธ๊ณ ํ๋ฉด private subnet๋ด์์ private ip๋ก ๋ฆฌ์์ค๊ฐ ์ ๊ทผ์ด ๊ฐ๋ฅํด ๋ณด์ ๊ทธ๋ฃน๋ผ๋ฆฌ๋ง ์ ์ค์ ํด์ฃผ๋ฉด ๋ค๋ฅธ ๊ณ์ ์ ์๋ ์๋ก ๋ค๋ฅธ ๋ฆฌ์์ค ๊ฐ์ ์ ๊ทผ์ด ์ฝ๊ฒ ๊ฐ๋ฅํ๋ค.
#122 AWS Single Sign-On (SSO)
Centrally manage Single Sign-On to access multiple accounts and 3rd-party business applications. : On-premise์๋ฒ ํน์ Identity Store SAML 2.0 Compatible๊ณผ ์ฐ๋ํ์ฌ sso์ ๋ก๊ทธ์ธํ๋ฉด aws console, business cloud application(slack, dropbox), custom SAML application ๋ชจ๋๋ฅผ ํ ๋ก๊ทธ์ธ์ผ๋ก ์ฌ์ฉํ ์ ์๋ค. ๋ง ๊ทธ๋๋ก Single Sign On์ด๋ค.
Integrated with AWS Organizations
Supports SAML 2.0 markup
Integration with on-premise Active Directory
Centralized permission management
607p ์ฐธ๊ณ
#123 SSO vs AssumeRoleWithSAML
AssumeRoleWithSAML๋ 3rd party์ฑ์ ๋ก๊ทธ์ธํ๊ณ sts์ credential์์ฒญ ํ ํ ํฐ์ ๋ฐ์ aws resource์ ์ ๊ทผํ๋ค.
๋ฐ๋ฉด SSO๋ SSO Login Portal(Identity Store SAML 2.0 Compatible๊ณผ ์ฐ๋๋)์๋ง ๋ก๊ทธ์ธํ๋ฉด credentail์ ๋ฐ์ aws resource์ ๋ฐ๋ก ์ ๊ทผํ ์ ์๊ณ aws์์ AssumeRoleWithSAML์ ๋นํด์ ๊ถ์ฅํ๋ ๋ฐฉ์์ด๋ค.
#124 AWS KMS(Key Management Service)
Fully integrated with IAM for authorization
server side encryption์ ํจ๊ณผ์
Symmetric(AES-256 keys)
Necessary for envelope encryption : envelope encryption์ด๋ ํ ํค๋ก ์ํธํํ ๊ฒ์ ๋ค๋ฅธ ํค๋ก ํ ๋ฒ ๋ ์ํธํํ๋ ๊ฒ์ ๋งํ๋ค. (envelope encryption์ developer exam๋ฒ์์ด๊ณ solutions architect๋ฒ์๋ ์๋๋ค.)
You never get access to the Key unencrypted (must call KMS API to use)
Asymmetric(RSA & ECC key pairs)
The public key is downloadable, but you canโt access the Private Key unencrypted
Use case: Sign/Verify operations, encryption outside of AWS by users who canโt call the KMS API : public key๊ฐ downloadable์ด๋ฏ๋ก KMS API๋ฅผ ์ฌ์ฉํ ์ ์๋ ์ํฉ์ด๋ผ๋ฉด ๊ณ ๋ ค ๊ฐ๋ฅ
Symmetric key์ Asymmetric์ private key๋ ๊ณตํต์ ์ผ๋ก unencrypted์ํ๋ก ๋ณผ ์ ์๊ฒ ์ค๊ณ๋์๋ค.
Three types of Customer Master Keys(CMK) : KMS์ ๋์์ด์ด๊ณ KMS๊ฐ ์ต์ ๋ฒ์
AWS Managed Service Default CMK: free > ์๋ฅผ ๋ค์ด EBS์ฌ์ฉํ ๋ at rest encryption์ผ๋ก default kms๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ์๊ธ์ด free๋ผ๋ ๊ฒ์ด๋ค.
๋๋จธ์ง๋ ์ปค์คํ ํค๋ฅผ ์์ฑํ๊ฑฐ๋ importํ๋ ๊ฒ์ธ๋ฐ ๊ฐ๋น $1/month์ด๋ค.
aws์์ ๊ด๋ฆฌํ๋ KMS๋ด๋ถ์ ํค๋ ๋ณผ ์ ์๋ค. ๋ฐ๋ผ์ ๋ชจ๋ ๋ณด์์ aws์์ ๋งก๊ธฐ๋ ๊ฒ์ด๊ณ , rotate key๋ก ๋ณด์์ ๊ฐํํ ์ ์๋ค.
KMS can only help in encrypting up to 4KB of data per call
If data > 4 KB, use envelope encryption : KMS์์ 4KB์ด์์ ๋ฐ์ดํฐ๋ envelope encryption์ ์ฌ์ฉํ๋ค.
To give access to KMS to someone : IAM Policy๋ฟ๋ง ์๋๋ผ Key Policy๋ ์ค์ ํด์ผ ํ๋ค๋ ๊ฒ์ ๊ธฐ์ตํ์.
Make sure the Key Policy allows the user : Key policy ์ค์ ํ์
Make sure the IAM Policy allows the API calls : IAM Policy ์ค์ ํ์
#125 KMS Key Policies
Control access to KMS keys, โsimilarโ to S3 bucket policies : s3 bucket policy์ฒ๋ผ ์ ๊ทผ์ ์ ํํ๋ policy๋ฅผ ๋งํ๋ค.
Default KMS Key Policy
policy๋ฅผ ๋ฐ๋ก ์ค์ ํ์ง ์์์ ๊ฒฝ์ฐ ์ ์ฉ๋๋ policy
Complete access to the key to the root user = entire AWS account : ๋ฃจํธ ์ ์ ๋ฅผ ํฌํจํ IAM์ ๋ชจ๋ ๊ณ์ ์ด ์ด ํค์ ์ ๊ทผ ๊ฐ๋ฅ
๋ฐ๋ผ์ ์ด ๊ฒฝ์ฐ๋ IAM policy๋ง ์ ์ค์ ํด์ฃผ๋ฉด Key Policy๊ฐ default๋ก ์ ์ฉ๋๋ ๊ฒ์ด๋ค.
Custom KMS Key Policy
์ปค์คํ ์ผ๋ก ์ด๋ค user, role์ด ์ด ํค๋ฅผ ์ฌ์ฉํ ์ ์๋์ง ์ ์ํ๋ค. ๋น์ฐํ policy์ ๋ฐ๋ผ์ ๋ค๋ฅธ ๊ณ์ ๋ ์ด ํค์ ์ ๊ทผํ ์ ์๋ค.
#126 KMS Automatic Key Rotation
For Customer-managed CMK(not AWS managed CMK) : AWS Managed Key๋ 3๋ ๋ง๋ค rotate๋๋ค๊ณ ํ๋ค. Customer Managed Key๋ AWS Managed Key๋ณด๋ค ๋ณด์์ด ์ทจ์ฝํ ์ ์๋ค๊ณ ํ๋จํ ๊ฒ ๊ฐ๋ค.
If enabled: automatic key rotation happens every 1 year
Previous key is kept active so you can decrypt old data : ์ด์ ํค๋ ์ด์ ๋ฐ์ดํฐ๋ค์ ์ํด์ ์ ๋ ์ญ์ ๋๋ฉด ์๋๋ค.
New Key has the same CMK ID (only the backing key is changed)
Automatic Key Rotation์ด ๋ฐ์ํ๋ฉด CMK ID๋ ๋ณ๊ฒฝ๋์ง ์๊ณ ๋ด๋ถ์ (Backing Key)์ค์ ํค ๊ฐ๋ง ๋ณ๊ฒฝ๋๋ค. ๋ฌผ๋ก Old Backing Key๋ save๋๋ค.
Managed Key Rotation์ CMK ID๋ฅผ ๋ณ๊ฒฝํ๋ค.
#127 KMS Manual Key Rotation
90์ผ, 180์ผ ๋ฑ์ ๊ฐ๊ฒฉ์ผ๋ก key๋ฅผ rotateํ ์ ์๋ค.
New Key has a different CMK ID : ๋น์ฐํ backing key๋ ๋ฐ๋๋ค. alias๋ง ์ ์ง ๊ฐ๋ฅ
Better to use aliases in this case (to hide the change of key for the application) : new key๋ฅผ ์์ฑํด๋ ์ ํ๋ฆฌ์ผ์ด์ ์์ api๋ณ๊ฒฝ ์์ด ์ฌ์ฉ๊ฐ๋ฅํ ์ ์๋๋ก ํด์ฃผ๋ ๊ฒ์ด alias์ด๋ค.
Good solution to rotate CMK that are not eligible for automatic rotation (like asymmetric CMK) : ๋น๋์นญํค๋ automatic rotation์ ์ง์ํ์ง ์๋๋ค. ๊ฐ์ธ์ ์ธ ์๊ฒฌ์ผ๋ก๋ ๋น๋์นญํค๋ public, private key 2๊ฐ๊ฐ ์กด์ฌํด์ ์๋ ๊ด๋ฆฌ๊ฐ ์ข ๋ถ๋ด์ค๋ฌ์ด ๊ฒ ๊ฐ๋ค.
#128 SSM Parameter Store
Secure storage for configuration and secrets : ์ค์ ์ ํ์ํ ์ฌ๋ฌ ํ๊ฒฝ ๋ณ์๋ค์ ์ ์ฅํ๊ธฐ์ ์ข์ ์๋น์ค
Serverless, scalable, durable, easy SDK
Version tracking of configurations / secrets : ๋ฒ์ ๋ ์ง์
Notifications with CloudWatch Events : ์ํฌ๋ฆฟ์ ๋ง๋ฃ ๊ธฐํ์ ์ค์ ํ๋ฉด ๋์ค์ ๋ง๋ฃ ๋ฉฐ์น ์ ์ธ์ง event๋ฅผ ๋ฐ์์ํฌ ์ ์๋ค.
SSM Parameter Store Hierarchy
/my-department/my-app/dev/db-url : GetParameters๋ก ์ด ๊ฒฝ๋ก์ ์ ์ฅ๋ ํค๋ฅผ ๋ฐ์์ค๋ ๊ฒ์ด ๊ฐ๋ฅ
/my-department/my-app/dev/amzn2-ami-hvm-x86_64-gp2 : GetParametersByPath๋ก PATH์์ฒด๋ฅผ ๋ฐ์์ค๋ ๊ฒ์ด ๊ฐ๋ฅ
#129 AWS Secrets Manager
Newer service, meant for storing secrets : ์ํฌ๋ฆฟ ํค ์ ์ฅ์ ํนํ๋ Secrets Manager
Capability to force rotation of secrets every X days : rotation์ x-day๋ง๋ค ๋๋ฆด ์ ์๋ค.
Integration with Amazon RDS (MySQL, PostgreSQL, Aurora) : RDS, redshift, documentdb ๋ฑ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ฌ์ฉํ ๋ ๊ถ์ฅ๋๋ ์กฐํฉ์ด๋ค.
๊ทธ๋ฅ AWS Secrets Manager ์์ฑ ์ ์ ์ ์ด๋ฆ, ํจ์ค์๋๋ฅผ ์ ๋ ฅํ๊ณ ์ํ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๊ณ ๋ฅด๋ฉด ํค ๊ด๋ฆฌ + ํค rotation์ ์์์ ํด์ค๋ค๊ณ ๋ณด๋ฉด ๋๋ค.
#130 AWS Shield
AWS Shield Standard
Free service : ๊ธฐ๋ณธ์ผ๋ก ์ธํ ๋๋ฉด ๋ฌด๋ฃ
Provides protection from attacks such as SYN/UDP Floods, Reflection attacks and other layer 3/layer 4 attacks
์ฐธ๊ณ ๋ก SYN/UDP Floods, Reflection attacks์ด ๋ฌด์์ธ์ง๋ ์ค๋ช ํ์ง ์์๋ค. ์ถ์ ๋ฒ์๊ฐ ์๋๊ธฐ ๋๋ฌธ์ด๋ค.
AWS Shield Advanced
$3,000 per month per organization๋ก ๊ต์ฅํ ๋น์ธ๋ค.
DDoS ๋ฐฉ์ด
Protect against higher fees during usage spikes due to DDoS : ๋๋์ค๋ก ์ธํด ํธ๋ํฝ์ด ๊ธ๊ฒฉํ ๋์ด๋๋ ์๊ธ์ด ๋์ด๋์ง ์๋๋ค.
#131 CloudHSM
KMS => AWS manages the software for encryption : KMS๊ฐ ์ํํธ์จ์ด ์ธก๋ฉด์์, aws๊ฐ ์ง์ ํค๋ฅผ ๊ด๋ฆฌํ๋ค๋ฉด
CloudHSM => AWS provisions encryption hardware : CloudHSM๋ ํ๋์จ์ด๋ง ์ ๊ณตํ๊ณ , ์ ์ ๊ฐ ์ง์ ํค๋ฅผ ๊ด๋ฆฌํ๋ค.
Dedicated Hardware : ์ ์ฉ ํ๋์จ์ด
Supports both symmetric and asymmetric encryption (SSL/TLS keys)
No free tier available
Must use the CloudHSM Client Software
Good option to use with SSE-C(๊ณ ๊ฐ ์ ๊ณต ์ํธํ ํค) encryption
CloudHSM Software๊ฐ key์ user๋ฅผ manageํ๋ค. ํ์ฌ ๊ณต๋ถํ ๋ฐ๋ก๋ KMS์์ ์ฐจ์ด์ ์ KMS๋ ํค ๋กํ ์ด์ ์ AWS์์ ํด์ฃผ์ง๋ง CloudHSM์์๋ ์ ์ ๊ฐ ์ง์ ํด์ผ ๋๋ค ์ด ์ ๋ ๊ฐ๋ค.
CloudHSM โ High Availability
Multi AZ
๋๋ฌด๋ ๋น์ฐํ๊ฒ๋ ์ด๋ ๊ฒ ์ค์ํ ๋ณด์ํค๋ Highly availableํด์ผ ํ๊ณ High durability๋ฅผ ๊ฐ์ ธ์ผ ํ๊ณ , ์ญ์ ๊ทธ๋ฐ ํน์ฑ์ ์ง๋๊ณ ์๋ค.
CloudHSM vs KMS : 631p ํํ ์ฐธ๊ณ .
#132 AWS WAF โ Web Application Firewall
Protects your web applications from common web exploits(์น ์ทจ์ฝ์ ๊ณต๊ฒฉ - ์น ์ค๊ณ ์ทจ์ฝ์ ๋ฑ)
Layer 7(HTTP) ์์ ์๋
Application Load Balancer, API Gateway, CloudFront : Layer 7์์ ์๋ํ๋ฏ๋ก ์ด ์ธ๊ฐ์ง์๋ง ์ ์ฉ๋๋ค. ํํ ๊ธฐ์ต.
Web Access Control List : ์ด๋ค ์์ฒญ์ ๋ง์ ๊ฒ์ธ์ง rule์ ์ค์ ํ๋ ๊ฒ์ด๋ค. ์๋๋ rule์ ์ค์ ํด์ ๋ง์ ์ ์๋ ๊ฒ๋ค์ด๋ค.
Rules can include: IP addresses, HTTP headers, HTTP body, or URI strings
Protects from common attack - SQL injection and Cross-Site Scripting(XSS)
geo-match(block countries)
Rate-based rules (to count occurrences of events) โ for DDoS protection
AWS Firewall Manager
Manage rules in all accounts of an AWS Organization : ํ organization์ waf rule, shield advanced, security group for ec2 & eni๋ฑ์ ๊ด๋ฆฌํ๋ค.
#133 Amazon GuardDuty
Intelligent Threat discovery to Protect AWS Account : ๋จธ์ ๋ฌ๋์ ์ฌ์ฉํ๋ ์๋น์ค๋ก, ๊ณ์ ๋ด์ ์ด์ ์งํ๋ฅผ ๊ฐ์งํ๋ค.
GuardDuty๋ก์ ์ธํ์ด ๊ฐ๋ฅํ ๊ฒ๋ค > ๋ณดํต ๋น์ ์์ ์ธ ๊ฒ์ ๊ฐ์งํ๋ค๊ณ ๋ณด๋ฉด ๋๋ค.
CloudTrail Logs: unusual API calls, unauthorized deployments
VPC Flow Logs: unusual internal traffic, unusual IP address
DNS Logs: compromised(์ํ์ด ๋๋) EC2 instances sending encoded data within DNS queries
๋น์ฐํ CloudWatch Event๋ก ์ด๋ฒคํธ๋ฅผ ๋ฐ์์ํฌ ์ ์๋ค.
Can protect against CryptoCurrency attacks(has a dedicated(์ ์ฉ) โfindingโ for it) : ์ํธํํ ๊ณต๊ฒฉ ๋ฐฉ์ด์ ํนํ๋์ด ์๋ค.
#134 Amazon Inspector
Automated Security Assessments for EC2 instances : ์ค์งEC2๋ฅผ ์ํ ๋ณด์ ํ๊ฐ ์๋ํ
OS์์ Inspector Agent๋ฅผ ์ค์นํด์ ๋ณด์ ์ทจ์ฝ์ ์ ํ๊ฐ๋ฐ์ ์ ์๊ณ , ๋ถ์์ด ๋๋๋ฉด report๋ฅผ ๋ฐ์๋ณผ ์ ์๋ค.
Analyze against unintended network accessibility, the running OS against known vulnerabilities : ์๋ํ์ง ์์ ๋คํธ์ํฌ ์ก์ธ์ค, OS๋ณด์ ์ทจ์ฝ์ ๋ถ์
For Network assessments(agentless)
Network Reachability : ๋คํธ์ํฌ ๋๋ฌ๊ฐ๋ฅ์ฑ
For Host assessments(with agent)
Common Vulnerabilities and Exposures : ๋ณดํธ์ ์ธ ๋ณด์์ทจ์ฝ์ ํ์
Center for Internet Security (CIS) Benchmarks(์ฑ๋ฅ ์ธก์ ์ ๋ชฉ์ ์ผ๋ก ํ์ค์ ์ธ ํ ์คํธ ์คํ)
#135 Amazon Macie
Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to discover and protect your sensitive data(PII : Personally identifiable information) in AWS : s3 bucket์ ๋ถ์ํด์ sensitiveํ data๊ฐ ์กด์ฌํ๋ค๋ฉด notify๊ฐ๋ฅ
#136 AWS Shared Responsibility Model
AWS responsibility - Security of the Cloud
Protecting infrastructure(hardware, software, facilities, and networking) that runs all the AWS service : aws ์๋น์ค์ ๊ธฐ๋ฐ ๊ด๋ฆฌ๋ ๋น์ฐํ aws์ ์ฑ ์์ด๋ค. ํ๋์จ์ด๋ ๋ฌผ๋ก ์ด๊ณ , ์๋น์๊ฐ ์ฌ์ฉํ๋ software์ ์ด์์ด ์๊ธฐ๋ฉด ์๋๋ค. ์ํํธ์จ์ด๋ผ ํจ์ ๋ฐ๋ก ์์์ ์ดํด๋ณธ macie๋ฅผ ์๋ก ๋ค๋ฉด, ๋จธ์ ๋ฌ๋์ ํตํด์ sensitive data๋ฅผ ํ์ ํ๋๋ฐ sensitiveeํ์ง ์์ data๋ฅผ sensitiveํ๋ค๊ณ ํ๋จํ๋ฉด ์๋ ๊ฒ์ด๋ฏ๋ก ์ง์ ์ธ ์ธก๋ฉด์์ aws๋ ๊ธฐ์ ์ ๋ฐ์ ์ ํ์จ์ผ ํ๋ค.
Customer responsibility - Security in the Cloud
For EC2 instance, customer is responsible for management of the guest OS (including security patches and updates), firewall & networkconfiguration, IAM : EC2์ ๋ณด์์ ์ฌ์ฉ์๊ฐ ์ง์ ๊ด๋ฆฌํ๋ค.
Encrypting application data : ์ญ์ encryptํ ๊ฒ์ธ์ง ๋ง ์ง๋ ์ฌ์ฉ์๊ฐ ๊ด๋ฆฌํ๋ค. aws๋ ๋จ์ํ ์๋น์ค๋ง ์ ๊ณตํด์ค๋ค.
Shared controls : aws์ customer๊ฐ ๊ณต์ ํ๋ ์ฑ ์
Patch Management(๋ฒ์ ํจ์น), Configuration Management(์ค์ ๊ด๋ฆฌ), Awareness & Training
645p ๋ํ ์ฐธ๊ณ .
#137 VPC(Virtual Private Cloud)
CIDR(Classless Inter-Domain Routing) โ IPv4
์ฌ์ด๋๋ผ๊ณ ๋ถ๋ฅด๋ ์ต์ ์ IP ์ฃผ์ ํ ๋น ๋ฐฉ๋ฒ.
๊ธฐ์กด IP ์ฃผ์ ํ ๋น ๋ฐฉ๋ฒ์ธ ๋คํธ์ํฌ ํด๋์ค๋ฅผ ๋์ฒดํ๋ค.
๋ณด์ ๊ทธ๋ฃน ๋ฃฐ์์ ์ฌ์ฉํ๋ ip๊ฐ ๋ฐ๋ก ์ด CIDR์ด๋ค.
๊ธฐ์กด A,B,C,D,Eํด๋์ค๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๋นํด ์ฌ์ด๋๋ ์ ์ฐ์ฑ์ ๋ํด์ค๋ค.
classful addressing vs CIDR(์ CIDR์ด classful์ ๋นํด์ ์ข์๊ฐ) : https://www.practicalnetworking.net/stand-alone/classful-cidr-flsm-vlsm/
Private IP(์ฌ์ค IP) can only allow certain values : ์ฌ์ค IP๋ ํน์ ๊ฐ๋ง ํ ๋นํ๋๋ก IANA๊ฐ ์ ํ ๊ท์น์ด ์กด์ฌํ๋ค.
10.0.0.0 โ 10.255.255.255 (10.0.0.0/8) > in big networks
172.16.0.0 โ 172.31.255.255 (172.16.0.0/12) > AWS default VPC in that range
192.168.0.0 โ 192.168.255.255 (192.168.0.0/16) > home networks
์๋ธ๋ท ๋ง์คํฌ์ ๋ฒ์๋ ์ธ์ ๋ ์ง ๋ฐ๋ ์ ์๋ค.
์ 3๊ฐ์ง๋ฅผ ์ ์ธํ ๋๋จธ์ง๋ ์ ๋ถ ๊ณต์ธ IP(Public IP)
Default VPC
All new AWS accounts have a default VPC : ๋ชจ๋ aws ๊ณ์ ์ ๊ธฐ๋ณธ VPC๋ฅผ ๊ฐ์ง๋ค.
New EC2 instances are launched into the default VPC if no subnet is specified : ์ง์ ๋ง๋ VPC๊ฐ ์๋ค๋ฉด ์๋ก์ด EC2๋ default VPC์ ํ ๋น๋๋ค.
Default VPC has Internet connectivity and all EC2 instances inside it have public IPv4 addresses : Default VPC๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์ธํฐ๋ท์ ์ฐ๊ฒฐ์ ๊ฐ๋ฅํ๋๋ก ์ค์ ๋์ด ์์ด์, ec2 ์ธ์คํด์ค๋ ์ธํฐ๋ท์ ๋ชจ๋๊ฐ ์์๋ณผ ์ ์๋ ๊ณต์ธ ip๋ฅผ ๊ฐ์ง๋ค. ์ฆ ec2 ์ธ์คํด์ค๋ฅผ ์์ฑํ๋๋ฐ ๋ณด์๊ทธ๋ฃน ํฌํธ๋ฅผ 22๋ฒ์ผ๋ก ์ค์ ํด์ฃผ์์ ๋ ssh๋ก ec2์ ์ ์๊ฐ๋ฅํ๋ ๊ฒ์ด ์ธํฐ๋ท์ด ์ฐ๊ฒฐ๋์ด ์๊ธฐ ๋๋ฌธ์ด๋ค. ์ธํฐ๋ท์ด ์ฐ๊ฒฐ๋์ด ์์ง ์์๋ค๋ฉด ec2์ธ์คํด์ค์ ๊ณต์ธ ip๋ฅผ ์ฐพ์ ์ ์์์ ๊ฒ์ด๋ค.
We also get a public and a private IPv4 DNS names : ๊ณต์ธ ip, ์ฌ์ค ip๊ฐ ๋ชจ๋ ํ ๋น๋๋ค.
VPC Overview
You can have multiple VPCs in an AWS region(max 5 per region โ soft limit) : ํ ๋ฆฌ์ ๋น ์ต๋ 5๊ฐ(์ํํธ ๋ฆฌ๋ฐ)์ vpc๋ฅผ ๊ฐ์ง ์ ์๋ค.
Max CIDR per VPC is 5, for each CIDR : ์์ ๋น์ทํ๊ฒ VPC๋น CIDR์ ์ต๋ 5๊ฐ ํ ๋น ๊ฐ๋ฅํ๋ค.
CIDR์ subnet mask๋ 16๋ถํฐ 28๊น์ง์ด๋ค.
Min size is /28 (16 IP addresses)
Max size is /16 (65536 IP addresses)
Because VPC is private, only the Private IPv4 ranges are allowed : VPC๋ ๋ง ๊ทธ๋๋ก privateํ๊ธฐ ๋๋ฌธ์ private ip๋ง ํ ๋น ๊ฐ๋ฅํ๋ค.
Your VPC CIDR should NOT overlap with your other networks : ๋น์ฐํ ๋ง์ด์ง๋ง CIDR์ ๋ค๋ฅธ ๋คํธ์ํฌ์ ๊ตฌ๋ณ์ด ๊ฐ๋ฅํด์ผ ํ๋ฏ๋ก ๋ค๋ฅธ ๋คํธ์ํฌ์ ๋ฎ์ด์์ฐ๋ฉด ์๋๋ค.
Subnet
AWS reserves 5 IP addresses (first 4 & last 1) in each subnet : aws vpc์ ์๋ธ๋ท ๋ด์ 5๊ฐ์ ์ฌ์ค ip๋ ์์ฝ๋ ip๋ก, ip๋ฅผ ํ ๋นํ ๋ ์ฌ์ฉํ ์ ์๋ค.
ex) 10.0.0.0, 10.0.0.1 - vpc router, 10.0.0.2 - mapping for dns, 10.0.0.3 - mapping for future use, 10.0.0.255
Internet Gateway(IGW)
VPC๋ด๋ถ์ ์์๋ค์ ์ธํฐ๋ท์ ์ฐ๊ฒฐํด์ฃผ๋ ์ญํ
It scales horizontally and is highly available and redundant : ๊ณ ๊ฐ์ฉ์ฑ, ์ฉ์ฅ์ฑ(์ผ๋จ ์ฌ์ ๋ถ ์กด์ฌ๋ก ์ดํดํจ)
Must be created separately from a VPC : VPC์ ๋ฐ๋ก ์์ฑํด์ผ ํ๋ค!
One VPC can only be attached to one IGW and vice versa : VPC์ IGW๋ ๋ฌด์กฐ๊ฑด 1:1๋งค์นญ์ด๋ค.
Bastion Hosts
private subnet์ ์ธํฐ๋ท ์ฐ๊ฒฐ์ด ์๋ ssh์ ์๋ง์ ์ํ ๋ ์ฌ์ฉํ๋ค.
private subnet์ ์ธํฐ๋ท์ ์ฐ๊ฒฐํ๋ ค๋ฉด NAT Instance or NAT Gateway๋ฅผ ์ฌ์ฉํด์ผ ํ๋ค.
The bastion is in the public subnet which is then connected to all other private subnets : ๊ฐ์ ์๋ฃ์์ ์ค๋ช ํ bastion host๋ VPC๋ด๋ถ์ public subnet๊ณผ private subnet์ด ์กด์ฌํ ๋, public subnet๋ด๋ถ์ ec2 instance๊ฐ ์๊ณ , ์ด ec2 instance๋ง private subnet์ ์ ๊ทผ๊ฐ๋ฅํ๋ค.
Bastion Host security group must be tightened : bastion host์ ์ ๊ทผํ๋ฉด ์ฌ์ค์ private subnet์ ์ ๊ทผํ ๊ฐ๋ฅ์ฑ์ด ์๊ธฐ๋ ๊ฒ์ด๋ฏ๋ก, bastion host์ ์ ๊ทผํ ์ ์๋ ๋ณด์ ๊ทธ๋ฃน์ tightํ๊ฒ ์ค์ ํด์ผ ํ๋ค. ์ฆ 22๋ฒ ํฌํธ๋ง ํ์ํ IP๋ฅผ ๋์์ผ๋ก ์ด์ด๋๋ ๊ฒ์ด ์ข๋ค.(์ํ)
#138 Bastion Host Hands-on
public subnet์ instance(๊ณต์ธ IP ์กด์ฌ)์์ ssh๋ก private subnet์ ์ธ์คํด์ค์ ์ ์ํ๋ ๊ฒ์ ์งํํ๋ค. private subnet์์ ์ธํฐ๋ท ์ฌ์ฉ ๋ถ๊ฐ.
#139 NAT Instance Hands-on
amazon nat instance ami๋ฅผ ์ฌ์ฉํด NAT Instance๋ฅผ ๋ง๋ค๊ณ , ๋ณด์ ๊ทธ๋ฃน์ 22 : SSH, 80 : HTTP(VPC CIDR), 443 : HTTPS(VPC CIDR), ICMP(VPC CIDR)๋ฅผ ํ์ฉํ๋ค.
Source / destination check disable
private subnet์ route table์ ๋ก์ปฌ ๋คํธ์ํน์ ์ ์ธํ ๋๋จธ์ง destination์ NAT Instance๋ฅผ ํฅํ๊ฒ ์ค์
์ดํ, private subnet์ ์ธ์คํด์ค์์ ping, curl๋ฑ์ ์ธํฐ๋ท ์ฌ์ฉ์ด ๊ฐ๋ฅํจ
๊ฒฐ๋ก ์ ์ผ๋ก private subnet์ด ์ธํฐ๋ท์ ๋ ธ์ถ๋์ง ์์ ์ํ์์ NAT์ ์ด์ฉํด ์ธํฐ๋ท์ ์ฌ์ฉํ ์ ์์
#140 Public Subnet vs Private Subnet
๊ฐ์ ์๋ฃ์๋ ์์ง๋ง ๋ฐ๋ก ์ ๋ฆฌํ๋ ๊ฒ
subnet์ ๋ง๋ค ๋ public์ผ๋ก ํ ์ง private์ผ๋ก ํ ์ง ์ ํ๋์ด ์๋ ๊ฒ์ด ์๋๋ค.
์ฌ์ฉ์๊ฐ ์ด ์๋ธ๋ท์ public์ผ๋ก ํ ๊ฒ์ด๊ณ , ๋ค๋ฅธ ์๋ธ๋ท์ private์ผ๋ก ํ ๊ฒ์ผ๋ก ์ง์ ์ ํ๋ ๊ฒ์ด๋ค. ๊ทธ๋ ๊ธฐ์ ๋ค์ด๋ฐ์ด ์ค์ํ๋ค.
๊ฐ์์์๋ public subnet์ subnet์ต์ ์์ auto-assign public ip๋ฅผ ํ์ฑํํด์, ๊ณต์ธ ip๋ฅผ ์๋ํ ๋นํ๋ค. (์์ง ๋๋ฉ์ธ ๋ค์ ์ค์ ์ ํ์ง ์์์ผ๋ฏ๋ก ๋๋ฉ์ธ ๋ค์ ์กด์ฌ x)
๋ฐ๋ผ์ ์ธํฐ๋ท์์ public subnet์ auto assign๋ ip๋ก ์ด ์๋ธ๋ท์ ์์๋ณผ ์ ์๊ณ , public subnet๋ํ IGW, Route table์ ํตํด์ ์ธํฐ๋ท์ ์ก์ธ์ค ํ ์ ์๋ ์๋ฐฉํฅ์ ํต์ ์ด ๊ฐ๋ฅํด์ก๋ค.
์ฐธ๊ณ ๋ก route table์ public subnet, private subnet์ ํ ๊ฐ์ฉ ๋ฐ๋ก ๋ง๋ค์๋ค.
#141 NAT Instance
Deprecated๋์๊ณ , NAT Gateway์ ํ์ํธํ์ด๋ค.
Not highly available
highly availableํ๊ฒ ๋ง๋๋ ค๋ฉด asg๋ฅผ multi-az์ ๋ง๋๋ ๋ฑ ์ถ๊ฐ์ ์ธ ์๊ณ ๊ฐ ๋ค์ด๊ฐ๋ค.
Internet traffic bandwidth depends on EC2 instance type
NAT = Network Address Translation
Allows EC2 instances in private subnets to connect to the Internet : public subnet์ด ์๋ private subnet์ด ์ธํฐ๋ท์ ์ ์ ๊ฐ๋ฅํ๋๋ก ํด์ค๋ค.
Must be launched in a public subnet : public subnet์ internet gateway, route table์ ์ฌ์ฉํ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ด๋ค.
Must disable EC2 setting: Source / destination Check : NAT์ด๋ฆ์์๋ ๋ณผ ์ ์๋ฏ ์์ฒญ ๊ฐ์ src, dest๋ฅผ ๋ฐ๊พธ๊ธฐ ๋๋ฌธ์ด๋ค.
Must have Elastic IP attached to it : ๊ณ ์ ip ์ฃผ์๋ฅผ ๊ฐ์ ธ์ผ๋ง ํ๋ค.
Route Tables must be configured to route traffic from private subnets to the NAT Instance : route table์ ๋ก์ปฌ ๋คํธ์ํนํ ๊ฒฝ์ฐ๊ฐ ์๋ ๊ฒฝ์ฐ ๋ชจ๋ ํธ๋ํฝ์ NAT Instance๋ฅผ ๋ฐ๋ผ๋ณด๊ฒ ํด์ผ ํ๋ค.
#142 NAT Gateway
AWS-managed NAT, higher bandwidth, high availability, no administration : ๊ด๋ฆฌ๊ฐ ํ์์๋ ๋ฐ๋ค๊ฐ ๋ณด์๊ทธ๋ฃน ์ค์ ๋ ํ์์๋ค.
NATGW is created in a specific Availability Zone, uses an Elastic IP
Canโt be used by EC2 instance in the same subnet (only from other subnets) : private subnet์ด ์๋ public subnet์ ๋ง๋ค์ด์ผ ํ๋ค.
Requires an IGW (Private Subnet => NATGW => IGW) : NAT ๊ฒ์ดํธ์จ์ด ์ญ์ IGW๋ฅผ ์ฌ์ฉํ๋ค.
5 Gbps of bandwidth with automatic scaling up to 45 Gbps
NAT Gateway is resilient within a single Availability Zone : NAT Gateway๋ ์ฑ๊ธ AZ์ ๋ํด์๋ง ํ๋ณต ํ๋ ฅ์ฑ์ ๊ฐ์ง๋ค.
Must create multiple NAT Gateways in multiple AZs for fault-tolerance : fault-tolerance๋ฅผ ์ํด์๋ multi az์ NAT Gateway๋ฅผ ๋ง๋ค์ด์ผ ํ๋ค.
There is no cross-AZ failover needed because if an AZ goes down it doesn't need NAT : ํ AZ๊ฐ ๋ค์ด๋์๋ค๋ฉด NAT๊ฐ ํ์ ์๋ค.
#143 DNS Resolution in VPC
DNS Support : ์ด๋ฅผ ์ฌ์ฉํ๋ฉด Route 53 Resolver๋ฅผ ์ฌ์ฉํ ์ ์๊ธฐ์ Custom DNS server๋ฅผ ๋ฐ๋ก ๋ง๋ค๊ฑฐ๋ ์ฌ์ฉํ ํ์๊ฐ ์๋ค.
DNS Hostnames : ์ด๋ฅผ ์ฌ์ฉํ๋ฉด private dns๋ฅผ ์ฌ์ฉํ ์ ์๋ค. ๋ํ private์ด๊ธฐ ๋๋ฌธ์ ๋๋ฉ์ธ ๋ค์์ ๊ตฌ๋งคํ ํ์๊ฐ ์๋ค.
VPC DNS Hostname์ ํ์ฑํํ๋ฉด public subnet์์ public ipv4์ ๋ณด์ ํ๊ณ ์๋ ์ธ์คํด์ค๋ public ipv4 DNS๋ ๊ฐ๊ฒ ๋๋ค.
์ ๋๊ฐ์ง๋ฅผ ๋์์ ์ฌ์ฉํ๋ฉด, Route 53 Resolver์ private ๋๋ฉ์ธ ๋ค์์ ์ฟผ๋ฆฌํ๋ฉด private ip๋ฅผ ๋๋๋ ค์ค๋ค.
Route 53 Hosted Zone์ ์ฌ์ฉํด private domain name ์ฌ์ฉํ๊ธฐ
VPC์์ enableDnsSupport & enableDnsHostname ํ์ฑํ(์ ํด๋ ์ค์ ์ฐฝ์์ ๋์ค์ ํ๊ฒ ๋จ)
Route 53 Hosted Zone ์ ์
ํธ๋ํฝ์ aws VPC์์ ๋ผ์ฐํ ํ๋ Private Hosted Zone์ ํ
Specific VPC ์ ํ
์์์ ์ค์ ํ VPC๋ฅผ ์ฌ์ฉํ๋ ๋ฐ์คํฐ์จ ํธ์คํธ์ ์ ์
Route53์ private domain name(ex. google.demo.internal)์ ๋ํด์ CNAME๋ ์ฝ๋์ ๊ฐ์ผ๋ก www.google.com์ ์ ๋ ฅํ๋ฉด www.google.com์ ์ ์ํ ์ ์๋ค.(์ธํฐ๋ท ๊ฒ์ดํธ์จ์ด & Route table & NAT Gateway ํ์ฑํ ์ํ)
๊ฒฐ๋ก ์ ์ผ๋ก Route 53 Private Hosted Zone์ ์ฌ์ฉํ๋ค๋ฉด VPC์์์ private domain name์ ์ฌ์ฉํ ์ ์๋ค. ์ธํฐ๋ท ๊ฒ์ดํธ์จ์ด & Route table & NAT Gateway ํ์ฑํ ์ํ๋ผ๋ฉด private domain name๊ณผ public domain name์ ๋์์ ์ฌ์ฉํ ์ ์์ด์ ๊ต์ฅํ ์ ์ฉํ๋ค. (์์์ ๋ณธ google.demo.internal(private domain name)๊ณผ www.google.com(public domain name)์ ๋์์ ์ฌ์ฉํ ๊ฒ์ด ๊ทธ ์์ด๋ค.)
#144 Security Groups & NACLs
NACL : ์์ฒญ ๋ฐ ์๋ต์ ๋ํด Statelessํ๋ค. Statelessํ๋ค๋ ๊ฒ์ ์ํ๊ฐ ์๊ธฐ ๋๋ฌธ์ ์์ฒญ ๋ฐ ์๋ต์ ํญ์ ํ๊ฐ๋๋ค.
Security Group : ์์ฒญ ๋ฐ ์๋ต์ ๋ํด Statefulํ๋ค. Statefulํ๋ค๋ ๊ฒ์ ์ํ๊ฐ ์๊ธฐ ๋๋ฌธ์ ์์ฒญ ๋ฐ ์๋ต์ด ์ํ์ ๋ฐ๋ผ ํ๊ฐ๋๋ค. ๋ฐ๋ผ์ Inbound๊ฐ ํ์ฉ๋์๋ค๋ฉด ๊ทธ์ ๋ฐ๋ฅธ Outbound๋ ํ์ฉ๋๊ณ vice versa์ด๋ค.
#145 Network Access Control List (NACL)
NACL are like a firewall which control traffic from and to subnets : ์๋ธ๋ท ๋ฐฉํ๋ฒฝ๊ณผ ๊ฐ์
One NACL per subnet, new subnets are assigned the Default NACL : ์๋ธ๋ท๊ณผ NACL์ 1:1 ๋งคํ์ด๋ค.
default NACL์ ๋ชจ๋ ์์ฒญ๊ณผ ์๋ต์ ํ์ฉํ๋ค.
Newly created NACLs will deny everything
default๊ฐ ์๋ ์ปค์คํ ์์ฑ๋ NACL์ ๊ธฐ๋ณธ ๋ฃฐ๋ก ๋ชจ๋ ์์ฒญ๊ณผ ์๋ต์ denyํ๋ค.
NACL are a great way of blocking a specific IP address at the subnet level : ๋ณด์ ๊ทธ๋ฃน์ ec2 instance level
#146 Ephemeral Ports
์๋ต์ด ์์ฒญ๋ ip์ ํฌํธ์ ์ ๋ฌ๋๊ธฐ ์ํด์ ์์ ํฌํธ๋ฅผ ์ฌ์ฉํ๋๋ฐ, ์ด๊ฒ์ ephemeral port๋ผ๊ณ ๋ถ๋ฅธ๋ค.
677p ๋ค์ด์ด๊ทธ๋จ ์ฐธ๊ณ : ์์ ํฌํธ๊ฐ ๋ ์ ์๋ ๋ชจ๋ ํฌํธ๋ฅผ inbound, outbound rule์์ ํ์ฉํด์ค์ผ ํ๋ค.
#147 Security Group vs NACLs
679p ํ ํํ ์ฐธ๊ณ
#148 More On VPC
679p ์ดํ๋ ๋ค์ด์ด๊ทธ๋จ, ์์๋ฅผ ๋ณด๋ ๊ฒ์ด ํธํ๋ค. VPC Section์ ์๋ฃ๋ฅผ ๋ณด์.
#149 ClassicLink
ec2 classic์ ํ์ฌ ๋ง๋ค ์ ์์ ๊ทธ๋ฅ ๋ฐฐ๊ฒฝ์ง์ classic link๋ํ ๊ณผ๊ฑฐ์ ec2 classic ๋๋ฌธ์ ์กด์ฌํ๋ ๊ฒ
#150 VPC Endpoints & Private Link
VPC Endpoint์ VPC PrivateLink๋ ๋์ผํ VPC Endpoint๋ฅผ ์ฌ์ฉํ๋๋ฐ, ์ฐจ์ด์ ์ VPC PrivateLink๋ ๋คํธ์ํฌ ๋ก๋๋ฐธ๋ฐ์๋ ๊ฒ์ดํธ์จ์ด ๋ก๋๋ฐธ๋ฐ์๋ฅผ ์ฌ์ฉํ ์ปค์คํ Endpoint Service๋ฅผ ๋ง๋ ํ CreateVPCEndpoint์์ find service by name ํด์ผํ์ง๋ง, VPC Endpoint๋ ์ปค์คํ Endpoint Service๋ฅผ ๋ง๋ค ํ์ ์์ด CreateVPCEndpoint์์ AWS Service๋ฅผ ์ ํํ๊ณ ์ํ๋ Interface, Gateway๋ฅผ ๊ณ ๋ฅด๋ฉด ๋๋ค.๋น์ฐํ ์ด๋ฅผ ์ฌ์ฉํ๋ ์ด์ ๋ ๋์ผํ๊ฒ ์ ์ฒด vpc๋ฅผ ๋ ธ์ถํ์ง ์๊ณ ์ํ๋ ์๋น์ค์ ๋ํด์๋ง ๋ ธ์ถํ๊ณ private network(aws network)๋ฅผ ์ฌ์ฉํด public network๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ง ์์ ๋ ์ฌ์ฉํ๋ค.
#151 Direct Connect
Direct Connect โ Connection Types : Lead times are often longer than 1 month to establish a new connection : ์๋ก์ด ์ปค๋ฅ์ ์ ๋ง๋๋๋ฐ 1๋ฌ ์ด์์ด ๊ฑธ๋ฆฌ๋ฏ๋ก ์ค๊ณ ์ด์ ์ ์ธ์งํ๊ณ ์์ด์ผ ํ๋ค.
#152 ECMP(Equal-cost multi-path routing)
VPN to private virtual gateway : two tunnel์ ํ๋์ forward, ํ๋์ backward๋ก ๋์์ ์ด๋ค์ง ์ ์์
VPN to transit gateway : two tunnel์ ๋ ๊ฐ์ tunnel์ ๋์์ ์ฌ์ฉํ๋ฏ๋ก ecmp๋ฅผ ๊ตฌํํ๊ณ , increase bandwidth์ด๋ฉฐ, ๊ฒ์ดํธ์จ์ด๋ฅผ ํตํด ์ ์ก๋ gb๋งํผ payํจ
#153 Route Table
VPC Peering : route table๋ก ์ด๋ค private ip์ผ ๊ฒฝ์ฐ ์ด๋ป๊ฒ ๋ผ์ฐํ ๋ ๊ฒ์ธ์ง๋ฅผ ๊ฐ VPC์ ๋ผ์ฐํ ํ ์ด๋ธ๋ง๋ค ์ ํด์ผ ํจ. VPC Peering hands on ์ฐธ๊ณ
VPC Endpoint Gateway : ๋ ํ๋ VPC Endpoint interface์ ํ๊ณผ ๋ฌ๋ฆฌ VPC Endpoint Gateway๋ ๋ผ์ฐํธ ํ ์ด๋ธ์ ์ ์ฉ๋๊ธฐ ๋๋ฌธ์ ์ด๋ค subnet route table์ ์ ์ฉํ ๊ฑด์ง ์ ํํด์ผ ํ๋ค. ex. private subnet route table์ ์ ์ฉํ๋ฉด route table์ ์๋์ผ๋ก private link๊ฐ ์ ์ฉ๋จ(s3, dynamoDB only)
VPC Endpoint interface์ ํ์ ํน์ aws์๋น์ค๋ฅผ ์ ํํ ํ VPC์ Subnet, security group์ ์ค์ ํด์ผ ํจ
#154 RPO and RTO
RPO(Recovery Point Objective) : ์ฝ๊ฒ ๋งํ๋ฉด ์ธ์ด๋ธ ์์ ์ด๋ค. ์ธ์ด๋ธ ์์ ์ดํ์๋ ๋ฐฑ์ ์ด ๋์ง ์์์ผ๋ฏ๋ก ์ธ์ด๋ธ ์์ ๋ถํฐ disaster๋ฐ์ ์์ ๊น์ง๋ ๋ฐ์ดํฐ ์์ค์ด ์๊ธด๋ค.
RTO(Recovery Time Objective) : Disaster๋ฐ์ ์์ ๋ถํฐ RTO๊น์ง ๊ฑธ๋ฆฐ ์๊ฐ์ด downtime์ด๋ค.
#155 DMS โ Database Migration Service
DMS๋ Schema Conversion Tool(SCT)๋ฅผ ์ฌ์ฉํด์ ์คํค๋ง๊ฐ ๋ค๋ฅธ db๊ฐ์ ๋ง์ด๊ทธ๋ ์ด์ ๋ ์ง์ํ๋ค.
๋ํ Continuous Replication์ด ๊ฐ๋ฅํด์ ์คํ์ค์ธ ์๋น์ค์ db๋ง์ด๊ทธ๋ ์ด์ ๋ ์ ์ง์ ์ผ๋ก ๊ฐ๋ฅํ๋ค.
#156 AWS DataSync
๋ง์ ์์ ๋ฐ์ดํฐ๋ฅผ on-premise์๋ฒ์์ aws๋ก ์ฎ๊ธฐ๋ ์๋น์ค
Amazon S3 (any storage classes โ including Glacier), Amazon EFS, Amazon FSx for Windows
Move data from your NAS or file system via NFS or SMB : NAS(Network Attached Service)๋ก๋ถํฐ NFS(Network File System) or SMB(Server Message Protocol)ํ๋กํ ์ฝ์ ์ฌ์ฉํด์ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌํ๋ค.
Replication tasks can be scheduled hourly, daily, weekly : ์ค์๊ฐ์ด ์๋ ์ค์ผ์ฅด๋ง ์๋น์ค์ด๋ค.
Leverage the DataSync agent to connect to your systems : on-premise ์๋ฒ์ datasync agent๊ฐ ์ค์น๋์ด ์์ด์ผ ํ๋ค.
#157 High Performance Computing(HPC)
EC2 Enhanced Networking(SR-IOV) : ENA๋ฅผ ์ฌ์ฉํจ์ผ๋ก์จ 100 Gbps๊น์ง ๋คํธ์ํน ์๋๋ฅผ ์ฌ๋ฆด ์ ์๋ค.
Elastic Network Adapter(ENA) up to 100 Gbps
Elastic Fabric Adapter(EFA) : ENA์ ๊ฐํ ๋ฒ์ ์ธ EFA๋ ์กด์ฌํ๋ค.
Improved ENA for HPC, only works for Linux
Great for inter-node communications, tightly coupled workloads
#158 CloudFormation
Terraform๊ฐ์ Infrastructure as code
Resources: your AWS resources declared in the template(MANDATORY) : Cloudformation์ผ๋ก ์ฝ๋๋ฅผ ์์ฑํ ๋ resource๋ ํ์์ ์ผ๋ก ์ ์ด์ผ ํ๋ค๋ ์๋ฏธ์ด๋ค.
CloudFormation StackSets
ํ ์ฝ๋๋ก ์ฌ๋ฌ ๊ณ์ , ์ฌ๋ฌ ๋ฆฌ์ ์ infrastruture๋ฅผ ์ ์ดํ ์ ์๋ค.
#159 AWS Step Functions
Build serverless visual workflow to orchestrate your Lambda functions : ๋ค์ด์ด๊ทธ๋จ์ ํตํด workflow๋ฅผ ๊ทธ๋ฆฌ๋ฉด, lambda function์ sequence๋ฅผ ๋ง๋ค ์ ์๊ฒ ๋๋ค. ํ ๋ง๋๋ก ๋๋ค function์ ์์ ๋ฐ ๊ตฌ์ฑ๋๋ฅผ ๋ณด๋ฉด์, ์ค์ ์งํ์ํฉ์ ๊ด์ฐฐํ๋ฉฐ ์คํ์ ํ ์ ์๋ ์๋น์ค์ด๋ค.
AWS SWF(Simple Workflow Service)
AWS Step Functions์ด ๊ถ์ฅ๋๊ณ SWF๋ deprecated๋ฒ์ ์ด๋ค.
์๋ ๋ ๊ฒฝ์ฐ์ผ ๊ฒฝ์ฐ์๋ง ์ ์ธํ๊ณ ๋ชจ๋ Step Function์ ์ฌ์ฉํ๋ฉด ๋๋ค.
If you need external signals to intervene in the processes
If you need child processes that return values to parent processes
#160 Amazon EMR
EMR helps creating Hadoop clusters(Big Data) to analyze and process vast amount of data
The clusters can be made of hundreds of EC2 instances, Auto-scaling and integrated with Spot instances
#161 AWS Opsworks
Chef & Puppet help you perform server configuration automatically, or repetitive actions : ์๋ฒ config ์ค์ ์๋ํ
Chef / Puppet have similarities with SSM / Beanstalk / CloudFormation but theyโre open-source tools that work cross-cloud : Chef, Puppet์ ์คํ์์ค์ด๊ธฐ ๋๋ฌธ์ ํน์ ํด๋ผ์ฐ๋ ์ ์ฒด์ ๊ตญํ๋์ง ์๊ณ ์ฌ์ฉ ๊ฐ๋ฅ
#162 AWS WorkSpaces
Managed, Secure Cloud Desktop : ๊ด๋ฆฌํ์ด์ ๋ณด์๊ฐํํ์ ํด๋ผ์ฐ๋ ๋ฐ์คํฌํ ์๋น์ค
Great to eliminate management of on-premise VDI(Virtual Desktop Infrastructure) : on-premise์ ์์์ ํด๋ผ์ฐ๋์์ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ on-premise์ VDI๋ฅผ ์ ๊ฑฐํ ์ ์๋ค๊ณ ํํํ ๊ฒ
On Demand, pay per by usage : ์ฌ์ฉํ ๋งํผ ๋ ์ง๋ถ
Microsoft Active Directory์ ํตํฉ ๊ฐ๋ฅ
#163 Cost Explorer โ Savings Plan์กด์ฌ
#164 Well Architected Framework 5 Pillars
1.Operational Excellence : Includes the ability to run and monitor systems to deliver business value and to continually improve supporting processes and procedures
๋์ ํ์์ฑ : ๋น์ฆ๋์ค ๊ฐ์น๋ฅผ ์คํํ๊ณ ๋ชจ๋ํฐ๋งํ๋ฉฐ ์ด์์ด ์๋์ง ๊ด์ฐฐํ ์ ์์ด์ผ ํ๋ฉฐ, ์ง์์ ์ผ๋ก ํ๋ก์ธ์ค์ ์ ์ฐจ๋ฅผ ๊ฐ์ ์์ผ๋๊ฐ์ผํ๋ค.
2.Security : Includes the ability to protect information, systems, and assets while delivering business value through risk assessments and mitigation strategies
๋ณด์ : ๋น์ฆ๋์ค ๊ฐ์น๋ฅผ ์ ๋ฌํจ๊ณผ ๋์์ ์ํ์ ๋ํ ํ๊ฐ๋ฅผ ์คํํ๋ฉฐ, ์ํ ์ํ ์ ๋ต์ ์ธ์ฐ๊ณ ์ ๋ณด, ์์คํ , ์์๋ค์ ๋ณดํธํ ์ ์์ด์ผ ํ๋ค.
3.Reliability : Ability of a system to recover from infrastructure or service disruptions, dynamically acquire computing resources to meet demand, and mitigate disruptions such as misconfigurations or transient network issues
์ ๋ขฐ์ฑ : ์ธํ๋ผ๋ ์๋น์ค์ ๋ค์ด์ด ๋ฐ์ํด๋, ๋์ ์ผ๋ก ์ปดํจํ ๋ฆฌ์์ค๋ค์ ์์์ ๋ง๊ฒ ๊ณต๊ธํด์ผ ํ๋ฉฐ ์ค์ ์ค๋ฅ, ๋คํธ์ํฌ ์ง์ฐ๊ณผ ๊ฐ์ ์ด์๋ค์ ์ํํ ์ ์์ด์ผ ํ๋ค.
4.Performance Efficiency : Includes the ability to use computing resources efficiently to meet system requirements, and to maintain that efficiency as demand changes and technologies evolve
ํผํฌ๋จผ์ค ํจ์จ์ฑ : ์์คํ ์ ์๊ตฌ์ ๋ง๋ ์ปดํจํ ์์์ ์ฌ์ฉํ ์ค ์์์ผ ํ๋ฉฐ, ๊ทธ ์์๋ค์ ๊ธฐ์ ์งํ์ ๋ฐ๋ผ ํจ์จ์ ์ผ๋ก ์ ์ง๋ณด์ํ ์ ์์ด์ผ ํ๋ค.
5.Cost Optimization : Includes the ability to run systems to deliver business value at the lowest price point
๊ฐ์ฅ ๋ฎ์ ๊ฐ๊ฒฉ์ผ๋ก ๋น์ฆ๋์ค ๊ฐ์น๋ฅผ ์ ๋ฌํ ์ค ์์์ผ ํ๋ค.
AWS Well-Architected Tool๋ฅผ ์ฌ์ฉํด์ ์ ์ง๋ฌธ์ ๋ํด ๋ณด์ ๊ฐ๋ฅ(AWS Well-Architected Tool : ์ 5๊ฐ์ง ํต์ฌ ์ฝ์ด์ ๋ํ ์ง๋ฌธ๋ค๋ก ๊ตฌ์ฑ)
์๋ต ๊ฒฐ๊ณผ์ ๋ํ ๋ฆฌํฌํธ ์ ๊ณต, best practice ์ ๊ณต
#165 Trusted Advisor
High level AWS account assessment : ์์ ๋ ๋ฒจ์ AWS ๊ณ์ ํ๊ฐ, ๋ถ์ ์๋น์ค
5 Standards
Cost Optimization
Performance
Security
Fault Tolerance
Service Limits
Core Checks and recommendations โ all customers : ๋ชจ๋ ์ฌ์ฉ์๊ฐ ์ฝ์ด ์ฒดํฌ๋ฅผ ํ๊ฑฐ๋ ์ถ์ฒ๋ฐ์ ์ ์๋ค.
Full Trusted Advisor โ Available for Business & Enterprise support plans : Business & Enterprise์ ์ ๋ฃ ํ๋์ ์ฌ์ฉํ๋ฉด ์๋ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์๋ค.
Ability to set CloudWatch alarms when reaching limits : limit๋๋ฌ ์ ์๋ ์ ๊ณต
Programmatic Access using AWS Support API : Trusted Advisor๋ก์ Programmatic Access๋ฅผ ์ํ api์ ๊ณต
#166 More Architecture Link
https://aws.amazon.com/architecture/
https://aws.amazon.com/solutions/
#177 DNS
DNS : Domain Name System which translates the human friendly hostnames into the machine IP addresses
NAME SERVER : resolves DNS queries
Domain Registrar : ๋๋ฉ์ธ ๋ค์ ๋ฑ๋ก ๋ํ์ > route53, ๊ฐ๋น์ ๋ฑ๋ฑ
SAA ๋ฌธ์ ์ ๋ฆฌ > #69์ฐธ๊ณ ํ ๊ฒ
#178 Route53
Except for Alias records, TTL is mandatory for each DNS record
#179 FSx
Amazon FSx for Windows
SMB, NTFS, NFS, Microsoft Active Directory integration
Can be accessed from your on-premise infrastructure
Amazon FSx for Lustre
High Performance Computing(HPC)
Seamless integration with S3
Can โread S3โ as a file system (through FSx)
Can write the output of the computations back to S3 (through FSx)
Scratch File System
๋์ ์ฑ๋ฅ, ๋ฐ์ดํฐ๋ ๋ณต์ ๋์ง ์์ ์์ ์คํ ๋ฆฌ์ง ํ์์
Persistent File System
๋ฐ์ดํฐ๊ฐ ๋ณต์ ๋์ด Long-term storage๋ผ๊ณ ๋ณผ ์ ์์
#180 Storage Gateway
์จ ํ๋ ๋ฏธ์ค์์ s3๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ์ด๋ป๊ฒ ํด์ผ ํ๋? - AWS Storage Gateway๊ฐ ๋ต์ด๋ค.
File Gateway
NFS, SMB
Integrated with Active Directory(AD)
Volume Gateway
Block Storage
Cached volumes: low latency access to most recent data
Stored volumes: entire dataset is on premise, scheduled backups to S3
Tape Gateway
Hardware Appliance
No on-premises virtualization : ์จํ๋ ๋ฏธ์ค์์ ๊ฐ์ํ๋ฅผ ํด์ผ storage gateway๋ฅผ ์ฌ์ฉํ ์ ์๋๋ฐ ๊ฐ์ํ๋ฅผ ์ฌ์ฉํ ์ ์์ ๋ ์ฌ์ฉํ๋ ์ต์ ์ด ์ด๊ฒ์.
#181 AWS Transfer Family
A fully-managed service for file transfers into and out of Amazon S3 or Amazon EFS using the FTP protocol
Last updated