1 Overview introduction
SAA 備考目的是為了提高職場競爭力和自我能力實作,這是對近3個月的學習所做的知識點總結,這里將基于這個圖例,從外而內的剖析每個部件的功能特征,歸納總結知識點,
這是一個基礎框架,很多專業的知識點未被展示在這張圖中,而對于學習備考和將來的使用又是非常必要的,這里也會做對應的擴展延申總結,比如ELB, RDS, IAM, EBS, SNS, SQS等,由于報考語言選擇英語,這中間有很多從sample question 中復制的決議,或者是PPT截圖,均為英文版,故內容為中英混合,

Figure 1 Architecture overview Diagram
2 IAM
2.1 IAM overview
IAM – Identity access management, 這個功能是入門AMS將接觸的第一功能,備考時,你首先要注冊一個免費的AWS 賬號,這就涉及IAM的功能,包含賬號和角色管理,其底層依賴都是Policy,
IAM由以下部分組成:
· 用戶 users
· 組 groups
· 角色 roles
· 策略 policies

Figure 2 IAM Structure
策略案例:
{
"Id": "Policy1547623824130",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1547623806374",
"Action": [
"s3:DeleteBucket"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::elasticbeanstalk-ap-northeast-1-609617148900",
"Principal": "*"
}
]
}








IAM的功能特性:
· IAM是全域的,不單應用于某個區域,它就是AWS的中心
· Root account只是在創建AWS賬戶時的一個賬號,它具有全部的admin access
· 第一次創建的New user沒有 permission,應當分配適當的permission (minimal)
· Permission是通過Policies來管理的,Policies是用JSON寫的
· IAM 預定義了“Managed policies”
· 首次創建用戶時,需要選擇AWS access type,這里有2個型別供選擇
o Programmatic access
§ 要分配Access key ID & secret access key. 他們不同于密碼,你不能用Access key ID & secret access key登錄到console,然而你可以通過AWS API, CLI, SDK, and 其他開發工具訪問AWS.
§ 你只能看見一次Access key ID & secret access key,如果你丟失了他們,你需要重新生成,因此應該將他們保存在安全的地方,
o AWS Management Console access
§ Enables a password that allows users to sign-in to the AWS Management Console.
§ 需要為用戶提供登錄url,如:https://ganyu.signin.aws.amazon.com/console
· 總是需要為 root account 設定多因素身份認證MFA
· 你可以創建和定義自己的密碼輪換策略
· 角色比存盤Access key ID & secret access key在具體的EC2上更安全
· 角色很容易管理
· 創建EC2實體后,可以通過console & command line分配角色
· 角色是全域的,你可以使用在任意region
· IAM 聯合(federation)
§ 大型企業通常會將自己的用戶庫集成到IAM中,通過這中方式,用戶可以通過自己的公司憑證登錄到AWS
§ 身份聯合使用SAML標準 (Active directory)
IAM的 1v1 brain dump:
· 一個IAM用戶對應一個自然人
· 一個角色對應一個應用程式
· 絕不能share IAM 憑證
· 絕不能把IAM 憑證寫在代碼中
· 不要提交你的 IAM憑證
· 除了初始設定時,永遠不要使用root account
· 不要使用root account 憑證
Exam tips:
· IAM controls permissions for resource-to-resource interaction as well as user access to the AWS console. It does not provide an authentication interface or single sign-on.
· IAM only applies to permissions for users, roles, and groups and does not affect billing or cost or specific application feature accessibility.
· It does not handle hosted application permissions or relate to SNS
· IAM is not the managed service for handling MFA Delete setup on S3 buckets.
· Users, groups, roles, permissions, and similar constructs are part of IAM. Organizations and organizational units are part of AWS Organizations, a different facility.
· There are four types of policies in IAM:
§ identity-based
§ resource-based
§ organization SCPs
§ access control lists (ACLs)
· IAM policies can be attached to users, groups, and roles in the case of identity based policies, and AWS services and components via resource-based policies.
· AWS Organizations provides logical groupings and account management.
· IAM aids in scalability primarily by consolidating and centralizing management of permissions, both to AWS users and from instances to services. Use case:
o It allows assignment of permissions to users en masse via groups.
o It allows consistency in access from instances to managed AWS services across large numbers of instances.
· Power user access is a predefined policy that allows access to all AWS services with the exception of group or user management within IAM.
· The Power User group provides access to developer-related services, but not all services (like IAM).
· AWS defines and keeps updated a number of IAM policies for users, including Administrator, Billing, and Power User.
· A policy document is a collection of permissions in IAM.
· IAM users are global to an AWS account and are not region-specific.
· You should never store your application keys on an instance, in an AMI, or anywhere else permanent on the cloud. application keys are for programmatic access, not console access.
· You can only assign a single role to an instance.
· Remember that AWS provides a principle of least privilege and always wants to limit access to only what a user (or service) needs. Therefore, new IAM users do not have any access to AWS services and must be granted access to any service explicitly
You can choose from several different types of accounts when you add new users. Each type of account comes with different privileges:
- An "administrator" has full access to the account with all permissions including account maintenance, users, billing information, and subscriptions.
- A "power user" has similar permissions to an administrator except they can't edit or view subscriptions or other users and they do not have access to billing information.
- A "user" is the most limited role. They can only view the account. They can't view subscriptions, other users on the account or access billing information.
- The "no login" role essentially disables the user. They won't be able to log into the account.
2.2 IAM summary
MultiFactor Authentication
· Security token-based, 6位數字設備
· SMS text
policy
· An explicit allow overrides default deny
· 語法 Principal, action,Effect,Resource,condition
· Capability policies, Resource policies, IAM policies
Role delegation
· Identity Providers
· Amazon Cognito
· SAML
· Custom Identity broker Federation
· Cross account access
· EC2 has role, app inside can take role
2.3 WIF
WIF---Web Identity Federation, web身份聯合,允許用戶通過基于web的身份提供者,如Amazon,Facebook或Google,身份驗證成功后,可以訪問AWS的資源,身份驗證成功,用戶從web ID 提供者接收身份驗證code,并將其轉換為臨時的AWS安全憑證,
Amazon Cognito 為WIF 提供了以下功能:
· 注冊并登錄你的應用程式 sign-up and sign-in
· 以guest身份訪問
· 充當應用程式和web ID提供者之間的身份代理(identity broker),因此不需要撰寫任何額外代碼
· 為多個設備同步用戶資料
· 推薦用于所有 mobile app 的AWS 服務
Cognito 用戶池
用戶池是用于管理移動和web應用程式的注冊和登錄功能的用戶目錄,用戶可以直接登錄到用戶池,或使用Amazon,Facebook或Google,Cognito充當應用程式和web ID提供者之間的中介,成功的身份驗證將生成一個JSON Web令牌 JWTs,
Cognito 身份池
身份池允許提供臨時的AWS憑證來訪問AWS服務,如S3 或DynamoDB

Figure 3 Cognito in action
Cognito 用例
推薦使用Facebook等社交媒體賬戶的web 身份聯合,

Figure 4 FaceBook with WIF
Cognito在應用程式和Facebook或Google之間進行代理,以提供映射到IAM角色的臨時憑證,從而允許訪問所需資源,不需要應用程式在設備本地嵌入或存盤AWS憑證,它為用戶提供跨所有移動設備的無縫體驗,
Cognito追蹤用戶身份和他們登錄的不同設備之間的聯系,為你的應用程式提供無縫的用戶體驗,cognito使用push同步來跨多個設備推送更新和同步用戶資料,當存盤在云中的資料發生變化時,cognito使用SNS向所有與給定用戶身份相關的設備發送通知,

Figure 5 Push synchronization using SNS
3 VPC
3.1 VPC concept
Amazon VPC -- Virtual private cloud允許您在 AWS 云中私有、隔離的部分創建虛擬網路環境,從中可以對私有 IP 地址范圍、子網、路由表和網路網關等方面進行全面控制,借助 Amazon VPC,您可以定義虛擬網路拓撲和自定義網路配置,使其非常類似于您在自己的資料中心所操作的傳統 IP 網路,使用 VPC 的一個好處在于:您可以運行面向公眾的 Web 應用程式,同時仍舊在私有子網中保持非公開訪問的后端服務器,您可以為 Web 服務器創建一個可以訪問 Internet 的公有子網,并將后端 RDS 資料庫實體置于不能訪問 Internet 的私有子網中,默認情況下,一個aws賬號最多可以創建5個VPC, 當然,如果業務需要,可以向aws申請創建更多VPC.
這里還需要提出另外2個概念,圖中并未體現,一是區域(region),二是可用區(Availability zone), 區域是aws在全球范圍內所建立的資料中心,根據地理位置我們把某個地區的基礎設施服務集合稱為一個區域,通過AWS的區域,一方面可以使得AWS云服務在地理位置上更加靠近我們的用戶,另一方面使得用戶可以選擇不同的區域存盤他們的資料以滿足法規遵循方面的要求,AWS的不同區域之間是相對獨立的,但是它們的獨立程度與區域的類別有關,根據目前10個區域的各自特點我們可以把它們分成3個不同的類別,
· 第一類是GovCloud區域,主要是服務美國的政府機構和部分美國客戶,
· 第二類是中國區域,這也是一個與其他區域獨立的專門服務中國客戶的區域,
· 最后一類的是目前其他8個區域,這8個區域是面向所有用戶的,且共享同一個賬戶體系,所以用戶注冊AWS賬戶后可以使用所有這8個區域的服務,
對于那些需要同時使用AWS這8個區域和AWS中國區域的用戶來說,他們同時需要兩個賬戶——一個在中國的區域使用,另一個在其他8個區域使用,
A region is an area geographically that has redundancy within it, through at least two availability zones. Each AZ is separate from other AZs and each is in essence a virtual data center. A region contains virtual data centers; it is not itself a virtual data center.
AWS的每個區域一般由多個可用區(AZ)組成,而一個可用區一般是由多個資料中心組成,AWS引入可用區設計主要是為了提升用戶應用程式的高可用性,因為可用區與可用區之間在設計上是相互獨立的,也就是說它們會有獨立的供電、獨立的網路等,這樣假如一個可用區出現問題時也不會影響另外的可用區,在一個區域內,可用區與可用區之間是通過高速網路連接,從而保證有很低的延時,
VPC的組成部分:
· Virtual Private Cloud:AWS 云中邏輯隔離的虛擬網路,從所選范圍內定義 VPC 的 IP 地址空間,
· 子網 subnet:VPC 的 IP 地址范圍內的一個區段,其中可放置隔離的資源組,
· 互聯網網關IGW:公有 Internet 連接的 Amazon VPC 端,
· NAT 網關:一款高度可用的托管網路地址轉換 (NAT) 服務,便于私有子網中的資源訪問互聯網,
· 虛擬私有網關Virtual Private gateway VGW:VPN 連接的 Amazon VPC 端,
· 對等連接 VPC Peering:對等連接使您可以通過私有 IP 地址在兩個對等 VPC 之間路由流量,
· VPC 終端節點 endpoint:支持建立從您的 VPC 到 AWS 中托管的服務的私有連接,無需使用互聯網網關、VPN、網路地址轉換 (NAT) 設備或防火墻代理,
· 僅傳出互聯網網關Egress Only Internet Gateways:有狀態網關,僅提供從 VPC 到 Internet 的 IPv6 流量傳出訪問權限,
3.2 VPC network
對于VPC的網路劃分,這里將引入子網(subnet)的概念,在一個可用區中,可以包含200個子網,而一個子網只能屬于一個可用區,也就是說,子網與可用區是一對一 的,而可用區與子網是一對多的關系,開通aws賬號,會默認在每個區域(3類)都創建一個default VPC,VPC可以跨同一區域的可用區,例如,在區域us-east-1中創建一個VPC,該區域中的所有可用區都能被VPC 選擇使用,subnets can communicate with each other across availability zones by default.

Figure 6 VPC and subnet
所有子網,可以根據配置,分為公有子網和私有子網, 所謂公有子網, 是一個對世界開放的子網,只要公共子網有一個互聯網網關(IGWà通過配置路由表來實作連接,那么公共子網中的任何主機實體都可以被訪問;而私有子網則無此配置,只能在內部網路中使用,無法通過互聯網訪問,實體/主機只能在私有子網內互相通信,如果將IGW附加到私有子網,它將成為公共子網,一個私有子網將沒有IGW,因此他們使用Bastion和NAT連接到互聯網,
Exam tips:
· Egress-only internet gateways are stateful and support IPv6 traffic.
· An egress-only gateway is for use with IPv6 traffic and only allows outbound traffic.
· Egress always has a cost associated with it, while ingress is always free.
· Transferring data across regions is treated the same as transfers to the Internet. Only inter-AZ data transfer is guaranteed to be costless
3.3 Create VPC
這里首先介紹新創建的VPC將會獲得什么樣的配置,然后將其和default VPC做對比,新建VPC, 你需要指定:
· Name tagà Creates a tag with a key of 'Name' and a value that you specify.
· IPv4 CIDR BlockàThe range of IPv4 addresses for your VPC in CIDR block format, for example, 10.0.0.0/24. Block sizes must be between a /16 netmask and /28 netmask. IPv6 CIDR Block是可選的,VPC中可以沒有IPv6地址段,
· The default VPC has a CIDR block of /16, but the default subnet in each AZ is a /20.
· There is no default CIDR block for custom VPCs, custom VPCs must have this entered in.
· 5 VPCs are allowed per region, per account, unless you contact AWS to raise this default limit.
· This limit is your primary CIDR block and then, in addition, 4 secondary CIDR blocks, totally 5 CIDR blocks.

Figure 7 Create custom VPC
對比新建一個VPC之后,可以看出,后者不只是多出一個VPC,同時還多了一個route table, Network ACLs and Security group. 這里是沒有新增internet 網關的,也就是說,默認情況下,custom VPC都是私有的, 而default VPC是公有的,

Figure 8 Compare VPC
Exam tips:
· All VPCs have NACLs, security groups, and route tables automatically created.
· However, only the default VPC has a default subnet and an internet gateway created as well.
· A VPC cannot be changed from dedicated hosting tenancy to default hosting. You have to re-create the VPC.
3.4 VPC Peering
AWS 使用現有 VPC 基礎設施創建 VPC 對等連接,既不是網關,也不是 VPN 連接,因此不依賴某個獨立的物體硬體,不會發生單點通信故障或帶寬瓶頸,區域間 VPC 對等連接采用當前支持 VPC 的橫向擴展、冗余且高度可用的技術,區域間 VPC 對等連接流量經過具有內置冗余和動態帶寬分配的 AWS 骨干網,如果區域間對等連接出現故障,流量將不會通過 Internet 路由,
VPC Peering的功能特點
· 私有地使用AWS 網路連接兩個VPC
· VPC建立對等連接后,就如同在一個網路中
· 必須確保沒有重疊的CIDR
· VPC Peering不能轉移,即A?àB?à C, 不等同于A?à C
· 可以和其他賬戶的VPC建立對等連接
· 必須在每個VPC 子網中更新路由表,確保實體間可以正常通信

Figure 9 VPC Peering
VPC Peering 動手實驗

Figure 10 VPC Peering hands on
Exam tips:
· AWS calls a connection between two VPCs via peering across regions an inter-region VPC peering connection.
· AWS does not support IPv6 inter-region communication.
· EC2-Classic was a flat network that offered very little in the way of multiple options. With VPCs, you can assign multiple IP addresses as well as multiple network interfaces
3.5 Endpoints and Flow logs
3.5.1 Endpoints
Endpoints是虛擬設備,它們是可以水平伸縮的、冗余的、高可用的VPC組件,允許VPC中的實體與服務之間進行通信,而不會對網路流量造成可用性風隙訓帶寬限制,
VPC endpoints允許你將自己的VPC 私有地連接到受支持的AWS 服務和由PrivateLink提供支持的VPC 端點服務,而不需要Internet網關、NAT 設備、VPN 連接或AWS Direct連接(云專線),VPC中的實體不需要公網IP來與服務中的資源進行通信,你的VPC和其他服務之間的流量不會離開Amazon網路,
A VPC endpoint provides a connection over the Amazon network between your VPC and a service, such as S3. This avoids leaving the network and routing over the public Internet, which inherently provides greater security for the traffic involved; endpoint is a private connection outside of these constructs altogether, which is part of why it is an attractive solution for internal AWS communication. VPC and endpoints must in same region.
這里有兩種型別的VPC endpoints:
· Interface endpoint
· Gateway endpoint
§ 當前支持Amazon S3 和DynamoDB
Interface endpoint是一個具有私有IP的彈性網路介面,該私有IP 用作指向受支持服務的流量的入口點,支持以下服務:

Figure 11 Supported services by Interface endpoint
針對于gateway endpoint和S3之間的動手實驗:

Figure 12 Gateway endpoint lab
Exam tips:
· An internet gateway is required to handle Internet traffic, and a VPC endpoint is ideal for connecting the instances to S3.
· An elastic network interface is virtual and can have multiple IPv4 and IPv6 addresses as well as security groups, a MAC address, and a source/destination check flag.
· An instance has a primary network interface in all cases but can have additional network interfaces attached
· Traffic follows the network interface rather than sticking to any particular instance.
· An elastic network interface can only be attached to a single instance at one time but can be moved from one instance to another.
· An instance’s primary network interface cannot be detached. You can detach secondary interfaces, attach multiple interfaces, and move network interfaces.
3.5.2 Flow logs
Flow logs是為了捕獲關于進入介面的IP流量資訊,分為一下三類
· VPC flow logs
· Subnet flow logs
· ENI flow logs
Flow logs 的功能特性:
· 幫助監視和排除連接問題
· 可以轉到S3 / CloudWatch logs
· 從AWS管理的介面捕獲網路資訊 :ELB, RDS, ElastiCache, Redshift, WorkSpaces
· 除非 peer VPC在你的賬戶中,否則無法為與你的VPC 建立對等連接的VPC啟用 Flow logs
· 不能標記 Flow log
· 創建 flow log后,不能更改配置,例如不能將不同的IAM role與之關聯
· 不是所有的IP 流量都受到監控
§ 實體與Amazon DNS服務器聯系時產生的流量,如果你使用自己的DNS 服務器,則會記錄到該服務器的所有流量
§ 由一個用于Amazon windows license激活的windows 實體
§ 用于實體元資料的169.254.169.254來回的流量
§ DHCP 流量
§ 傳輸到默認VPC路由器的保留IP地址
3.6 VPN and Direct connect
3.6.1 VPN
虛擬專用網路(VPN)的功能是:在公用網路上建立專用網路,進行加密通訊,在企業網路中有廣泛應用,VPN網關通過對資料包的加密和資料包目標地址的轉換實作遠程訪問,VPN可通過服務器、硬體、軟體等多種方式實作
Site-to-Site VPN 的組成部分
· 虛擬專用網關--是 Site-to-Site VPN 連接在 Amazon 一端的 VPN 集線器,您可以創建虛擬專用網關,并將其附加到要從中創建 Site-to-Site VPN 連接的 VPC,
· AWS Transit Gateway--中轉網關 是一個中轉中心,您可用它來互連 Virtual Private Cloud (VPC) 和本地網路,
· 客戶網關--是指 Site-to-Site VPN 連接在您這一端的物體設備或軟體應用程式,

Figure 13 Single VPN connection
使用中轉網關的單一 Site-to-Site VPN 連接

Figure 14 VPN with transit gateway
如果您有多個 AWS Site-to-Site VPN 連接,您可以使用 AWS VPN CloudHub 在各個站點之間提供安全的通信,這可使您的遠程站點彼此進行通信,而不只是與 VPC 進行通信,VPN CloudHub 在簡單的星型拓撲連接模型上操作,您可以在使用或不使用 VPC 的情況下操作 VPN CloudHub,這種設計適合有多間分公司和現有 Internet 連接的客戶,幫助他們實施方便、潛在低成本的星型拓撲連接模型,以便在這些遠程辦公室之間建立主要或備用連接,

Figure 15 VPN CloudHub architecture
要使用 AWS VPN CloudHub,必須創建具有多個客戶網關的虛擬專用網關,您必須為每個客戶網關使用唯一的邊界網關協議 (BGP) 自治系統編號 (ASN),客戶網關可通過它們的 Site-to-Site VPN 連接傳播適當的路由(BGP 前綴),路由通告會被每個 BGP 對等體接收并重新通告,使每個站點都可以向其他站點發送或接受資料,站點的 IP 范圍不得重疊,每個站點還可以發送和從 VPC 接收資料(與使用標準 Site-to-Site VPN 連接的方式相同),
3.6.2 Direct connect
AWS Direct Connect ,也叫云專線,通過標準的以太網光纖電纜將您的內部網路鏈接到 AWS Direct Connect 位置,電纜的一端接到您的路由器,另一端接到 AWS Direct Connect 路由器,有了此連接以后,您就可以創建直接連接到公有 AWS 服務(如 Amazon S3)或 Amazon VPC 的虛擬介面,從而繞過您的網路路徑中的 Internet 服務提供商,AWS Direct Connect 位置在其關聯的區域提供對 AWS 的訪問權限,您可以使用公有區域或 AWS GovCloud (US) 中的單個連接訪問所有其他公有區域中的公有 AWS 服務,
AWS Direct Connect是一種網路服務,提供了一個使用 Internet 將客戶的本地站點連接到 AWS 的替代解決方案,使用 AWS Direct Connect ,以前通過 Internet 傳輸的資料現在可以借助 AWS 和您的資料中心或公司網路之間的私有網路連接進行傳輸,許多情況下,私有網路連接可以降低成本、增加帶寬,提供比基于 Internet 的連接更為一致的網路體驗,
以下是您用于 AWS Direct Connect 的關鍵組件:
· 連接-- 在 AWS Direct Connect 位置創建連接 以建立從您的本地部署到 AWS 區域的網路連接,
· 虛擬介面-- 創建虛擬介面以啟用對 AWS 服務的訪問,公有虛擬介面允許對公有服務的訪問,如 Amazon S3,私有虛擬介面允許對您 VPC 的訪問

Figure 16 Direct connect
AWS Direct Connect相對于VPN的聯網方式,具有更高的安全性,低延遲以及穩定性,它還有以下這個特點:
- 專線,提供到AWS骨干網的私有連接線路
- 能夠創建到AWS的私有介面或公有介面
- 減少出口帶寬的開銷(入向帶寬免費)
- 始終如一的網路性能
- 冗余連接的可選擇性
- 可以在多個AWS區域中使用
- 多個AWS賬號可以共享同一個DX線路
- 使用BGP (Border Gateway Protocol 邊界網關協議) 來交換路由
- 通過HIPPA法案
3.6.3 Direct connect vs VPN
|
Type |
Direct connect |
VPN |
|
Expense |
昂貴的設定和需要時間配置 |
便宜和立即 |
|
Connection |
專用私人連接 |
Internet |
|
Cost |
減少資料傳輸成本 |
互聯網資料傳輸成本 |
|
Consistent |
一致的性能 |
互聯網固有的可變性 |
|
Redundancy |
不提供冗余 |
提供冗余 |
Table 1 Direct connect vs VPN
3.7 NAT and Bastion host
3.7.1 NAT concept
首先闡述NAT 的概念,NAT—Network Address Translation,即是網路地址轉換之意,就是替換IP報文頭部的地址資訊,NAT通常部署在公有子網中,通過將內部網路IP地址替換為出口的IP地址提供公網可達性和上層協議的連接能力,使用NAT的目的,是節約公網IPv4地址,當前公網IPv4地址是稀缺的,如果有大量的私有主機有Internet訪問需求,則NAT是最佳解決方案,在aws cloud 上,實作NAT 有兩種方式,即NAT instance 和NAT gateway,接下來將介紹二者的區別聯系,
3.7.2 NAT instance vs NAT gateway
NAT instance, 創建時,需要獲取一個社區版的NAT AMI, 生成并啟動實體后,在實體網路設定啟用disable Source/destination check,這是由于destination本身就不唯一,編輯route table,允許internet訪問NAT instance,私網中也必須增加一條路由,使其關聯到NAT instance,NAT instance 能支持的流量取決于實體的大小,如果使用中遇到瓶頸,請考慮增加 instance size,你可以對實體創建高可用的自動伸縮組,在不同的AZ分別創建NAT 實體,實作容災,

Figure 24 NAT instance
NAT gateway,這是完全托管在aws的服務,你不需要維護其可用性,default情況下,NAT gateway就是高可用的,創建NAT gateway 時,需要關聯一個EIP—Elastic IP address, 這里需要注意的是EIP是收費的,為了考試而創建的免費賬號,使用EIP時需慎重,不用時及時釋放掉,不然aws會按照你所占有該EIP的時間來收取費用,不管這期間你有沒有使用到此功能,

Figure 25 NAT gateway
NAT instance和 NAT gateway區別聯系:
|
屬性 |
NAT gateway |
NAT instance |
|
可用性 |
高度可用,每個可用區中的 NAT 網關都采用冗余實施,在每個可用區中創建一個 NAT 網關可確保架構不依賴于可用區, |
使用腳本管理實體之間的故障轉移, |
|
帶寬 |
可以擴展到 45 Gbps, |
取決于實體型別的帶寬, |
|
維護 |
由 AWS 管理,您不需要進行任何維護, |
由您管理,例如您需要對實體安裝軟體更新或作業系統補丁, |
|
性能 |
軟體經過優化以便處理 NAT 流量, |
配置來執行 NAT 的通用 Amazon Linux AMI, |
|
費用 |
費用取決于您使用的 NAT 網關的數量、使用時長以及您通過 NAT 網關發送的資料量, |
費用取決于您使用的 NAT 實體的數量、使用時長以及實體型別和大小 |
|
公有 IP 地址 |
在創建時選EIP 地址與 NAT 網關關聯, |
為 NAT 實體使用彈性 IP 地址或公有 IP 地址,您隨時可以通過將新的彈性 IP 地址與實體關聯來更改公有 IP 地址, |
|
私有 IP 地址 |
在您創建網關時自動從子網的 IP 地址范圍中選擇, |
在您啟動實體時,從子網的 IP 地址范圍內分配特定的私有 IP 地址 |
|
安全組 |
無法與 NAT 網關關聯,您可以將安全組與 NAT 網關之后的資源關聯,以控制入站和出站流量, |
與您的 NAT 實體和 NAT 實體之后的資源關聯,以控制入站和出站流量, |
|
網路 ACL |
使用網路 ACL 控制進出您的 NAT 網關所在子網的流量, |
使用網路 ACL 控制進出您的 NAT 實體所在子網的流量, |
|
流日志 |
使用Flow logs捕獲流量, |
使用Flow logs捕獲流量, |
|
埠轉發 |
不支持. |
手動自定義配置以支持埠轉發, |
|
堡壘服務器 |
不支持, |
用作堡壘服務器 |
|
IP 分段 |
支持轉發 UDP 協議的 IP 分段資料包, 不支持 TCP 和 ICMP 協議的分段,將洗掉這些協議的分段資料包, |
支持重組 UDP、TCP 和 ICMP 協議的 IP 分段資料包, |
Table 2 NAT comparison
Exam tips:
· Elastic IP addresses are specifically for avoiding being tied to a specific instance,
· Elastic IP addresses are, by definition, an IP address that will not change
· NAT gateway is deployed inside a subnet and it can scale only inside that subnet. For fault tolerance, it is recommended that you deploy one NAT gateway per availability zone
3.7.3 Bastion host concept
Bastion主機是位于公共子網內的實體,通常使用SSH或RDP訪問它們,
一旦使用bastion主機建立了遠程連接,它就充當一個“跳轉”服務器,允許您使用SSH或RDP登錄到網路深處的其他實體(在私有子網中),

Figure 26 Bastion host
在上圖中,它給出了一個想法,在為AWS基礎設施設計bastion主機時,不應該將其用于任何其他目的,因為這會打開不必要的安全漏洞,你需要盡可能地把它鎖起來,我建議您考慮加強所選作業系統的安全性,安全組對于維護嚴格的安全性至關重要,并且在解決方案作業中扮演重要角色,
Bastion hosts的功能特性:
· 可以用Bastion hosts ssh到私有實體
· Bastion hosts在可以連接到其他私有子網的公有子網中
· 必須加強Bastion hosts 安全組
· 確保只有來自所需IP的22埠流量,而不是來自其他實體的安全組
Bastions vs NAT
· NAT 是用于提供私有子網中EC2 instance路由 internet traffic
· Bastion是用于安全地管理EC2實體,使用SSH 或RDP, 也被稱作 “Jump boxes in Australia”
· A bastion 可以看作是一個NAT instance的特例
· 不能使用NAT gateway 來當作 Bastion host.
Exam tips:
· A bastion host is a publicly accessible host that allows traffic to connect to it. Then, an additional connection is made from the bastion host into a private subnet and the hosts within that subnet.
· Because the bastion must be accessed by public clients, it must be exposed to the Internet.
· The security of the bastion must be different from the hosts in the private subnet.
· The bastion host should be hardened significantly as it is public, but also accessible; this is in many ways the opposite of the security requirements of hosts within a private subnet.
3.8 NACL and Security groups
3.8.1 NACL concept
NACL—Network Access Control List,網路地址控制串列, 可以將 NACL看作是一個位于VPC內部但位于子網外部的保護,它們是一個可選的安全層,您可以在VPC中使用它們來充當防火墻,NACL由一系列規則組成,這些規則允許限制特定型別的網路流量(如http、https、ssh等) 或IP范圍,您可以創建許多規則,這些規則首先根據最小的數字按數字順序計算,一個NACL可以被分配給多個子網,但是你不能把一個子網分配給多個NACL,NACL的一個示例用例是,如果希望將對公共子網的訪問限制為只訪問一小組IP地址,
所有的vpc在默認情況下都有一個NACL,這個特定的NACL將默認啟用來自所有IP地址的所有流量,然而,當您手動創建一個NACL時,情況正好相反,這些將在默認情況下阻塞所有流量,
預設網路ACL:將預設網路ACL配置為允許所有流量進出與其關聯的子網,每個網路ACL還包含一個規則號為星號的規則,這個規則確保如果一個包不匹配任何其他編號的規則,它就被拒絕,您不能修改或洗掉此規則,
以下是網路ACL規則的組成部分:
· 規則數:從編號最低的規則開始計算規則,只要規則與流量匹配,就會應用它,而不管可能與之沖突的任何編號更高的規則,
· 型別:流量的型別;例如SSH,您還可以指定所有流量或自定義范圍,
· 協議:您可以指定任何具有標準協議號的協議,有關更多資訊,請參見協議編號
· 如果指定ICMP作為協議,則可以指定任何或所有ICMP型別和代碼,
· 埠范圍:監聽埠或通信的埠范圍,例如,HTTP流量為80,
· 來源:【入站規則】流量的來源(CIDR范圍),
· 目的地:[僅適用于出站規則]流量的目的地(CIDR范圍),
· 允許/拒絕:是否允許或拒絕指定的流量,
下面是一個僅支持IPv4的VPC示例預設網路ACL,
Figure 27 Default NACL configuration
3.8.2 Security Groups
AWS安全組(SG)作為VPC的各個EC2實體的防火墻,它們并不適用于它們所在的整個子網,創建實體時,必須將其與安全組關聯,否則,將分配VPCs默認的安全組,
與NACL類似,安全組由規則組成,這些規則允許并限制基于諸如流量協議(http、https、ssh等)和指定的IP范圍等內容的流量進入實體,您可以創建許多規則,這些規則首先根據最小的數字按數字順序計算,所有VPC在默認情況下都有一個安全組,Security groups disallow all traffic unless there are specific allow rules for the traffic in the security group. Security groups evaluate all the rules on the group before deciding how to handle traffic.
3.8.3 AWS NACL vs Security group comparison
AWS的認證經常會對VPC的這兩個特性進行比較,這可能是因為安全組與NACL類似,然而,它們有一些關鍵的區別,我將在本節中強調這些區別,

Table 3 Security group and NACL comparison
· 安全組在EC2實體級起作用;NACL在子網級起作用,這是最明顯的區別,很可能在考試中被提到,
· NACL允許分別為入站和出站流量定義allow/deny規則;安全組只能定義應用于入站和出站的allow規則,你不能為一個規則定義不同的行為,
· 安全組是有狀態的, 任何允許流入的東西都會自動允許流出;而NACL是無狀態的,這意味著NACL必須允許回傳流量,例如,您需要一個入站規則和一個出站規則,
· 預設情況,SG的outbound rule是允許所有流量流出, 如果洗掉此規則,則從instance 主動發起的流出請求將被拒絕, 而流入的流量仍然允許流出,
· NACL規則按數值順序計算,SG在決定是否允許通信流進入實體之前,將處理所有安全組規則,
· 最后,NACL規則適用于子網中的所有實體,因此,如果流量在NACL級別被阻塞,但在實體級別被允許,它永遠不會到達實體,因為它在應用安全組規則之前就被阻塞了,

Figure 28 Inbound rules comparison

Figure 29 Outbound rules comparison
Exap tips:
· A NACL is best for dealing with all traffic at a subnet or VPC level, as it is associated at the subnet level.
· Anytime you are protecting or limiting traffic to or from specific instances, a security group is your best choice. Security groups are associated with specific instances, so they can effectively limit traffic to some instances while allowing other instances—using different security groups—to still be accessible.
· NACL rules have a rule number, a protocol, a choice of ALLOW or DENY, and a CIDR range and port or port range for inbound and outbound traffic.
· Default security groups prevent all traffic in and allow all traffic out.
· without specific outbound rules, nothing is allowed to flow out. (Note that by default, there is an allowance for all outgoing traffic in security groups, although that can be removed.)
· whether an incoming connection automatically can get back out. Security groups are stateful
· A security group can be attached to multiple constructs, like an EC2 instance, but is ultimately associated with a network interface, which in turn is attached to individual instances.
· A security group can actually have no inbound or outbound rules, so A and D are not required. A security group does require a name and description, though.
4 EC2
4.1 EC2 concept
Amazon Elastic Compute Cloud (Amazon EC2) 是一種 Web 服務,在云中提供大小可調的計算容量,該服務旨在讓開發人員能更輕松地進行 Web 級的計算,All EC2 instances in the default VPC have both a public and private IP address. They do not have an elastic IP address, and the security group that is created by default does not allow any inbound traffic (until changed manually)
4.2 EC2 instance type
按需實體(On-Demand Instances ) 按秒為啟動的實體付費,
· Applications with spiky workloads are reasons to use on-demand, as on-demand can scale up and down quickly
· on-demand instances are best for users with no initial payment ability
· On-demand instances are ideal for any usage that swings wildly in unpredictable patterns, particularly if a job cannot be halted
· Anytime you’re testing a new application, on-demand is a good choice
預留實體 (Reserved Instances)以大幅折扣購買一年期到三年期的始終可用的實體,
· Reserved instances can be paid for in no up-front, partial up-front, and all up-front models, where all up-front is the least expensive and no up-front is the most expensive.
· steady-state usage is ideal for reserved instances
· Steady-state usage is also a use case for reserved instances, to gain cost savings
· If usage is predictable, a long-running job might benefit from a reserved instance
· Reserved instances are locked to the region in which they are created
· AWS suggests using reserved instance pricing in TCO calculations, as it is closest to on-premises servers in an apples-to-apples comparison
· Standard reserved instances often provide up to a 75% discount as compared to on-demand instances.
Spot 實體 (Spot Instances)請求未使用的 EC2 實體,這可能會顯著降低您的 Amazon EC2 成本,
· Spot instances offer you significant costs savings as long as you have flexibility and application processes can be stopped and started.
· Spot instances via the spot market are the potentially least expensive option, given that your compute has flexible timing and needs
· Spot instances also make heavy compute affordable when it would not be on other instance types
· Large and immediate additional capacity needs are best facilitated by spot instances
· spot market is where you purchase spot instances, the spot market provides instances that can stop and start at any time;
· Spot instances are recommended for applications with flexible start and end times, that need to run with low compute prices, or that may have urgent compute needs for large amounts of additional capacity
· If the job can be stopped, then spot instances would be better.
Exam tips:
· Dedicated hosts can be purchased as an on-demand instance or as a reservation for significant savings
· On-demand instances are ideal for any usage that swings wildly in unpredictable patterns, particularly if a job cannot be halted. If usage is predictable, a long-running job might benefit from a reserved instance, and if the job can be stopped, then spot instances would be better.
4.3 Launch new EC2 instance
新建EC2實體,需要考慮VPC, 可用區(包含子網),安全組及放置組(placement group), 如過EC2用于存盤,不需要對外部網路提供服務,則應考慮將其放在私有網路中,而如果需要對外提供服務,如web服務,則要考慮放置在公有子網中,如果考慮網路延遲,則需要將一組同質的EC2 實體放置一個Placement group,
這里引出一個新的概念—Placement group,即單個可用區域內實體的邏輯分組,使用放置組時應用程式能夠參與低延遲、10 Gbps的網路,放置組不能跨越多個可用區域,Cluster placement groups (the default type of placement group) must be made up of instances that exist within a single availability zone
Spread Placement group-- 分散放置組有助于降低集群或實體組中失敗的可能性,Amazon EC2擁有集群放置組,這使應用程式能夠獲得許多HPC應用程式典型的緊密耦合節點到節點通信所需的低延遲網路性能,現在,使用分散的放置組,成員實體將放置在不同的硬體上,從而減少了硬體故障對應用程式的影響,分散放置組能跨越多個可用區域,一個組內的單個AZ內最多有7個EC2實體,
A placement group is concerned primarily with network throughput and reducing latency among EC2 instances within a single availability zone. AWS does support a placement group spanning multiple AZs via spread placement groups, but unless “spread” is specifically mentioned, you should assume the question references a “normal” (or “cluster”) placement group.
比較Placement group和Spread Placement group
· Placement groups are typically in a single availability zone, but now spread placement groups can be placed across availability zones.
· A spread placement group can have a maximum of seven running instances per AZ.
· Spread placement groups primarily offer reduced network lag between instances
· Spread placement groups cannot be set up across regions
· You must specify the distinct underlying hardware for spread placement groups
對于公網和私網的區分,則是以能否正常訪問internet為關鍵點,公網中的EC2 實體,可以自動獲取公網IP,能正常訪問internet,而私網的EC2實體,則不能分配到公網IP,如需訪問internet,則需要借助于公網中的NAT 服務,如NAT 實體或NAT 網關,
新建EC2 實體,需要指定AMI,獲取AMI的渠道,有以下三種:自己創建AMI、通過aws marketplace購買、還有是社區版AMI, 這里將包含免費的AMI.在SAA 備考階段,使用免費的AMI即可,For all new AWS accounts, 20 instances are allowed per region. However, you can increase this limit by requesting it via AWS support.

Figure 17 AMI channel
EC2 需要指定VPC 和subnet,如果創立在default VPC 中,這兩項都可以選默認配置,如果指定在custom VPC中,則需要提前創建subnet,默認情況下,新建的VPC中沒有subnet,


Figure 18 Put ec2 into a VPC and subnet
如果是上圖中的情況,可以單擊 Create new subnet進入創建subnet頁面,如下頁面,需要指定 VPC和AZ, 同時要定義CIDR 塊,此CIDR 必須隸屬于VPC的CIDR,如果定義該subnet 為public,則需要對此子網Enable auto-assign public IPv4 address,同時還需要配置路由表,使其關聯到IGW (Internet gateway),而由于custom VPC 中不包含IGW,這兒仍然需要新建一個IGW, 并attach到 custom VPC.

Figure 19 Create subnet
配置路由表,增加一條路由記錄, 使IGW 可以訪問internet,

Figure 20 Config route table
可以高級配置中預寫入腳本,讓實體啟動時,自動安裝服務,

Figure 21 Advanced details
將實體關聯到security group,可以選擇VPC中默認創建的security group,也可以新建一個security group,并自定義inbound規則,這里需要在security group 的inbound中增加SSH 協議,允許 0.0.0.0/0訪問,不然則無法遠程連接到實體,接下來需要選擇已存在的key pair或生成新的key pair, 用于連接到EC2實體,實體啟動成功后,會自動分配一個公網IP,但由于此IP 是通過DHCP 動態分配,如果通過console reboot 實體,則該公網IP 會重新回到地址池而獲取到一個新的IP,通過CLI reboot,則公網IP可以被保持,
檢查實體是否有Internet連接,可以在登錄實體后,通過命令curl or dig任意網路主機,
如果啟動的實體在私網中,則只能通過公網中的實體ssh 遠程登錄,或者使用bastion host,無法從internet上的任意主機直接登錄,私網中的實體也沒有正常的網路訪問權限,如果需要網路訪問,需要配置 NAT 實體或NAT gateway,
4.4 EC2 summary
placement group
Amazon Instance Store/EBS-backed instance
security
· EC2 Key Pairs
· Security Groups
· Connection Tracking
· IAM Role
Tags
· billing Allocation report
· Restriction
· Maximum tags 10
· Maximum key length – 128 Unicode characters in UTF-8
· Maximum value length – 256 Unicode characters in UTF-8
Show
· keyName = value1|value2|value3 or keyName = key1|value1;key2|value2
5 EBS and EFS
EBS-- Elastic Block Store和EFS-- Elastic File System 都提供存盤服務,而對適當的存盤選項如何做出決策,我們將比較彈性塊存盤(EBS)和彈性檔案系統(EFS)這兩種非常流行的存盤選項,以確定哪種存盤方式最適合哪種情況,
5.1 EBS concept
AWS EBS是一個塊存盤服務,專門用于EC2實體,它為許多用例提供了高性能選項,并且可以用于各種資料庫(關系資料庫和非關系資料庫)、廣泛的應用程式和大資料分析,
EBS通過提供卷來作業,這些卷是小型網路附加塊的集合,您可以將它們視為“磁盤”,卷有不同的型別,無論您需要最好的性能,需要個位數的毫秒延遲,還是您只是在尋找高吞吐量,都有一個EBS卷可以滿足您的需求,
注意,彈性塊存盤卷獨立于EC2實體,可以在任何時候進行附加和分離,當它們被掛載時,可以用作任何其他塊存盤,我們的塊存盤系列引入了EBS塊級存盤,并深入研究了兩個主要塊存盤類別:ssd支持的卷和hdd支持的卷,目前,EBS提供了四種卷型別,





· AWS EBS General Purpose SSD (gp2): A balanced volume type
§ Uses: boot volumes, small or medium database, dev or test env
· Provisioned IOPS SSD (io1): A volume designed for latency-sensitive transactional workloads
§ Uses: boot volumes, critical business application, large db : Cassandra, MongoDB, SQL Sever, Oracle, PostgreSQL, MySQL
· Throughput Optimized HDD (st1): A low-cost volume for frequently accessed and throughput intensive workloads
§ Uses: Big data, Data warehouse, Log processing
· Cold HDD (sc1): A lowest-cost volume for less frequently accessed data
§ Uses: Inexpensive storage, ideal for infrequently accessed sequential workloads
Exam tips:
· HDD types are not available to use as boot volumes.
· An SSD volume is best for transactional workloads with a large number of small I/O sized read/write operations.
· An HDD-backed volume is best for streaming workloads where throughput needs to be maximized over IOPS.
· EBS volumes can be encrypted when they are created.
· There are four types of data encrypted when an EBS volume is encrypted:
§ data at rest on the volume,
§ data moving between the volume and the instance,
§ any snapshots created from the volume,
§ any volumes created from those snapshots.
· If you have a larger database workload, provisioned IOPS SSD is ideal.
· EBS does not offer lifecycle management
· Default behavior is EBS will stop I/O to the volume if it detects potential data inconsistencies in the volume. This is to prevent data corruption. Volume status check would report this condition as Impaired.
· There are couple of ways in which you change the encryption keys associated with an EBS volume: Change the key during snapshot copy process. Another option is: from an EC2 instance, mount a new EBS volume with the desired key and copy data from old volume to new volume
EBS是網路驅動的,通過網路來和EC2實體通訊,也就意味著這兒可能會有延遲,它可以從ec2實體中分離出來,并快速地附加到另一個實體上,EBS卷被設計為非常持久的,并且在可用區(AZ)內復制它們,然而,這意味著它們被限制在一個AZ中,因此您不能移動一個卷,除非您創建它的快照并在其他地方重新創建它,只有GP2和IO1可以用做boot 卷,
By default, EBS root volumes are terminated when the associated instance is terminated. and by default, additional EBS volumes attached to an instance are not. However, this is only the default value,these settings can be changed! You can use the AWS CLI (or the console) to set the root volume to persist after instance termination.
Officially, instances can have up to 28 attachments. One of those attachments is the network interface attachment, leaving 27 attachments available for EBS volumes. However, the better approach is to remember that an instance can attach to a root volume and several more volumes (more than two); Additionally, instances cannot have unlimited attachments.
5.1.1 EBS RAID
這里首先介紹一個概念,磁盤陣列(Redundant Arrays of Independent Disks,RAID),有“獨立磁盤構成的具有冗余能力的陣列”之意, 磁盤陣列是由很多塊獨立的磁盤,組合成一個容量巨大的磁盤組,利用個別磁盤提供資料所產生加成效果提升整個磁盤系統效能,利用這項技術,將資料切割成許多區段,分別存放在各個硬碟上,
EBS 已經是冗余存盤的,但如果你要考慮增加IOPS,則需要考慮使用RAID 技術,前提是你的OS 支持 RAID. RAID 可配置選項為:
· RAID0
· RAID1
· RAID5(Not recommend)
· RAID6(Not recommend)
推薦使用的是RAID0—性能優先,RAID1— 容災優先,

Figure 22 RAID0

Figure 23 RAID1
general
· attached in same AZà EBS volumes are created at AZ level
· create snapshot cross AZ (any AZ in the region)
· copy snapshot to another region (disaster recovery, expansion)
· Root EBS volume is deleted, by default
· persists independently
encrypted
· Public or shared snapshots of encrypted volumes are not supported
· Existing unencrypted volumes cannot be encrypted directly. Can migrate from copy encripted snapshot
· Supported on all Amazon EBS volume types, not instance type
performence
· use raid0 , raid1 improve iops
· EBS optimized with IOPS EBS
price
· charge with storage, I/O requests and snapshot storage
· EBS backed EC2, every stop/start it will be charged as a separate hour
· Snapshot

5.2 EFS concept
AWS EFS是一種存盤服務,它提供了一個共享的彈性檔案系統,提供了幾乎無限的可伸縮性支持,它被設計用于Linux實體(并支持4.0和4.1網路檔案系統(NFS)協議),并且它提供了持久的、高可用的存盤,可以同時被數千臺服務器使用,AWS EFS是一個可自動伸縮的完全托管的服務,這意味著,當您向檔案系統添加或洗掉檔案時,檔案系統的大小實際上會增加或減少,
從表面上看,AWS EFS聽起來像一個簡單的服務,但是當您深入挖掘時,會發現它還有更多的功能,當EFS的檔案系統的大小擴展時,它的性能也隨之擴展,這是一個有點奇怪的選擇,因此,對于低利用率,EFS的性能可能會有點令人失望,然而,如果使用得更多,AWS EFS可以提供高達10gb /s的性能,以及500,000個IOPS,
使用EFS的一個好處是您現有的環境不需要任何更改,您的應用程式和服務只需附加檔案系統即可運行,EFS的使用不限于AWS云,對于那些運行混合云環境的人,AWS EFS也可以由本地實體使用,該特性極大地擴展了EFS的可能用例,
EFS最近也得到了更新,獲得了一個新的存盤層,現在,除了提供標準存盤之外,EFS還提供了不常用的訪問,使用它只需要啟用一個生命周期管理,它將根據所需的策略移動資料,您仍然可以正常使用EFS,您不需要對基礎設施或應用程式進行任何更改,因為EFS在幕后為您處理所有事情,與大多數AWS服務一樣,EFS只對客戶使用的內容收費,EFS標準層存盤的成本為每月每GB 0.30美元,使用AWS EFS非頻繁訪問層存盤的成本大大降低了—每個月為每GB 0.025美元,但是,請記住,在使用這個層檢索資料時,會產生額外的成本(每傳輸GB 0.01美元),

5.3 Compare EBS and EFS
雖然EBS和EFS都提供了很好的特性,但這兩個存盤解決方案實際上是為兩種完全不同的用途構建的,EBS卷被限制為一個實體,更重要的是,一次只能被一個實體訪問,使用EFS,您可以有成百上千個實體同時訪問檔案系統,這使得AWS EFS非常適合任何需要良好執行的集中式共享存盤(如媒體處理或共享代碼存盤庫)的使用,您還可以使用AWS EFS來提供web內容、保存各種備份并減少存盤開銷,雖然EFS的成本確實比EBS高(EFS為0.30美元/ GB, EBS為0.10美元/ GB),但您只需為每個EFS檔案系統支付一次費用,這意味著,如果您為它附加了12個實體,您仍然需要支付與僅為它附加了一個實體相同的金額,使用EBS卷,您需要為每個卷付費,因此,為了節省存盤成本,EFS有時可以替代EBS,
EFS根據容量來衡量性能,雖然在某些情況下這可能非常有益,但它也可能是一個顯著的缺點,您可能沒有足夠高的利用率來達到所需的檔案系統吞吐量,因為AWS EBS為您提供了穩定且可預測的性能,所以EBS幾乎總是更適合您,除非您需要多個實體同時訪問您的存盤,
EBS is a much better choice than EFS for a single-instance application
6 AWS Storage Gateway classification網關型別
6.1 Gateway type
AWS storage gateway is a virtual appliance and is not available as a hardware appliance.
The file gateway enables you to store and retrieve objects in Amazon S3 using file protocols, such as NFS. Objects written through file gateway can be directly accessed in S3.
The volume gateway provides block storage to your applications using the iSCSI protocol. Data on the volumes is stored in Amazon S3. To access your iSCSI volumes in AWS, you can take EBS snapshots which can be used to create EBS volumes.
The tape gateway provides your backup application with an iSCSI virtual tape library (VTL) interface, consisting of a virtual media changer, virtual tape drives, and virtual tapes. Virtual tape data is stored in Amazon S3 or can be archived to Amazon Glacier. A tape gateway is ideal for replacing off-site tape directories. The gateway is a virtual tape directory and avoids the costs of transporting actual tapes to an expensive off-site location.
6.2 File gateway
檔案網關 – 檔案網關 支持連接到 Amazon Simple Storage Service (Amazon S3) 的檔案介面并將服務和虛擬軟體設備組合在一起,通過使用此組合,可以使用行業標準檔案協議(如網路檔案系統 (NFS))和服務器訊息塊 (SMB) 在 Amazon S3 中存盤和檢索物件,軟體設備 (也就是網關) 作為運行在 VMware ESXi 或 Microsoft Hyper-V 管理程式上的虛擬機 (VM) 部署到您的本地環境中,利用網關,可以將 S3 中的物件作為檔案或檔案共享掛載點進行訪問,利用檔案網關,您可以:
- 您可以直接使用 NFS 版本 3 或 4.1 協議存盤和檢索檔案,
- 您可以直接使用 SMB 檔案系統版本 2 和 3 協議存盤和檢索檔案,
- 您可以從任意 AWS 云應用程式或服務直接訪問 Amazon S3 中的資料,
- 您可以使用生命周期策略、跨區域復制和版本控制管理 Amazon S3 資料,您可以將檔案網關視為 S3 上的檔案系統掛載,
檔案網關簡化了 Amazon S3 中的檔案存盤,通過行業標準檔案系統協議集成到現有應用程式中,并提供了對本地存盤的經濟高效的替代方法,它還通過透明本地快取提供對資料的低延遲訪問,檔案網關管理與 AWS 之間的資料傳輸,緩沖應用程式避免網路擁堵,并行優化和流式處理資料,以及管理帶寬消耗,檔案網關與 AWS 服務集成,例如與以下服務集成:
- 使用 AWS Identity and Access Management (IAM) 的常見訪問管理
- 使用 AWS Key Management Service (AWS KMS) 的加密
- 使用 Amazon CloudWatch (CloudWatch) 的監控
- 使用 AWS CloudTrail (CloudTrail) 的審核
- 使用 AWS 管理控制臺和 AWS Command Line Interface (AWS CLI) 的操作
- 賬單和成本管理
- The file gateway enables you to store and retrieve objects in Amazon S3 using file protocols, such as NFS. Objects written through file gateway can be directly accessed in S3.
- File Gateway configuration can locally cache frequently used data and for data that is not in cache, it can retrieve from AWS. It automatically and securely backsup file to S3. Volume gateway is used as block storage and not suitable for this requirement. Tape and Glacier options are suitable for requirement that do not need immediate access to data
6.3 Volume gateway
卷網關– 卷網關提供了支持云的存盤卷,可以從本地應用程式服務器將該存盤卷作為 Internet 小型計算機系統介面 (iSCSI) 設備安裝,該網關支持以下卷配置:
- 快取卷– 將資料存盤在 Amazon Simple Storage Service (Amazon S3) 中并在本地保留經常訪問的資料子集的副本,快取卷不僅有助于節省大量主存盤成本,而且最大程度地減小了本地擴展存盤的需求,您還可以保留對經常訪問的資料的低延遲訪問,
- 存盤卷 – 如果需要對整個資料集進行低延遲訪問,請首先將本地網關配置為將所有資料存盤在本地,然后以異步方式將此資料的時間點快照備份到 Amazon S3,此配置提供了經久、價格低廉且可以恢復到本地資料中心或 Amazon EC2 的場外備份,例如,如果您出于災難恢復目的需要替代容量,則可以將備份恢復到 Amazon EC2,
All data is backed up to S3 asynchronously when a stored volume is used. This ensures that no lag is incurred by clients that interact with the stored volumes on-site.
6.4 Tape gateway
磁帶網關 – 通過使用磁帶網關,您可以采用經濟高效且持久的方式在 GLACIER 或 DEEP_ARCHIVE 中存檔備份資料,虛擬磁帶庫提供了虛擬磁帶基礎設施,該基礎設施可根據您的業務需求以無縫方式擴展,并可消除預配置、擴展和維護物理磁帶基礎設施的運營負擔,
您可以在本地將 AWS Storage Gateway 作為 VM 設備運行,或者在 AWS 中將其作為 Amazon Elastic Compute Cloud (Amazon EC2) 實體運行,您可以在 EC2 實體上部署網關,以便在 AWS 中預配置 iSCSI 存盤卷,您可以使用 EC2 實體上托管的網關進行災難恢復、資料鏡像以及為 Amazon EC2 上托管的應用程式提供存盤,
A storage gateway using stored volumes will store all data locally, providing low latency access to that data. Further, the entire dataset is backed up to S3 for disaster recovery. S3 is durable and available, but not as fast as accessing local data. A VTL provides a tape backup interface, but not necessarily fast data access.
A tape gateway is ideal for replacing off-site tape directories. The gateway is a virtual tape directory and avoids the costs of transporting actual tapes to an expensive off-site location.
7 Route53
7.1 Route53 concept
Amazon Route 53 提供高可用且可擴展的域名系統 (DNS)、域名注冊和運行狀況檢查 Web 服務,設計用于為開發人員和企業提供一種非常可靠且經濟高效的方式,把名稱(如 example.com)轉換為計算機用于互相連接的數字 IP 地址(如 192.0.2.1),從而將最終用戶路由到 Internet 應用程式,您可以將 DNS 與運行狀況檢查服務組合使用,路由流量到運行正常的終端節點,或者獨立監控終端節點和/或對其提供警報,您還可以購買和管理域名(例如 example.com),并自動為域配置 DNS 設定,Route 53 高效地將用戶請求連接到 AWS 中運行的基礎設施,例如 Amazon EC2 實體、Elastic Load Balancing 負載均衡器或 Amazon S3 存盤桶,還可以將用戶轉接到 AWS 外部的基礎設施,
借助 Amazon Route 53,您可以創建和管理公有 DNS 記錄,與電話簿相似,Route 53 可讓您管理 Internet 的 DNS 電話簿中為您的域名所列的 IP 地址,Route 53 也應答將此類特定域名轉換為對應的 IP 地址(如 192.0.2.1)的請求,您可以使用 Route 53 創建新域的 DNS 記錄,或轉換現有域的 DNS 記錄,Route 53 具有簡單的標準型 REST API,可讓您輕松創建、更新和管理 DNS 記錄,Route 53 還額外提供運行狀況檢查,可以監控應用程式的運行狀況和性能,還能監控 Web 服務器和其他資源,您還可以注冊新的域名或者將現有域名轉移到 Route 53 中進行管理,
Route 53 supports up to 50 domain names by default, but this limit can be raised if requested.
Route 53 does support zone apex (naked) domain records.
DNS是一組規則和記錄的集合,幫助客戶端了解如何通過url訪問服務器,在AWS中,最常用的記錄是:
· A: URL to IPv4
· AAAA: URL to IPv6
· CNAME: URL to URL
· Alias: URL to aws resource
A記錄示例

Figure 30 Diagram for A record
7.2 Routing policy
Route53 可以用于你擁有或購買的公有域名,例如application.mypublicdomain.com, 也可以用于你的VPC內實體決議的私有域名,如application1.company.internal.
Route53有高級的特性,例如:
· 負載均衡(通過DNS—也叫客戶端負載均衡)
· 健康檢查
· 路由策略—simple, failover, geolocation, latency, weighted, multi value.
以下重點介紹路由策略,
7.2.1 Simple routing policy
· 將一個域映射到一個url
· 使用場景: 當需要重定向到單個資源時使用
· 不能將健康檢查附加到簡單路由策略
· 當回傳多個值時,客戶端將隨機選擇一個

Figure 31 Simple routing policy
7.2.2 Weighted routing policy
WRR--加權輪詢可讓您為資源記錄集合分配權重,以便指定不同回復所服務的頻率,您可能希望使用此功能來執行 A/B 測驗,發送一小部分流量到進行了軟體更改的服務器,例如,假設您向一個 DNS 名稱關聯了兩個記錄集合,其中一個的權重為 3,另一個的權重為 1,此情形中,75% 時間內 Route 53 將回傳權重為 3 的記錄集合,25% 時間內 Route 53 將回傳權重為 1 的記錄集合,權重可以是 0 到 255 范圍內的任意數字,

Figure 32 WRR Policy
7.2.3 Latency routing policy
LBR(基于延遲的路由)是 Amazon Route 53 的一項新功能,有助于您提高應用程式對全球受眾的性能,您可以在多個 AWS 地區運行應用程式,Amazon Route 53 則通過其遍布全球的節點將最終用戶路由到可提供最低延遲性的 AWS 地區,
只需通過 AWS 管理控制臺或簡單的 API,就能快速而輕松地使用 Amazon Route 53 的全新 LBR 功能,只需創建包含 IP 地址或各個 AWS 終端節點的 ELB 名稱的記錄集合,再將該集合標記為支持 LBR 的記錄集合,這與將記錄集合標記為加權記錄集合非常相似,Amazon Route 53 將負責其余的作業 – 為各個請求確定最佳的終端節點并相應地路由最終用戶,與 Amazon CloudFront 這一 Amazon 全球內容傳輸服務非常相似,
LBR特性:
· 重定向到延遲最少的服務器
· 當用戶延遲是一個優先級時超級有用
· 延遲是基于用戶設計的AWS區域來評估的
· 如果是延遲最低的,那么德國用戶的請求可能會重定向到美國
7.2.4 Geolocation
地理定位-- Route 53 Geo DNS 會根據請求發出的地理位置將其送至特定的終端節點,以此幫助調整負載平衡,Geo DNS 可以自定義本地化的內容,例如以正確的語言展示詳情頁面或限制將內容分配到已授權的市場,Geo DNS 通過一種可以預見而又易于管理的方式讓您實作負載平衡,確保每一個終端用戶地點始終路由到相同的終端節點,Geo DNS 提供三種地理粒度級別:洲、國家/地區和州/省,Geo DNS 還提供全球記錄,當終端用戶的地點與您創建的特定 Geo DNS 記錄不匹配時,全球記錄可在這種情況下發揮作用,您還可以將 Geo DNS 與其他路由型別(例如基于延遲的路由和 DNS 故障轉移)進行組合,以實作多種低延遲的容錯架構,
Geoproximity policy: 地理鄰近性,這個策略在當前的route53中看不到了,但是在考試中仍然可能會出現,這和Geolocation類似,
7.2.5 Multi value answer routing policy
Route 53 現在支持使用多值回答回應 DNS 查詢,在 DNS 查詢回應中回傳多個可檢查運行狀況的 IP 地址這一功能并非負載均衡器的替代,這是使用 DNS 提高可用性和負載均衡能力的一種方式,如果您希望將流量隨機路由到多個資源 (如 Web 服務器),您可以為每個資源創建一條多值回答記錄,然后選擇性地將 Amazon Route 53 運行狀況檢查與每條記錄關聯,Amazon Route 53 最多支持使用八條正常記錄回應每條 DNS 查詢,
7.2.6 Failover routing policy
當您希望創建主動/被動設定時,將使用故障轉移路由策略, 例如,你想把你的主站點放在us-west-2,而從DR 站點在AP-Southeast-2,Route53將使用健康檢查檢查你的主站點健康情況,一旦發現主站點丟失,就會將流量路由轉發到從站點上,

Figure 33 Failover routing
7.3 CNAME vs Alias
CNAME:
· 將一個url指向任何其他url. Application.mypublic.comàblabla.anything.com
· 只能用于非頂點域名
Alias:
· 將一個url指向AWS 資源,Application.mypublic.comàblabla.amazonaws.com
· 可以用于頂點域名和非頂點域名
· 免費
· 本地健康檢查
|
CNAME |
Alias |
linked record |
|
|
use at Apex? |
No |
Yes |
Yes(only to other NS1 zones) |
|
Geo-Aware |
Yes |
No |
Yes(when linked to geo-aware record) |
|
Relative Speed |
Fast |
Faster |
Faster |
|
Collapses Responses |
Yes |
Yes |
Yes |
Table 4 CNAME vs Alias
Exam tips:
· A simple routing policy allows single and multiple resources for both the primary and secondary resources. Weighted policies do honor health checks ,and weight numbers do not affect health checks.
8 S3-- Simple storage service
Amazon S3--Simple storage service, 是一種物件存盤,專為從 Internet 上的任意位置存盤和檢索任意數量的資料而構建,它是一種簡單的存盤服務,以非常低的成本提供極其持久、高度可用并可無限擴展的資料存盤基礎設施,您可以存盤的總資料容量和物件個數不受限制,各個 Amazon S3 物件的大小范圍可以從最小 0 位元組到最大 5TB,可在單個 PUT 中上傳的最大資料物件為 5 GB,對于大于 100MB 的資料物件,客戶應該考慮使用分段上傳功能,
Amazon S3 提供一系列適合不同使用案例的存盤類,這包括 S3 標準(適用于頻繁訪問的資料的通用存盤);S3 智能分層(適用于具有未知或變化的訪問模式的資料);S3 標準 - 不頻繁訪問(S3 標準 - IA)和 S3 單區 - 不頻繁訪問(S3 單區 - IA),適用于長期存在、但訪問不太頻繁的資料;以及 Amazon S3 Glacier (S3 Glacier) 和 Amazon S3 Glacier 深度存檔(S3 Glacier 深度存檔),適用于長期存檔和數字保留,

Exam tips:
· While S3 does use availability zones to store objects in buckets, you do not choose the availability zone yourself. Even S3 One Zone-IA does not allow you to specify the AZ for use. By default, all AWS accounts can create up to 100 buckets. However, this limit can easily be raised by AWS if you request an upgrade.
· Multipart Upload is ideal for large objects on stable networks. But it also helps handle less-reliable networks as smaller parts can fail while others get through, reducing the overall failure rate.
· All S3 and S3-IA data is stored in a single region and within at least three availability zones within that region
· The problem here is trying to tag individual folders. You can use IAM for permissions, but a particular folder cannot be tagged separately from other folders; only an entire bucket can be tagged.
· This is important because it reflects a recent change by AWS. Until 2018, there was a hard limit on S3 of 100 PUTs per second, but that limit has now been raised to 3500 PUTs per second.
8.1 S3 features
· S3是基于物件的存盤,允許你上傳檔案
· object檔案大小可以從0B 到5T
· 沒有存盤限制
· 對于大于 100MB 的資料物件,客戶應該考慮使用分段上傳功能,
· 檔案存盤在buckets中
· S3使用全域的命名空間,也就是說名字必須是全域唯一的
· Bucket是在region level定義的
· 不適合于安裝OS
· 成功上傳檔案后將會生成 HTTP 200狀態碼
· Permissions
§ User based policiesà roles (IAM)
§ Resource based policies
§ Bucket Policies
§ Access control lists
· Bucket ACL
· Object ACL




· 預設條件下,所有新建的bucket都是PRIVATE,你可以配置訪問控制
· S3可以配置創建訪問日志,記錄所有訪問S3 Bucket的請求,這個log可以發送到其他bucket,即使是屬于其他賬號的bucket也可以,
· cross-origin requests
§ not support https custom domain
· Request Authorization
§ Permission Delegation
§ Operation Authorization
· Lifecycle Management
§ Transition
§ Expiration
· price
§ request + storage + data transfer
· Versioning enable 后不能被disable, 只能被suspended
· 任何檔案,在啟動Versioning 前,version 均為 “null”



s3是基于物件的,你可以把物件簡單考慮為檔案,以下是物件的組成部分:
§ Key: 這簡單的指object 名字
§ Value :這是簡單的資料,由一個位元組序列組成
§ Version ID: 這對versioning 來說很重要
§ Metadata: 有關您正在存盤的資料的資料
§ Subresources
§ Access control lists
§ Torrent
S3提供了兩種資料一致性模式
§ Read after write consistency for PUTS of new objectsà new object can be read immediately
§ Eventual consistency for overwrite PUTS and DELETES (can take some time to propagate)
§ Stale read possible after updates and deletes (until change is fully propagated)
§ Lowest read latency
§ Highest read throughput
Bucket 命名規則:
§ 不含大寫字母
§ 不含下劃線
§ 3-63個字符長度
§ 沒有IP
§ 必須以小寫字母或數字開頭
By default, newly created S3 buckets are private. They can only be accessed by a user that has been granted explicit access.



8.2 S3 replication




8.3 S3 use cases and comparison
8.3.1 S3 use cases
§ S3 standard: 冗余地存盤在多個設備中的多個設備上,旨在同時承受兩個設備的損失
§ S3-Intelligent tier: 設計用于成本優化,通過自動將資料移動到最具成本效益的訪問層,而不影響性能或操作開銷層
§ S3-IA: 對于不頻繁訪問的資料,但需要時可以快速訪問, 費用比S3 標準低,但將會產生檢索費用
§ S3 One zone – IA : 對于不頻繁訪問而又追求低成本存盤的資料,不要求多AZ 恢復
§ S3 Glacier: 是一種安全,持久且低成本的資料歸檔存盤,檢索時間從幾分鐘到數小時
§ S3 Glacier deep Archive: 這是S3 最低成本的存盤,但檢索時間12小時則是可接受的



8.3.2 S3 comparison
所有的S3存盤型別,都具有相同的持久性,即 11 9s,考試中常考點是在可用性和SLA的區別,

Table 5 S3 comparison
8.4 S3 encryption for objects
在S3中,有4種方法來對object進行加密,考試中要重點了解那種方法適用于那種場景,
§ SSE-S3: 使用aws 處理和管理的密鑰來加密S3 object
§ SSE-KMS: S3利用指定的aws KMS 來管理密鑰
§ SSE-C: S3 使用用戶每次請求提供密鑰
§ 客戶端加密
In general, SSE-S3 is the “starter” option for encryption. It’s by no means a simple or amateur approach to security, but it is low cost compared to KMS and has much less overhead than client-side or SSE-C encryption keys.
SSE-S3—Object是在server 端進行加密的,使用AES-256加密型別,header 必須設定為: “x-amz-server-side-encryption”: “AES256” ,使用此方法加密,其可靠性低,因為資料被檢索后會自動解密,無論是合法還是非法的檢索,

Figure 34 SSE-S3
SSE-KMS –> KMS的優勢是用戶控制和審計追蹤,當題干中有audit出現,則應考慮的加密方式即為 SSE-KMS,Object是在server 端進行加密的,header 必須設定為: “x-amz-server-side-encryption”: “aws:kms”

Figure 35 SSE-KMS
SSE-Cà Object還是在server 端進行加密,但使用完全由客戶在AWS外部管理的資料密鑰,S3中保存用戶的加密密鑰,其他幾種加密方式,傳輸時都是http 或https可選,但SSE-C必須使用https進行傳輸,且每個http請求都必須在header中提供加密密鑰,

Figure 36 SSE-C
Client side encryption:
§ 客戶端庫,如amazon s3加密客戶端
§ 資料發送到S3前,客戶端必須自己先加密
§ 當從S3檢索資料時,客戶端必須自己解密
§ 客戶完全管理密鑰和加密周期
For client-side encryption, you’ll need a master key, which can either be a KMSmanaged key or a client-side master key. You’ll also need an SDK for encrypting the client-side data

Figure 37 Client side encryption

8.5 S3 Websites
s3可以托管靜態網站并在Internet上訪問它們,網站的url有2中形式:
§ <bucket-name>.s3-website-<AWS-region>.amazonaws.com
§ Or
§ <bucket-name>.s3-website.<AWS-region>.amazonaws.com
如:http:// mybucket.s3-website.eu-west-2.amazonaws.com
如果訪問時得到403錯誤碼,請確保 bucket policies是允許公網讀取的,
This is a matter of carefully looking at each URL. Bucket names—when not used as a website—always come after the fully qualified domain name (FQDN); in other words, after the forward slash.
Where website hosting is concerned, the bucket name is part of the FQDN; where direct bucket access is concerned, the bucket name comes after the FQDN. This is an essential distinction. you need to recall that the s3-website portion of the FQDN is always connected to the region; in other words, it is not a subdomain.
S3 supports two styles of bucket URLs: virtual-hosted-style and path-style URLs. Virtual-hosted-style URLs are of the form http://bucket.s3-aws-region .amazonaws.com, and path-style URLs are the traditional URLs you’ve seen: https://s3-aws-region.amazonaws.com/bucket-name.
https://ytmProfilePictures.s3-website-us-east-2.amazonaws.com/images
S3 buckets have names based upon the S3 identifier (s3), the region (us-east-1 in this case), and the amazonaws.com domain. Then, the bucket name appears after the domain. That results in a URL like https://s3-us-east-1.amazonaws.com/ prototypeBucket32. However, buckets in US East are a special case and should use the special, unique endpoint s3.amazonaws.com
Only the root account can enable MFA Delete. Even the console user that created the bucket—if it isn’t the root user—cannot enable MFA Delete on a bucket.
Object URL
https://myawssaatest01.s3.amazonaws.com/versioning+test.txt

Figure 38 Object not public
S3 CORS à Cross-Origin Resource Sharing
如果你請求的資料來自另一個S3 bucket, 你就需要enable CORS, CORS允許您限制可以在s3中請求檔案的網站的數量,并限制您的成本,常見的考試場景如下圖:

Figure 39 CORS case


8.6 S3 lifecycle management


Define rules based on:
§ Object age
§ Current and previous version
Filter based on:
§ Prefix (images/, logs/)
§ Object tags (name= PHI)






9 Database
9.1 Database overview introduction
資料庫是“按照資料結構來組織、存盤和管理資料的倉庫”,是一個長期存盤在計算機內的、有組織的、可共享的、統一管理的大量資料的集合,資料庫是以一定方式儲存在一起、能與多個用戶共享、具有盡可能小的冗余度、與應用程式彼此獨立的資料集合,可視為電子化的檔案柜——存盤電子檔案的處所,用戶可以對檔案中的資料進行新增、查詢、更新、洗掉等操作,
資料庫的分類,從大的方面來看,分為兩大類,即關系型資料庫(SQL)和非關系型資料庫(NoSQL),
關系型資料庫,存盤的格式可以直觀地反映物體間的關系,關系型資料庫和常見的表格比較相似,關系型資料庫中表與表之間是有很多復雜的關聯關系的, 常見的關系型資料庫有MySQL、MariaDB、Oracle、Aurora、SQL Server 或 PostgreSQL等,在輕量或者小型的應用中,使用不同的關系型資料庫對系統的性能影響不大,但是在構建大型應用時,則需要根據應用的業務需求和性能需求,選擇合適的關系型資料庫,
隨著近些年技術方向的不斷拓展,大量的NoSql資料庫如DynamoDB、MongoDB、Redis、HBase、Memcache出于簡化資料庫結構、避免冗余、影響性能的表連接、摒棄復雜分布式的目的被設計,NoSQL資料庫適合追求速度和可擴展性、業務多變的應用場景, 對于非結構化資料的處理更合適,如文章、評論,這些資料如全文搜索、機器學習通常只用于模糊處理,并不需要像結構化資料一樣,進行精確查詢,而且這類資料的資料規模往往是海量的,資料規模的增長往往也是不可能預期的,而NoSQL資料庫的擴展能力幾乎也是無限的,所以NoSQL資料庫可以很好的滿足這一類資料的存盤,NoSQL資料庫利用key-value可以大量的獲取大量的非結構化資料,并且資料的獲取效率很高,但用它查詢結構化資料效果就比較差,
RDS provides two (and only two) methods for backing up RDS databases at this point: automated backups and automated snapshots.
All the major databases supported by RDS—MariaDB, SQL Server, MySQL, Oracle, and PostgreSQL—allow up to 16 TB of storage for a provisioned IOPS volume.



9.2 SQL database introduction
9.2.1 RDS (OLTP)
Amazon Relational Database Service 也稱為 Amazon RDS,是一種托管服務,可以簡化在云中設定、操作和擴展關系資料庫的程序,它在管理耗時的資料庫管理任務的同時,提供經濟高效的可調容量,使您能夠騰出時間專注于應用程式和業務,與所有 Amazon Web Services 相同,您無需預先投資,而且只需為所使用的資源付費,如果您的應用程式需要更多的資料庫實體,您可以通過此申請表申請更多資料庫實體,
· 管理 MySQL、MariaDB、Oracle、SQL Server 或 PostgreSQL ,這意味著您當前用于現有資料庫的代碼、應用程式和工具也可以無縫用于 Amazon RDS,
· Amazon RDS 可以自動備份您的資料庫,并使您的資料庫軟體版本保持最新,
· 您可以靈活方便地擴展與關系資料庫實體相關聯的計算資源或存盤容量,并從中受益,此外,Amazon RDS 還可通過復制輕松增強資料庫可用性、改進資料耐久性或擴展讀取密集型資料庫作業負載中單一資料庫實體的容量限制,
· 默認情況下,客戶最多可以擁有 40 個 Amazon RDS 資料庫實體,全都可用于“BYOL” (Bring Your Own License) 模式下的 Amazon Aurora、MySQL、MariaDB、PostgreSQL 以及 Oracle,
· 適用于 SQL Server 的 RDS 在單個資料庫實體上有最多擁有 100 個資料庫的限制,
· 必須提供EC2實體和EBS卷型別和大小
· 通過CloudWatch 監控
· 備份/快照/時間點恢復功能
· RDS 在虛擬機上運行,但你不能登錄這些OS
· AWS 負責RDS OS 的安全,用戶負責使用ssl在DB中設定KMS, Security group, IAM policies和授權用戶
· RDS 不是 serverless
· 支持 read replica
§ 用于增加性能
§ 必須開啟自動備份
§ 可以在不同的regions
§ 支持Multi AZ
§ 可以是Aurora 或MariaDB, MySQL,Oracle, and PostgreSQL
§ 可以提升為master,但這將打破read replica
§ You can have up to five read replicas at a time for a single instance
· 通過rebooting RDS實體,你可以強制災難恢復從一個AZ到另一個AZ
將資料匯入 Amazon RDS 的方式有很多并且非常簡單,例如對于 MySQL 使用 mysqldump 或 mysqlimport 實用程式,對于 Oracle 使用資料泵、Import/Export 或 SQL Loader,對于 SQL Server 使用 Import/Export 向導、完整備份檔案(.bak 檔案)或 Bulk Copy Program (BCP),或對 PostgreSQL 使用 pg_dump,有關資料匯入和匯出的更多資訊,請參閱 MySQL 資料匯入指南、Oracle 資料匯入指南、SQL Server 資料匯入指南、PostgreSQL 資料匯入指南,
靜態加密支持Aurora、MySQL、SQL Server、MariaDB、PostgreSQL 以及 Oracle,使用AWS的密鑰管理服務(KMS )來完成加密,一旦RDS實體被加密,就會加密底層存盤中的靜態資料,以及它的自動備份、read replicas和snapshots,
Exam tips:
· Read replicas use asynchronous replication, pushing data to the read replicas whenever possible, for improved read performance. Read replicas are intended to provide scalability for your application by adding additional instances for increased reads from applications. you can set up a read replica in an on-premises instance. Additionally, read replicas are often created in separate regions from the primary instance, to improve performance for clients closer to different regions than the primary instance.
· A read replica configuration is aimed squarely at increasing database performance, specifically the performance of reading data from an RDS instance. Read replicas are updated via asynchronous replication— the most performant approach—from the primary database.
· read replicas are not a backup strategy, nor do they cause automatic backups to be set up. However, you must turn on automatic backups for the primary database instance to enable read replicas.
· Read replicas do not create automatic backups, but the primary database instance must have automatic backups enabled to create read replicas.
· Amazon RDS does not support circular replication, which means one database reads from a second database but then is replicated back by that second database. However, it is absolutely permissible for one database to replicate another database and then be the source for a third database.
· Currently, read replicas in RDS are only supported by MariaDB, MySQL,Oracle, and PostgreSQL.
· A Multi-AZ setup is about disaster recovery, and therefore durability. They provide automatic backups, upgrades happen on the primary database and then are replicated, and there is a primary and usually a single secondary instance
· A Multi-AZ setup is focused on disaster recovery and fault tolerance, while read replicas provide performance and scalability.
· Replication occurs synchronously from a primary instance to a secondary instance in a Multi-AZ setup. Asynchronous replication only occurs in a read replica setup (which can be enabled in addition to a Multi-AZ setup).
· RDS provides for SQL interaction as well as access through the RDS web APIs. RDS instances do not allow access via SSH or RDP.
· AWS does not support circular replication through RDS. While some of the databases supported by RDS do, RDS itself does not provide access to this functionality.







9.2.2 Aurora

· 以10GB為起點,10GB 為增量增加到64T,存盤可自動伸縮
· 計算資源可以縱向擴展到32Vcpu ,244G 記憶體
· 至少有3個可用區,每個可用區包含2個副本,也即是你的資料至少6個副本
· 當主機故障:
§ 一個read replica將自動晉升為主機(60秒內)
§ 如果沒有read replica,將自動lauch 新的替代主機
· 你可以分享Aurora snapshots給其他AWS 賬戶
· 預設情況下,Aurora開啟自動備份
· Aurora 是 serverless
· Aurora 速度是MySQL 5倍, PostgreSQL 3倍
· AWS 負責Aurora OS 的安全,用戶負責使用ssl在DB中設定KMS, Security group, IAM policies

Figure 40 The comparison between MySQL and Aurora




9.2.3 RDS summary
Backup
· preferred backup window
· backup retention period
· I/O suspension for single
· Point-In-Time Recovery
Snapshot
· DB Snapshots make entire DB instance
· from one region to another region, a copy retain in that region
· Because KMS encryption keys are specific to the region that they are created in, encrypted snapshot cannot be copied to another region
· DB Snapshot Sharing
§ DB snapshot that uses an option group with permanent or persistent options cannot be shared
· KMS key policy must first be updated by adding any accounts to share the snapshot with, before sharing an encrypted DB snapshot
Replication
· routing read queries from applications to the Read Replica
· Failover mechanism automatically changes the DNS record of the DB instance to point to the standby DB instance
Multi-AZ deployment
· read-only traffic, use a Read Replica.
· synchronous standby replica in a different Availability Zone
· must be in same region
· For multi-AZ high availability, RDS uses synchronous replication between primary and standby systems. If standby is slow, transactions will take longer to complete. RDS Read Replica on the other hand uses asynchronous replication and any slowness in Read Replica instance would simply cause data lag in the read - replica. Transactions in primary is impacted
Read Replica
· RDS sets up a secure communications channel between the source DB instance and the Read Replica, if that Read Replica is in a different AWS region from the DB instance
· replication link is broken, A Read Replica can be promoted to a new independent source DB
· use some tools like HAPROXY, with two url, one for write one tor read
Security
· Encryption enabled at creating, can not change key later
· Once encryption, log, snapshot, autobackup and replica are encripted
· Cross region replicas and snapshots copy does not work since the key is only available in a single region
· Database security groups default to a “deny all” access mode
Monitor
· 監控的metric 16 項, ReplicaLag
· Backup not notify for snapshot
Maintenance
· Multi-AZ deployment, preform standby, promote standby, preform old primary
· RDS takes two DB snapshots, before upgrade, after upgrade
9.3 NoSQL database introduction
9.3.1 ElastiCache
使用ElastiCache來增加資料庫和web應用程式的性能,它具有如下特性:
· 管理 Redis / Memcache. (類似于RDS,但用于快取)
· 記憶體資料存盤,延遲低于毫秒級
· 必須提供EC2實體型別
· 支持集群(Redis)和 Multi AZ, Read replicas (sharding)
· 安全是通過IAM, Security group, KMS, Redis Auth
· 備份/快照/時間點恢復功能
· 通過CloudWatch 監控
· AWS 負責OS 的安全,用戶負責使用ssl在DB中設定KMS, Security group, IAM policies,users (Redis Auth)

Figure 41 Redis vs Memcached
Exam tips:
· ElastiCache, when used through AWS, handles all of these tasks and more: hardware provisioning, software patching, setup, configuration, monitoring, failure recovery, and backups. à Means everything handled by ElastiCache
· ElastiCache is an in-memory data store that shards across instances. It is not in itself a data distribution mechanism. And it is not a monitoring solution at all.
· ElastiCache is ideal for high-performance and real-time processing as well as heavyduty business intelligence.
· Consider ElastiCache as only useful for storing transient data. Further, it’s not a persistent store; therefore, it’s great for caching data from a message queue or providing very fast ephemeral storage.
· ElastiCache uses shards as a grouping mechanism for individual redis nodes.
· ElasticCache
§ ElastiCache currently allows access only from the EC2 network
§ Memcache not support multi-AZ
§ REDIS replica read can not across regions
§ Redis Replication Groups, max 5 replica
§ Redis Multi-AZ with Automatic Failover, promote one replica as primary, disabled Failover, create new instance and sync with exist replica



9.3.2 DynamoDB
AWS DynamoDB是一個快速和靈活的NoSQL資料庫服務,適用于所有需要一致的、任何規模的延遲在個位數的應用程式,他是一個完全托管的資料庫,支持檔案和Key-value資料模型,它靈活的資料模型和可靠的性能使它非常適合于移動、web、游戲、廣告技術、IoT和許多其他應用程式,mobile, web, gaming, ad-tech, IoT, and many other applications.

Primary key:
Simpleàsingle attribute
Compositeà Two attribute (partition key, sort key)
· AWS 專有的技術,NoSQL 資料庫管理
· 存盤在SSD存盤器中
· 高可用,分布在3個地理上不同的資料中心
· 預設是最終的一致性 讀取(eventual consistent reads)
§ 所有資料副本之間的一致性通常在1秒內到達,在短時間內重復讀取應該會回傳更新后的資料(最后的讀性能)
· 支持強一致讀取 (Strongly consistent reads)
§ 強一致的讀將回傳一個結果,該結果反應在讀之前收到成功回應的所有寫操作
§ Cost 是最終一致性的2倍
· Serverless,配置容量,自動擴展
· 具有備份/恢復功能,全域表功能
· 可以代替ElastiCache作為 key-value存盤,例如存盤會話資料
· 通過CloudWatch 監控
· 安全—身份認證和授權是通過IAM 完成的
· 只能查詢主key,排序key和 index
· Use case: 無服務器應用程式開發,分布式無服務器快取,不支持SQL 查詢語言
DynamoDB
· synchronously replicates data across three AZ’s in a region
· durability with shared data
· secutiry&permission
· IAM Role that allows write access to the DynamoDB,
· Launch an EC2 Instance with the IAM Role included
· Secondary Indexes
· global, an index with a hash and range key that can be different from those on the table
· batch read up to 100 items (using primary keys)
· batch up to 25 individual putitem and deleteitem request















9.4 Redshift
Redshift 是基于PostgreSQL的,但它并不用于OLTP-- online transation processing,而是用于OLAP—online analytical processing,作為分析和資料倉庫,其性能是其他資料倉庫的10倍,可擴展到PB級的資料,存盤時基于列存盤而不是行存盤,支持大規模的并行查詢(MPP—Massively Parallel Query Execution), 且高可用,由SQL 介面來執行查詢,根據所提供的實體按需付費,集成了BI 工具,如 AWS Quicksight或tableau,
Redshift具有如下特性:
· 單節點—160Gb
· 多節點
§ Leader節點,管理客戶端連接和接收查詢
§ Compute節點,存盤資料和執行查詢即計算,可擴展到128個計算節點
· 資料從S3、DynamoDB、DMS和其他DBs加載
· cluster can be restored from snapshot in same region
· Redshift spectrum: 可以直接針對S3執行查詢,不需要加載
· Redshift增強了VPC路由功能,復制和卸載(unload)都經過VPC
· Backups
§ 默認啟用,保留一天
§ 最長保存期為35天
§ Redshift總是試圖維護至少3個資料副本:計算節點上的original和replica,以及Amazon S3中的備份
§ Redshift還可以異步復制你的snapshots到另一個區域的S3中,進行災難恢復
· Redshift的可用性:
§ 當前只支持1個AZ
§ 有自動愈合功能—auto healing
§ 可以在停機時將snapshots恢復到新的 AZ (same region)
§ 可用于商業智能(Business intelligence)
· 操作類似于RDS
· 安全也類似于RDS: IAM, VPC, KMS,SSL
Redshift is one of AWS’s OLAP (online analytics processing) tools and is a database service. While it does processing, it is primarily intended to receive large amounts of data and operate upon that data, as a database would (in loose terms).
Redshift is optimized for batched write operations and for reading high volumes of data. Columnar storage minimizes I/O and maximize data throughput by retrieving only the blocks that contain data for the selected columns. It is not meant for high frequency update use cases typically seen in OLTP systems

9.5 How to connect to a RDS database instance in one VPC
通過 VPC 內部署的 EC2 實體可以訪問同一 VPC 內部署的資料庫實體,如果這些 EC2 實體部署在具有關聯彈性 IP 的公共子網中,您可以通過 Internet 訪問 EC2 實體,對于 VPC 內部署的資料庫實體,可通過 VPN 或您在公有子網中可以啟動的堡壘主機,或使用 Amazon RDS 可公開訪問選項通過 Internet 或從 VPC 外部的 EC2 實體進行訪問,
要使用堡壘主機,您需要設定一個包含用作 SSH 堡壘的 EC2 實體的公開子網,該公有子網的 Internet 網關和路由規則必須允許通過 SSH 主機引導流量,然后必須將請求轉發到 RDS 資料庫實體的私有 IP 地址,
簡單創建資料庫實體,并將“可公開訪問”選項設定為“是”,即可使用公共連接,默認情況下,當“可公開訪問”選項可用時,從您的 VPC 外部可實作對 VPC 內資料庫實體的完全訪問,這表示您無需配置 VPN 或堡壘主機來允許對實體的訪問,
您也可以設定一個 VPN 網關,將公司網路擴展到 VPC,然后允許訪問該 VPC 中的 RDS 資料庫實體,有關詳細資訊,請參閱 Amazon VPC 用戶指南,我們強烈建議您使用 DNS 名稱來連接資料庫實體,因為基礎 IP 地址可能會發生變化(例如,在故障轉移時),
資料庫實體遷移:可以從VPC外部遷移到內部,但不能從內部遷移到外部,
· 如果資料庫實體未在 VPC 中,您可以使用 AWS 管理控制臺輕松將資料庫實體移至 VPC 中,
· 對 VPC 外部的資料庫實體拍攝快照,然后通過指定您要使用的資料庫子網組,將其還原到 VPC,此外,您也可以執行“還原到時間點”操作,
· 不支持將資料庫實體從 VPC 內部遷移到外部,出于安全考慮,無法將 VPC 內資料庫實體的資料庫快斬訓原到 VPC 外部,同樣,也無法執行“還原到時間點”功能,
9.6 RDS Database configuration
如果您的 AWS 賬戶是在 2013 年 12 月 4 日之前創建的,那么您或許可以在 Amazon Elastic Compute Cloud (EC2)-Classic 環境中運行 Amazon RDS,無論使用 EC2-Classic 還是 EC2-VPC,Amazon RDS 的基本功能完全相同,無論資料庫實體部署在 VPC 內部還是外部,Amazon RDS 都能管理備份、軟體補丁、自動故障檢測、只讀副本和恢復,
資料庫子網組是您希望為 VPC 中的 RDS 資料庫實體委派的子網集合,每個資料庫子網組都應在指定區域中的每個可用區內擁有至少一個子網,在 VPC 中創建資料庫實體時,您需要選擇一個資料庫子網組,然后,Amazon RDS 使用該資料庫子網組和您首選的可用區來選擇子網以及該子網內的 IP 地址,Amazon RDS 創建彈性網路介面,并通過該 IP 地址將其關聯到您的資料庫實體,請注意,我們強烈建議您使用 DNS 名稱來連接資料庫實體,因為基礎 IP 地址可能會變化(例如,在故障轉移時),
對于多可用區部署,為一個區域內的所有可用區定義子網可允許 Amazon RDS 在需要時在其他可用區中創建新的備用實體,即使是單一可用區部署,您也需要這樣做,以防以后需要將它們轉換為多可用區部署,
以多可用區部署模式運行我的資料庫實體時,不可以使用備用副本來執行讀取或寫入操作,多可用區備用副本不能服務讀取請求,多可用區部署旨在增強資料庫可用性和持久性,而非獲得讀取擴展優勢,因此,該功能在主副本和備用副本之間采用同步復制,我們的實施可確保主副本和備用副本一直處于同步狀態,但不能使用備用副本執行讀取或寫入操作,
需要先啟用資料庫實體的自動備份,然后才能創建只讀副本,將備份保留時間設定為 0 以外的任何值,以此在添加只讀副本之前啟用源資料庫實體的自動備份,要使只讀副本能夠運行,必須保持備份的啟用狀態,借助 Amazon RDS for MySQL、MariaDB、PostgreSQL 和 Oracle,最多可為給定的源資料庫實體創建 5 個只讀副本,Amazon RDS 支持跨區域只讀副本,資料寫入源資料庫實體與資料在只讀副本上可用之間的時間長度取決于兩個區域之間的網路延遲,只讀副本使用這些引擎的本機異步復制執行,Amazon Aurora 使用的是一種不同但仍然是異步的復制機制,
10 HA
10.1 Load balancers
AWS上有3中不同型別的負載均衡器
· Application Load balancersàALB, 最適合于http & https流量的負載均衡,作業在layer7,即應用層,你可以創建高級路由請求,將特定的請求發送到指定的 web server; ALBs are redundant across at least two subnets.
· Network Load balancersàNLB, 最適合于需要極端性能的TCP 流量的負載均衡,作業在網路層(layer4),NLB能夠處理每秒百萬級的請求,同時能維持極低的延遲,Network load balancers can handle the extremely high request load
· Classic Load balancersà ELB,這是傳統的彈性負載均衡器,可以均衡 http/https應用層,如x-forward 和sticky會話;對于完全依賴于TCP協議的應用程式,也可以用于嚴格的layer4負載均衡,
An ALB offers SSL termination and makes the SSL offload process very simple through tight integration with SSL processes. While an ELB will handle SSL termination, it does not offer the management features that ALBs do.
ALBs offer the most flexibility in routing and load distribution.
Classic load balancers support both IPv4 and IPv6. They support HTTP/1 and HTTP/1.1, but only application load balancers support HTTP/2. Further, you must register individual instances, rather than target groups, with classic load balancers; registering target groups is a functionality only available with application load balancers.
如果你的應用程式停止了回應,ELB將回應504 error,這意味著應用程式有問題,這可能是web server的問題,也可能是 database的問題,失敗應用程式的故障點,如果可能,可以進行橫向或縱向擴展,
· 被ELB監控的實體都會上報 InService, or OutService
· 健康檢查通過域實體互動檢查實體健康狀況
· 負載均衡器有他們自己的DNS 名稱,不需要指定IP

Figure 42 No Cross AZ LB

Figure 43 Cross AZ LB

Figure 44 Cross AZ LB1
高級負載均衡器理論:
· ELB將每個請求獨立地路由到負載最小的已注冊的EC2實體
· 跨區負載均衡器,使你能夠跨越多個可用區進行負載均衡
· Path patterns允許你根據請求中包含的url將流量定向到不同的EC2實體

Figure 45 Path pattern
· Sticky session允許你將用戶的會話系結到特定的EC2實體,這確保了在會話期間來自用戶的所有請求都會發送到同樣的instance
· 你也可以為ALB啟用sticky session,但是流量會被發送到目標組級別
· ALBs are redundant across at least two subnets.

Figure 46 sticky session
ELB
· Pre-Warming
· Connection Draining
· Client-Side SSL certificates
· Server Order Preference
· Cross-Zone
· SSL termination
· ELB HTTPS listener does not support Client-Side SSL certificates





10.2 Auto scaling group
通過使用 AWS Auto Scaling,您可以在幾分鐘內為作為您的應用程式的AWS 資源配置自動擴展,AWS Auto Scaling 控制臺提供了一個單一的用戶界面,可以統一管理多個 AWS 服務的自動擴展功能,您可以為單個資源或整個應用程式配置自動擴展,
AWS Auto Scaling 對流量存在每榷訓每周變化的應用程式很有用,這包括:
· 周期性流量,例如正常營業時間內的高資源利用率和夜間的低資源利用率
· 打開和關閉作業負載模式,例如批處理、測驗或定期分析
· 可變的流量模式,例如具有峰值增長的營銷活動
對于auto scaling,用戶是希望每次伸縮都遵從一定的規則,比如說基于CPU、memory、Disk的使用量,達到某個閾值在多長時間范圍內,自動彈起或關閉一定數量的instance,并進行健康檢查,新的instance和existing instance 提供同樣的服務,從而提高系統性能,
新建ASG launch configuration,這相當于是為以后彈起的實體做了一個template,這就需要你按照業務需求,對實體進行相應的配置,

Figure 47 Create launch configuration
新建伸縮組ASG,這里需要指定已有的launch configuration,VPC及subnet(AZ),考慮到高可用,可以指定幾個AZ,

Figure 48 Create ASG
進一步設定 scaling policy, 包括范圍,實體數量,伸縮指標等,

Figure 49 Config ASG
配置好以后的實際效果

Figure 50 ASG example
Exam tips:
· When creating an Auto Scaling group, you can specify the minimum and maximum size as well as a desired capacity and scaling policy. You cannot specify how many instances to add at once, nor the desired cost.
· While you can specify triggers that are used to grow or shrink the group, you can not specify a memory allocation or a minimum processing threshold (neither is an actual AWS term).
· A launch configuration contains an AMI ID, key pair, instance type, security groups, and possibly a block device mapping.
· A launch configuration needs a single AMI ID to use for all instances it launches.
· There are a number of valid scaling policies for Auto Scaling: Maintain current instance levels, manual scaling, schedule-based scaling, and demand-based scaling
§ You can choose to maintain current instance level at all times. This is essentially ensuring that no instances are added unless an instance fails its health checks and needs to be restarted or replaced.
§ Demand-based scaling allows you to specify parameters to control scaling. One of those parameters can be CPU utilization, so this is the policy you’d use for this use case.
§ Schedule-based scaling allows you to specify a particular time period during which resources should scale up or down.
§ Manual scaling allows you to specify a minimum and maximum number of instances as well as a desired capacity. The Auto Scaling policy then handles maintaining that capacity.
autoscaling
· Scheduled scaling cannot be overlap
· choose greatest impact when Multiple Policies
· cooldown period
· Termination Policy


10.3 API gateway
只需要在AWS管理控制臺中的幾次點擊,你就可以創建一個API當作“前門”,為應用程式訪問資料、業務邏輯或從后臺服務的功能,如應用程式運行在AWS EC2上,代碼運行在AWS lambda上或任意的web 應用程式,
API網關的功能特性:
· 暴露https endpoint來定義RESTful API
· 無服務器地連接到類似Lambda和DynamoDB
· 將每個API endpoint發送到不同的目標
· 低成本高效運行
· 輕松伸縮
· 通過API key追蹤和控制使用情況
· 限制請求以防止攻擊
· 連接到CloudWatch記錄所有請求,用于監控
· 維護多版本的API
如何配置API網關:
· 定義API(容器)
· 定義資源和嵌套資源 (url路勁)
· 為每個資源
§ 選擇受支持的http方法
§ 設定安全
§ 選擇目標,如EC2, Lambda,DynamoDB等
§ 設定請求和回應轉換
Same origin policy--同源策略
在計算中,同源策略是web應用程式安全模型中的一個重要概念,根據該策略,web瀏覽器允許包含在第一個web頁面中的腳本訪問第二個web頁面中的資料,但前提是兩個web頁面具有相同的來源,這樣做是為了防止跨站點腳本攻擊
· 由web瀏覽器強制執行
· 被Postman和curl這樣的工具忽略
CORS—Cross-origin resource sharing是另一端的服務器(而不是瀏覽器中的客戶端代碼)輕松訪問同源策略的一種方式,跨資源共享是一種機制,它允許從提供第一個資源的域之外的另一個域請求web頁面上的受限資源,例如fonts,
API網關考試提示:
· 記住API網關是High level的
· API 網關有快取功能,以提高性能
· 低成本,可自動擴展
· 限制請求以防止攻擊
· 可以將結果記錄到CloudWatch
· 如果使用Javascript/AJAX,使用多域名的API網關,確保啟用了CORS
· 客戶端可強制執行CORS
10.4 HA—High Availability
HA—高可用,其設計目的是用于故障轉移和災難恢復,如果條件允許,盡可能將你的應用程式部署在不同的AZ,甚至在不同的region,一般情況,HA的設計至少含3個AZ,可以容忍其中的某個AZ故障,程式仍可以正常對外提供服務,
記住一下幾點:
· HA總是為故障而設計
· 盡可能使用多個AZ和多個region
· 了解RDS Multi-AZ和 Read replicas之間的區別
§ Multi-AZ: 為了故障轉移和災難恢復
§ Read replicas: 為了提升讀取性能
· 了解橫向擴展和縱向擴展的區別
§ 橫向擴展:增加配置相同的機器,計算能力和帶寬同時擴展
§ 縱向擴展:增加本身機器的配置,如CPU, memory,可能會有網路瓶頸

Figure 51 HA architecture
11 CloudFormation, Elastic Beanstalk and Lambda
11.1 CloudFormation
CloudFormation的好處:
· 基礎設施代碼(Infrastructure as code)
§ 不需要手動創建資源,這對控制非常好
§ 可以使用git對代碼進行版本控制
§ 對Infrastructure的更改,通過代碼進行審查
· 成本 cost
§ 堆疊(stacks)中的每個資源都用一個識別符號標記,因此你很容易看到一個堆疊要花費多少錢
§ 你可以通過CloudFormation模板來估算資源成本
§ 節約策略:在開發中,你可以在下午5點自動洗掉模板,并在早上8點安全地重新創建
· Productivity
§ 能夠在云上破壞和重建一個infrastructure
§ 為你的模板自動生成圖表(diagram)
§ 宣告式編程,不需要確定順序和編制
· 關注分離(separation): 為許多apps 和 layers創建許多堆疊(stacks)
§ VPC stacks
§ Network stacks
§ APP stacks
· 不用重新開發 don’t re-invent the wheel
§ 利用web上現有的模板
§ 利用檔案
CloudFormation如何作業:
· 模板必須在S3中上傳,然后在CloudFormation中參考
· 要更新模板,我們不能編輯以前的版本,我們必須要上傳新版的模板到AWS
· Stacks通過名稱來標識
· 洗掉stack,將洗掉由CloudFormation創建的每個組件
· CloudFormation模板部署
§ 手動方式
§ 在CloudFormation設計器中編輯模板
§ 使用控制臺輸入引數
§ 自動方式
§ 在YAML檔案中編輯模板
§ 使用AWS CLI 部署模板
§ 當你完全想要你的流程自動化時,推薦此方法
· CloudFormation的構建模塊
§ 模板組件
§ 資源:在模板中宣告的AWS 資源 (Mandatory)
§ 引數:模板動態輸入
§ Mapping: 模板的靜態變數
§ 輸出: 參考已創建的內容
§ 條件:列出對資源創建的條件
§ Metadata—元資料
§ 模板幫助器
§ 參考
§ 功能
CloudFormation allows you to automate provisioning and, in this case, to create standardized JSON scripts that can be lightly modified to stand up entire stacks for multiple applications that share a common structure.
By default, CloudFormation ensures all or nothing deployment. If there is an error at any step and CloudFormation is not able to proceed, then it will remove all AWS resources in a stack that were created by CloudFormation
11.2 Elastic Beanstalk
AWS Elastic Beanstalk 讓開發人員能夠更加輕松地在 AWS 云中快速部署和管理應用程式,開發人員只需上傳應用程式,Elastic Beanstalk 將自動處理容量預配置、負載均衡、Auto Scaling 和應用程式運行狀況監控的部署細節,
Elastic Beanstalk 支持在 Go、Java、.NET、Node.js、PHP、Python 和 Ruby 中開發的應用程式,當您部署應用程式時,Elastic Beanstalk 構建選定的受支持的平臺版本并預置一個或多個 AWS 資源(如 Amazon EC2 實體)來運行您的應用程式,您可以使用 Elastic Beanstalk 控制臺、AWS Command Line Interface (AWS CLI) 或 eb(為 Elastic Beanstalk 專門設計的高級 CLI)與 Elastic Beanstalk 進行互動,

Figure 52 Elastic Beanstalk work flow
AWS CloudFormation 與 AWS Elastic Beanstalk 有什么區別?
這些服務的設計目的是使二者相輔相成,AWS Elastic Beanstalk 提供了一個可在云中輕松部署和運行應用程式的環境,它與開發人員工具相集成,為您提供“一站式”的應用程式生命周期管理體驗,AWS CloudFormation 是一種便捷的預置機制,支持種類廣泛的 AWS 和第三方資源,它支持許多不同型別的應用程式的基礎設施需求,如現有的企業級應用程式、舊式應用程式、使用各種 AWS 資源構建的應用程式,以及基于容器的解決方案(包括使用 AWS Elastic Beanstalk 構建而成的解決方案),
AWS CloudFormation 支持 Elastic Beanstalk 應用程式環境,將其作為其中一種 AWS 資源型別,例如,這可使您創建和管理 AWS Elastic Beanstalk 托管的應用程式,以及用于存盤應用程式資料的 RDS 資料庫,除了 RDS 實體,還可向該組添加任何其他受支持的 AWS 資源,
Exam tips:
§ Elastic Beanstalk is focused on code deployment. It provides that, and in the process, load balancing, Auto Scaling, health monitoring, and capacity provisioning
§ Elastic Beanstalk is an Amazon service that spins up and manages a number of other services, in particular, compute. Even though you can configure other services, though, Beanstalk is considered to primarily be a code deployment tool and therefore is focused on compute services.
§ Elastic Beanstalk can deploy your code and handle capacity provisioning, load balancing, and setting up Auto Scaling and health checks, all with very little oversight. Note that you’d still need personnel to keep an application like this running, but Elastic Beanstalk can reduce initial resources needed for application deployment.
§ Rolling deployment – Updates a batch of instances. Each batch is taken out of service and available capacity is reduced by the number of instances in the batch. All at once deploys new version to all instances simultaneously. Instances are out of service for a short period. Rolling with additional batch – Launches additional batch of instances to maintain full capacity during deployment. It deploys version in batches. Immutable – Deploys new version to a fresh set of instances





11.3 Lambda
Lambda基礎
Lambda是最終的提取層:
· 資料中心
· 硬體
· 匯編代碼/協議
· 高級語言
· 作業系統
· 應用層 /AWS APIs
· AWS lambda
你可以用以下方式來使用lambda:
· 作為一個事件驅動的計算服務,AWS運行你的代碼以回應事件,這些事件可以是對Amazon S3 bucket或Amazon DynamoDB表中的資料更改
· 作為一個計算服務,運行你的代碼以回應使用API網關的HTTP請求或使用AWS sdk進行的API呼叫,

Figure 53 Lambda classic
傳統架構 vs 無服務器架構

Figure 54 Traditional vs serverless
Lambda考試提示:
· Lambda自動進行橫向擴展,而不是縱向
· Lambda功能是獨立的,一個事件=一個功能
· Lambda是serverless
· Lambda功能可以觸發其他Lambda功能,這也就意味著一個事件可以等于多個功能
· Lambda架構可以變得極其復雜,AWS X-ray允許你除錯正在發生的事件
· Lambda可以做全域的事情,你可以用它把S3 bucket 備份到其他S3 bucket
· 清楚知道你的觸發器是什么
· By default, Lambda allows 1000 concurrent executions across all functions within a region. You can increase this limit by contacting support.
· By default, Lambda allows outbound calls to internet
· With Lambda, you have to choose amount of memory needed to execute your function. Based on the memory configuration, proportional CPU capacity is allocated.
· Lambda support versioning and you can maintain one or more versions of your lambda function. Each lambda function has a unique ARN. Lambda also supports Alias for each of your functions. Lambda alias is a pointer to a specific lambda function version. Alias enables you to promote new lambda function versions to production and if you need to rollback a function, you can simply update the alias to point to the desired version. Event source needs to use Alias ARN for invoking the lambda function.
Serverless website 案例

Figure 55 Serverless website example
12 Mornitoring

13 Other services
13.1 AWS Organizations
· 全域服務
· 允許管理多個AWS賬戶
· 主賬號是master account,你不能更改
· 其他賬戶是member account
· member account只能是一個organization的一部分
· 跨所有賬戶合并賬單à單一付款方法
· 從合并用量中得到價格優惠(容量打折)
· API 可以用于自動創建AWS 賬戶
OU & Service control policies (SCPs)
· Organization account 在organization unit(OU)中
§ 可以是任何事: dev/test/prod or finance /HR/IT
§ 可以嵌套OU
· 將SCPs用于OU
§ 允許/拒絕訪問AWS
§ SCP的語法類似于IAM
§ 它是對IAM 的過濾
· 有助于創建 sandbox賬戶
· 有助于分離開發和產品資源
· 有助于只允許已批準的服務

Figure 56 OU nest
13.2 AWS WorkSpaces
· 托管的,安全的云桌面
· 極大地消除了On-promise VDI的管理 VDI(Virtual desktop infrastructure)
· 按需的,根據使用付費 pay as you go
· 安全,加密,網路隔離
· 與Microsoft Access Directory 集成

Figure 57 WorkSpaces
13.3 AWS AppSync
· 通過移動和web應用程式實時存盤和同步資料
· 使用GraphQL (來自Facebook的移動技術)
· 客戶端代碼可自動生成
· 實時訂閱
· 與DynamoDB / Lambda集成
· 離線資料同步 (代替Cognito 同步)
· 細粒度安全
13.4 AWS Single Sign On (SSO)
· 跨多個AWS賬戶和業務程式(office365,salesforce,box),集中管理單點登錄
· 一次登錄就能讓你安全地訪問所有東西
· 與Microsoft Access Directory 集成
· 有助于減少公司設立SSO的程序
· 只對 web 瀏覽器有幫助,支持SAML2.0 的應用程式
13.5 ECSàElastic Container Service
13.5.1 ECS concept
ECS Cluster: 一系列EC2實體
ECS Service: 運行在 ECS cluster上的應用程式定義
ECS task + definition: 運行容器用于創建應用程式
ECS IAM roles: 分配給tasks的角色,用于與AWS互動

Figure 58 ECS cluster
· ECS是一個容器編制服務
· ECS幫助你在EC2實體上運行docker容器
· ECS比較復雜,由以下組成:
§ ECS core:運行ECS在用戶提供的EC2實體是
§ Fargate: 在由AWS 提供的計算服務上運行ECS task (serverless)
§ EKS: 在AWS 驅動的K8S(跑在EC2上) 上運行ECS
§ ECR: 由AWS托管的docker 容器注冊表
· ECS和Docker都是非常流行的微服務
· 目前只有ECS core和ECR 在考試范圍
· IAM 和角色是在ECS任務級
· ECS Scheduler is responsible for placing the tasks on container instances. Service is where you configure long running tasks and how many containers you need.
· For each task copy, containers that are defined as part of a single task definition are placed together.




13.5.2 Docker
· Docker是一個容器技術
· 運行容器程式在任意安裝了Docker的機器上
· 容器允許我們的運用程式以相同的方式運行在任何地方
· 容器是相互隔離的
· 你可控制分配容器的CPU和記憶體
· 能夠做網路規則限制
· 比虛擬機效率高
· 容器能看快速伸縮(秒級)
AWS ECS use case
· 運行微服務
§ 能夠在同一機器上運行多個docker容器
§ 對于通訊增強,可以輕松實作服務恢復
§ 直接與ALB集成
§ 自動伸縮
· 運行批處理 / 定時任務
§ 計劃ECS 容器來運行 On-demand / reserved / spot 實體
· 遷移應用程式到云上
§ 對在本地運行的遺留應用程式進行dockerize (容器化)
§ 將docker容器移到ECS上運行
13.5.3 AWS ECS 與ALB的集成:
· ALB與ECS 有直接集成的特性,叫“port mapping”埠映射
· 這允許由相同應用程式的實體在同一個EC2機器上
· Use cases
§ 增加彈性,即時運行在一個EC2 實體上
§ 最大化 CPU / cores的利用率
§ 能夠執行升級回滾,而不影回應用程式的運行

Figure 59 ECS-ALB
ECS setup & config file
運行EC2實體,安裝ECS代理和組態檔
使用ECS-Ready的AMI,也需要修改組態檔
ECS 組態檔: /etc/ecs/ecs.config

13.5.4 ECRàElastic Container Registry
· 在AWS 上存盤,管理和部署你的容器
· 完全與IAM & ECS集成
· 用HTTPS 傳輸和靜態加密

Figure 60 ECR workflow
13.6 Amazon EMR
· EMRà Elastic MapReduce
· EMR幫助創建Hadoop集群(大資料),用于分析和處理大量資料
· 集群可由上百個EC2實體組成
· 支持Apache Spark,Hbase, Presto, Flink ……….
· EMR關注所有的Provisioning 和 configuration
· 自動伸縮和與spot實體集成
· Use case: 資料處理,機器學習,web 檢索,大資料
13.7 AWS Step Function
· 對編排的你的lambda function,構建無服務器的可視化workflow
· 代表流為JSON 狀態機
· 特點: 順序執行,并行,條件,timeouts,錯誤處理……
· 可以與EC2, ECS, On premise servers, API 網關集成
· 最大執行時間是1年
· 有能力實施人為批復特性
· Use cases
§ 順序執行 order fulfillment
§ 資料處理
§ Web 應用程式
§ 任意workflow

Figure 61 Step function
13.8 AWS SWF – Simple workflow service
SWF是一種web 服務,它可以方便地跨分布式應用程式組件協調作業,SWF支持一序列的應用程式,包括media處理,web程式后端,業務流程作業流和分析 pipeline,將其設計為任務的協調,任務表示應用程式中的各種處理步驟,可由可執行代碼、web服務呼叫、人工操作和腳本執行,
· 協調運用程式間的作業
· 代碼運行在EC2上( not serverless)
· 最長運行時間是1年
· “Activity step” 和 “Decision step”
· 有人為干預的步驟
· 從web到warehouse交付是順序執行的
· 對新的應用程式,推薦使用step function, 除了:
§ 如果你需要外部信號在程序中進行干預
§ 如果你需要回傳值到父行程的子行程
SWF Actors
· Workflow starters--- 可以初始化啟動作業流的應用程式,這可以是電子商務網站下的訂單,也可以是移動app 搜索公交時間等
· Deciders---控制作業流執行中的活動任務流,如果作業流中的某個任務完成或失敗了,Decider將決定下一步要做什么
· Activity workers---執行活動任務
Exam tips:
· SWF provides an API, but it is neither the AWS-specific API nor language specific. Instead, SWF supports standard HTTP requests and responses.
· SWF is typically thought of as an asynchronous service, but it also supports synchronous tasking when needed.
· A SWF domain is a collection of related workflows.
13.9 SQSà simple queue service
· SQS 是基于pull,而不是push
· 訊息大小256kb
· 訊息可以在佇列里保留從1分鐘到14天,預設條件下的保存期是4天
· 可見超時,是指讀取器獲取訊息后,訊息在SQS中是不可見的時間量,如果在可見超時過期前處理作業,則訊息將從佇列中洗掉,如果在這段時間內沒有處理作業,則訊息將再次可見,另一個讀取器將處理它,這可能導致相同訊息被傳遞兩次
· 可見超時最長12小時
· SQS保證你的訊息將至少被處理一次
· SQS 長輪詢是一種從SQS檢索訊息的方法,常規的短輪詢是立即回傳的,即使正在輪詢的訊息佇列是空的,而長輪詢直到訊息到達訊息佇列或長輪詢超時才回傳回應
· QS queues only make an “attempt” to deliver messages in order (more or less a FIFO approach) but do not guarantee FIFO. If strict FIFO is needed, that option can be selected.
SWF vs SQS
· SQS的最長保存期14天,SWF作業流執行最多可持續1年
· SQS 提供一個面向訊息message-oriented的API, SWF 提供一個面向任務task-oriented的API
· 使用SQS,需要處理重復訊息,這可能需要確保訊息只能被處理一次;SWF確保任務只分配一次,并且不會重復
· 使用SQS,你要實作自己的應用程式級的跟蹤,特別是在應用程式使用多個佇列的情況下, SWF跟蹤應用程式中的所有任務和事件
13.10 SNS
· SNS--- Simple notification service
· 及時的,基于push的交付(無輪詢)
· 簡單的APIs和易于集成的應用程式
· 靈活的訊息傳遞,多傳輸協議
· 便宜,按需付費,不用預付
· 基于web 的AWS 管理console,提供簡單的 point-and-click介面
SNS vs SQS
· 都是AWS的訊息服務
· SNS-- Push
· SQS—Pull
Messages in SWF are tasks; messages in SQS are messages; messages in SNS are notifications
13.11 Elastic transcoder
· 云上的media 編碼器
· 將media 從其原始格式轉換到不同的格式,可以在智能手機、平板電腦、個人電腦等上播放的不同格式
· 提供流行的輸出格式編碼預置,這意味著你不需要的猜測哪些設定在特使設備上作業的最好
· 根據你轉碼的分鐘數和轉碼的解析度來支付

Figure 62 Elastic transcoder workflow
13.12 Kinesis
流式資料是由數千個資料源連續生成的資料,這些資料源通常是同時發送資料記錄,并且是小尺寸的(kb 順序),如:
· 網購
· 股票價格
· 游戲資料
· 社交網路資料
· 地理空間資料(uber,didi)
· IoT傳感器資料
Kinesis是AWS上一個處理流式資料的平臺,使加載和分析流資料變得容易,還提供了為業務需求構建自定義應用程式的能力,3種不同形式的kinesis:
· Kinesis stream
· Kinesis firehose
· Kinesis analytics
Kinesis Streams has a maximum retention of 7 days and Kinesis Firehose has a retention of 1 day


Figure 63 Kinesis stream
Kinesis stream 由shards組成:
· 對于讀取,每秒5個事務,最大的總資料讀取速率為 每秒2MB
· 對于寫,每秒最多1000條記錄,最大的總資料寫速率為 每秒1MB,包括磁區鍵
· Stream的資料容量是指定流的shards數量的函式,總容量是shards容量的總和

Figure 64 Kinesis Firehose
Kinesis stream資料可以持久,而Kinesis firehose 資料不能持久,

Figure 65 Kinesis Analytics

Figure 66 Kinesis components comparison
Kinesis Data Streams
Real-time data capture
Ingest and store data streams from hundreds of thousands of data sources:
- Log and event data collection
- IoT device data capture
- Mobile data collection
- Gaming data feed
Kinesis Data Firehose
Load real-time data
Load streaming data into data lakes, data stores, and analytics tools for:
- Log and event analytics
- IoT data analytics
- Clickstream analytics
- Security monitoring
Kinesis Data Analytics
Get insights in real time
Analyze streaming data and gain actionable insights in real time:
- Real-time streaming ETL
- Real-time log analytics
- Ad tech and digital marketing analytics
- Real-time IoT device monitoring













13.13 CloudFront







Delivery
· Request-Route53-edge location-Origin server
· Supports both static and dynamic content
RMTPà Real Time Messaging Protocol(實時訊息傳輸協議)
· S3 bucket as the origin
· users view media files using the media player that is provided by cloudfront; not the locally installed
· Web distribution for media Player and RMTP distribution for media files
· private content
· OAIà Origin Access Identity
· add header in http server, Origin to verify the request has come from CloudFront
· feature
· signed URLs and signed cookies
· for RTMP distribution
· restrict access to individual files
· access to multiple restricted files
Caching Based on Request Headers
Geo Restriction
Compressed Files
· Content-Encoding header on the file must not be gzip
· viewer uncompresses the file
· multi-upload to S3
SNI
Server Name Indication, 同一個IP可用選擇多個hostname, 用自己的SSL證書時選擇,一般是客戶端瀏覽器的選項
Dedicated IP
專屬主機IP,不和其他hostname共用,傳統SSL使用,現在大部分用SNI
https with S3, s3不能獨立用https, 但是結合cloudfront, 用 ACMà Amazon Certificate Manager 生成的證書可以通訊
Price
· Charge with: data out, request, Invalidation request, SSL certificates
· CloudFront is intended to cache and deliver static files from your origin servers to users or clients. Dynamic content is also servable through CloudFront from EC2 or other web servers. as CloudFront is a distribution mechanism, not a storage facility.
· Edge locations are used by CloudFront distributions to store cached content, EC2 instances can serve content from processes.
· CloudFront is AWS’s distribution network. It’s a content caching system that is ultimately a networking component of your AWS buildout.
· CloudFront can front a number of AWS services: AWS Shield, S3, ELBs (including ALBs), and EC2 instances. It also most recently supports Lambda@Edge as an origin.
· As CloudFront is typically associated with performance, and not a lot else. However, CloudFront also provides deep integration with many managed AWS services, such as S3, EC2, ELBs, and even Route53
· CloudFront automatically provides AWS Shield (standard) to protect from DDoS, and it also can integrate with AWS WAF and AWS Shield advanced. These combine to secure content at the edge. HTTPS is not required, and there is no KMS involvement with CloudFront.
· Edge locations number more than both regions and availability zones
· CloudFront is easy to set up and lets you create a global content delivery network without contracts. It’s also a mechanism for distributing content at low latency. Creating websites and the actual file storage are not features of CloudFront but of LightSail (for example) and S3, respectively.
· When you create a CloudFront distribution, you register a domain name for your static and dynamic content. This domain should then be used by clients.
· CloudFront will always handle requests that it receives. It will either return the requested content if cached or retrieve that content by requesting it from an origin server. It will not redirect the client, nor will it pass the request on directly.
· There is no charge associated with data moving from any region to a CloudFront edge location.
· CloudFront can store and serve both static (HTML and CSS) and dynamic (PHP,) content. SQL queries cannot be directly returned, nor can an actual Lambda function. You can front the result of a Lambda@Edge function, but not the function itself.
· An edge location is a data center that delivers CloudFront content. Edge locations are spread across the world.
· A distribution is the setup including your origin servers and how the content from those servers is distributed via CloudFront. It does not specifically refer to cached content at any given point in time.
· Edge locations check for updated content every 24 hours by default, but this value can be changed.
· Edge locations can be set to have a 0-second expiration period, which effectively means no caching occurs.
· RDS instances cannot be origin servers
· A collection of edge locations is a distribution.
· An RTMP distribution is the Adobe Real-Time Messaging Protocol and is suitable for using S3 buckets as an origin server to serve streaming media
· CloudFront supports both web distributions and RTMP distributions.
· An Origin Access Identity is a special user that you will set up the CloudFront service to use to access you restricted content
· The invalidation API is the fastest way to remove a file or object, although it will typically incur additional cost.
· While edge locations are typically read from by clients, they are also writeable. You can store objects on edge locations as well as read from them.
· CloudFront will always handle requests that it receives. It will either return the requested content if cached (A) or retrieve that content by requesting it from an origin server (C). It will not redirect the client (D), nor will it pass the request on directly (B).
13.14 CloudWatch
CloudWatch provides disk read operations, CPU usage, and inbound network traffic but does not provide memory usage by default.
13.15 WAF & Shield








A PUT request is used for establishing a session with IMDS version 2. In response, IMDS issues a session token that is valid for TTL specified in the PUT call. With IMDS v2, all calls to metadata service must include the token in the X-aws-ec2-metadata-token header. PUT is used as several firewalls, and proxies do not forward PUTs. Besides, IMDS V2 does not issue a token when the PUT request has an X-Forwarded-For header.


13.15.1 WAFà Web Application Firewall
AWS WAF Protect your web applications from common web exploits
AWS WAF is a web application firewall service that lets you monitor web requests that are forwarded to an Amazon API Gateway API, an Amazon CloudFront distribution, or an Application Load Balancer. You can protect those resources based on conditions that you specify, such as the IP addresses that the requests originate from.



With WAF IP Address sets, you have a scalable solution for whitelisting or blacklisting. This solution supports 1000s of IP address blocks. The WAF IP Address sets and Regex Pattern Sets are reusable across different Web ACLs. Security Group has a limit of a few hundred entries, and Network ACL has a limit of a few 10s of entries.

13.15.2 Shield
AWS Shield provides expanded DDoS attack protection for your AWS resources. Get 24/7 support from our DDoS response team and detailed visibility into DDoS events.
As an AWS customer, you automatically have basic DDoS protection with the AWS Shield Standard plan, at no additional cost beyond what you already pay for AWS WAF and your other AWS services. For an additional cost, you can get advanced DDoS protection by activating the AWS Shield Advanced plan.
AWS Shield standard:
§ Protect agaist layer3 and 4 attacks
§ DDos and other infrastructure level attacks
§ Included for all customers
§ Free
UDP reflection attack (layer 3)

SYN Flood (layer 4)

13.16 Manage resources at scale



Systems Manager also provides a browser-based command line and shell interface for managing Windows and Linux instances. A big benefit is administrators can use IAM to grant and revoke access to the system. The allows you to control through IAM which user can access each instance including the option to provide non-root access. The users can connect to the system without SSH or RDP or Bastion host. This approach vastly simplifies your setup as you no longer need to manage SSH keys or passwords for the servers and eliminates the need for bastion hosts.

AWS config continuously monitors your infrastructure, checks for compliance, and alerts you of changes. Using the managed rules in Config, you can quickly get started with best practices to keep your infrastructure compliant with your enterprise policies. You can also customize by writing your own rules. CloudTrail maintains an audit trail of all changes to pinpoint who made the changes and when. With Systems Manager, you get visibility and control of your ec2 and on-premises server infrastructure. With AWS Trusted Advisor, you can benchmark your environment against AWS Best Practices.

With AWS Inspector, you can quickly find out security exposures and vulnerabilities in your EC2 instance. It can identify the ports that are reachable from outside of VPC, and it will also identify the process that is listening on the port. The inspector will compare the installed OS and software against known vulnerabilities in the CVE list. It evaluates your instance against the center for industry security (CIS) benchmarks for host hardening. The inspector also checks your instance against AWS security best practices. Inspector will prioritize the findings based on the severity

Trusted Advisor is an online tool that provides real-time guidance to help you provision your resources following AWS best practices. By following recommendations provided by Trusted Advisor regularly, you can provision your resources optimally
AWS Trusted Advisor is an online resource that helps you reduce cost as well as increase performance and improve security.




14 Cloud migration












Tools for cost estimation

AWS support plan




轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/244195.html
標籤:其他
上一篇:MySQL中最實用的SQL陳述句
