AWS SAA summary--Exam

1 Overview introduction

SAA 备考目的是为了提高职场竞争力和自我能力实现。这是对近3个月的学习所做的知识点总结,这里将基于这个图例,从外而内的剖析每个部件的功能特征,归纳总结知识点。

这是一个基础框架,很多专业的知识点未被展示在这张图中,而对于学习备考和将来的使用又是非常必要的,这里也会做对应的扩展延申总结,比如ELB, RDS, IAM, EBS, SNS, SQS等。由于报考语言选择英语,这中间有很多从sample question 中复制的解析,或者是PPT截图,均为英文版,故内容为中英混合。

clip_image002

Figure 1 Architecture overview Diagram

2 IAM

2.1 IAM overview

IAM – Identity access management, 这个功能是入门AMS将接触的第一功能。备考时,你首先要注册一个免费的AWS 账号,这就涉及IAM的功能,包含账号和角色管理,其底层依赖都是Policy。

IAM由以下部分组成:

· 用户 users

· 组 groups

· 角色 roles

· 策略 policies

clip_image004

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": "*"

}

]

}

clip_image006

clip_image008

clip_image010

clip_image012

clip_image014

clip_image016

clip_image018

clip_image020 clip_image022 clip_image024 clip_image026 clip_image028 clip_image030 clip_image032

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

clip_image034

Figure 3 Cognito in action

Cognito 用例

推荐使用Facebook等社交媒体账户的web 身份联合。

clip_image036

Figure 4 FaceBook with WIF

Cognito在应用程序和Facebook或Google之间进行代理,以提供映射到IAM角色的临时凭证,从而允许访问所需资源。不需要应用程序在设备本地嵌入或存储AWS凭证,它为用户提供跨所有移动设备的无缝体验。

Cognito追踪用户身份和他们登录的不同设备之间的联系,为你的应用程序提供无缝的用户体验,cognito使用push同步来跨多个设备推送更新和同步用户数据。当存储在云中的数据发生变化时,cognito使用SNS向所有与给定用户身份相关的设备发送通知。

clip_image038

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.

clip_image040

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.

clip_image042

Figure 7 Create custom VPC

对比新建一个VPC之后,可以看出,后者不只是多出一个VPC,同时还多了一个route table, Network ACLs and Security group. 这里是没有新增internet 网关的,也就是说,默认情况下,custom VPC都是私有的, 而default VPC是公有的。

clip_image044

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 子网中更新路由表,确保实例间可以正常通信

clip_image046

Figure 9 VPC Peering

VPC Peering 动手实验

clip_image048

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 用作指向受支持服务的流量的入口点,支持以下服务:

clip_image050

Figure 11 Supported services by Interface endpoint

针对于gateway endpoint和S3之间的动手实验:

clip_image052

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 连接在您这一端的实体设备或软件应用程序。

clip_image054

Figure 13 Single VPN connection

使用中转网关的单一 Site-to-Site VPN 连接

clip_image056

Figure 14 VPN with transit gateway

如果您有多个 AWS Site-to-Site VPN 连接,您可以使用 AWS VPN CloudHub 在各个站点之间提供安全的通信。这可使您的远程站点彼此进行通信,而不只是与 VPC 进行通信。VPN CloudHub 在简单的星型拓扑连接模型上操作,您可以在使用或不使用 VPC 的情况下操作 VPN CloudHub。这种设计适合有多间分公司和现有 Internet 连接的客户,帮助他们实施方便、潜在低成本的星型拓扑连接模型,以便在这些远程办公室之间建立主要或备用连接。

clip_image058

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 的访问

clip_image060

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 实例,实现容灾。

clip_image062

Figure 24 NAT instance

NAT gateway,这是完全托管在aws的服务,你不需要维护其可用性,default情况下,NAT gateway就是高可用的。创建NAT gateway 时,需要关联一个EIP—Elastic IP address, 这里需要注意的是EIP是收费的,为了考试而创建的免费账号,使用EIP时需慎重,不用时及时释放掉,不然aws会按照你所占有该EIP的时间来收取费用,不管这期间你有没有使用到此功能。

clip_image064

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登录到网络深处的其他实例(在私有子网中)。

clip_image066

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。clip_image068

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类似。然而,它们有一些关键的区别,我将在本节中强调这些区别。

clip_image070

Table 3 Security group and NACL comparison

· 安全组在EC2实例级起作用;NACL在子网级起作用。这是最明显的区别,很可能在考试中被提到。

· NACL允许分别为入站和出站流量定义allow/deny规则;安全组只能定义应用于入站和出站的allow规则,你不能为一个规则定义不同的行为。

· 安全组是有状态的, 任何允许流入的东西都会自动允许流出;而NACL是无状态的,这意味着NACL必须允许返回流量。例如,您需要一个入站规则和一个出站规则。

· 缺省情况,SG的outbound rule是允许所有流量流出, 如果删除此规则,则从instance 主动发起的流出请求将被拒绝, 而流入的流量仍然允许流出。

· NACL规则按数值顺序计算。SG在决定是否允许通信流进入实例之前,将处理所有安全组规则。

· 最后,NACL规则适用于子网中的所有实例。因此,如果流量在NACL级别被阻塞,但在实例级别被允许。它永远不会到达实例,因为它在应用安全组规则之前就被阻塞了。

clip_image072

Figure 28 Inbound rules comparison

clip_image074

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.

clip_image076

Figure 17 AMI channel

EC2 需要指定VPC 和subnet,如果创立在default VPC 中,这两项都可以选默认配置。如果指定在custom VPC中,则需要提前创建subnet。默认情况下,新建的VPC中没有subnet。

clip_image078

clip_image080

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.

clip_image082

Figure 19 Create subnet

配置路由表,增加一条路由记录, 使IGW 可以访问internet。

clip_image084

Figure 20 Config route table

可以高级配置中预写入脚本,让实例启动时,自动安装服务,

clip_image086

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提供了四种卷类型。

clip_image088

clip_image090

clip_image092

clip_image094

clip_image096

· 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— 容灾优先。

clip_image098

Figure 22 RAID0

clip_image100

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

clip_image102

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美元)。

clip_image104

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记录示例

clip_image106

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

· 使用场景: 当需要重定向到单个资源时使用

· 不能将健康检查附加到简单路由策略

· 当返回多个值时,客户端将随机选择一个

clip_image107

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 范围内的任意数字。

clip_image109

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将使用健康检查检查你的主站点健康情况,一旦发现主站点丢失,就会将流量路由转发到从站点上。

clip_image111

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 深度存档),适用于长期存档和数字保留。

clip_image113

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

clip_image115

clip_image117

clip_image119

clip_image121

· 缺省条件下,所有新建的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”

clip_image123

clip_image125

clip_image127

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.

clip_image129

clip_image131

clip_image133

8.2 S3 replication

clip_image135

clip_image137

clip_image139

clip_image141

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小时则是可接受的

clip_image143

clip_image145

clip_image147

8.3.2 S3 comparison

所有的S3存储类型,都具有相同的持久性,即 11 9s。考试中常考点是在可用性和SLA的区别。

clip_image149

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” 。使用此方法加密,其可靠性低,因为数据被检索后会自动解密,无论是合法还是非法的检索。

clip_image151

Figure 34 SSE-S3

SSE-KMS –> KMS的优势是用户控制和审计追踪,当题干中有audit出现,则应考虑的加密方式即为 SSE-KMS。Object是在server 端进行加密的,header 必须设置为: “x-amz-server-side-encryption”: “aws:kms”

clip_image153

Figure 35 SSE-KMS

SSE-Cà Object还是在server 端进行加密,但使用完全由客户在AWS外部管理的数据密钥,S3中保存用户的加密密钥。其他几种加密方式,传输时都是http 或https可选。但SSE-C必须使用https进行传输,且每个http请求都必须在header中提供加密密钥。

clip_image155

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

clip_image157

Figure 37 Client side encryption

clip_image159

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 youve 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

clip_image161

Figure 38 Object not public

S3 CORS à Cross-Origin Resource Sharing

如果你请求的数据来自另一个S3 bucket, 你就需要enable CORS, CORS允许您限制可以在s3中请求文件的网站的数量,并限制您的成本。常见的考试场景如下图:

clip_image163

Figure 39 CORS case

clip_image165

clip_image167

8.6 S3 lifecycle management

clip_image169

clip_image171

Define rules based on:

§ Object age

§ Current and previous version

Filter based on:

§ Prefix (images/, logs/)

§ Object tags (name= PHI)

clip_image173

clip_image175

clip_image177

clip_image179

clip_image181

clip_image183

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.

clip_image185

clip_image187

clip_image189

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, MySQLOracle, 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.

clip_image191

clip_image193

clip_image195

clip_image197

clip_image199

clip_image201

clip_image203

9.2.2 Aurora

clip_image205

· 以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

clip_image207

Figure 40 The comparison between MySQL and Aurora

clip_image209

clip_image211

clip_image213

clip_image215

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)

clip_image217

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

clip_image219

clip_image221

clip_image223

9.3.2 DynamoDB

AWS DynamoDB是一个快速和灵活的NoSQL数据库服务,适用于所有需要一致的、任何规模的延迟在个位数的应用程序,他是一个完全托管的数据库,支持文档和Key-value数据模型。它灵活的数据模型和可靠的性能使它非常适合于移动、web、游戏、广告技术、IoT和许多其他应用程序。mobile, web, gaming, ad-tech, IoT, and many other applications.

clip_image225

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

clip_image227

clip_image229

clip_image231

clip_image233

clip_image235

clip_image237

clip_image239

clip_image241

clip_image243

clip_image245

clip_image247

clip_image249

clip_image251

clip_image253

clip_image255

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

clip_image257

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

clip_image259

Figure 42 No Cross AZ LB

clip_image261

Figure 43 Cross AZ LB

clip_image263

Figure 44 Cross AZ LB1

高级负载均衡器理论:

· ELB将每个请求独立地路由到负载最小的已注册的EC2实例

· 跨区负载均衡器,使你能够跨越多个可用区进行负载均衡

· Path patterns允许你根据请求中包含的url将流量定向到不同的EC2实例

clip_image265

Figure 45 Path pattern

· Sticky session允许你将用户的会话绑定到特定的EC2实例。这确保了在会话期间来自用户的所有请求都会发送到同样的instance

· 你也可以为ALB启用sticky session,但是流量会被发送到目标组级别

· ALBs are redundant across at least two subnets.

clip_image267

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

clip_image269

clip_image271

clip_image273

clip_image275

clip_image277

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,这就需要你按照业务需求,对实例进行相应的配置。

clip_image279

Figure 47 Create launch configuration

新建伸缩组ASG,这里需要指定已有的launch configuration,VPC及subnet(AZ)。考虑到高可用,可以指定几个AZ。

clip_image281

Figure 48 Create ASG

进一步设置 scaling policy, 包括范围,实例数量,伸缩指标等。

clip_image283

Figure 49 Config ASG

配置好以后的实际效果

clip_image285

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

clip_image287

clip_image289

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,可能会有网络瓶颈

clip_image291

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 进行交互。

clip_image293

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

clip_image295

clip_image297

clip_image299

clip_image301

clip_image303

11.3 Lambda

Lambda基础

Lambda是最终的提取层:

· 数据中心

· 硬件

· 汇编代码/协议

· 高级语言

· 操作系统

· 应用层 /AWS APIs

· AWS lambda

你可以用以下方式来使用lambda:

· 作为一个事件驱动的计算服务,AWS运行你的代码以响应事件。这些事件可以是对Amazon S3 bucket或Amazon DynamoDB表中的数据更改

· 作为一个计算服务,运行你的代码以响应使用API网关的HTTP请求或使用AWS sdk进行的API调用。

clip_image305

Figure 53 Lambda classic

传统架构 vs 无服务器架构

clip_image307

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 案例

clip_image309

Figure 55 Serverless website example

12 Mornitoring

clip_image311

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账户

· 有助于分离开发和产品资源

· 有助于只允许已批准的服务

clip_image312

Figure 56 OU nest

13.2 AWS WorkSpaces

· 托管的,安全的云桌面

· 极大地消除了On-promise VDI的管理 VDI(Virtual desktop infrastructure)

· 按需的,根据使用付费 pay as you go

· 安全,加密,网络隔离

· 与Microsoft Access Directory 集成

clip_image314

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交互

clip_image316

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.

clip_image318

clip_image320

clip_image322

clip_image324

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的利用率

§ 能够执行升级回滚,而不影响应用程序的运行

clip_image326

Figure 59 ECS-ALB

ECS setup & config file

运行EC2实例,安装ECS代理和配置文件

使用ECS-Ready的AMI,也需要修改配置文件

ECS 配置文件: /etc/ecs/ecs.config

clip_image328

13.5.4 ECRàElastic Container Registry

· 在AWS 上存储,管理和部署你的容器

· 完全与IAM & ECS集成

· 用HTTPS 传输和静态加密

clip_image330

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

clip_image332

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 从其原始格式转换到不同的格式,可以在智能手机、平板电脑、个人电脑等上播放的不同格式

· 提供流行的输出格式编码预置,这意味着你不需要的猜测哪些设置在特使设备上工作的最好

· 根据你转码的分钟数和转码的分辨率来支付

clip_image334

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

clip_image336

clip_image338

Figure 63 Kinesis stream

Kinesis stream 由shards组成:

· 对于读取,每秒5个事务,最大的总数据读取速率为 每秒2MB

· 对于写,每秒最多1000条记录,最大的总数据写速率为 每秒1MB,包括分区键

· Stream的数据容量是指定流的shards数量的函数,总容量是shards容量的总和

clip_image340

Figure 64 Kinesis Firehose

Kinesis stream数据可以持久,而Kinesis firehose 数据不能持久。

clip_image342

Figure 65 Kinesis Analytics

clip_image344

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

clip_image346

clip_image348

clip_image350

clip_image352

clip_image354

clip_image356

clip_image358

clip_image360

clip_image362

clip_image364

clip_image366

clip_image368

clip_image370

13.13 CloudFront

clip_image372

clip_image374

clip_image376

clip_image378

clip_image380

clip_image382

clip_image384

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

clip_image386

clip_image388

clip_image390

clip_image392

clip_image394

clip_image396

clip_image398

clip_image400

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.

clip_image402

clip_image404

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.

clip_image406

clip_image408

clip_image410

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.

clip_image412

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)

clip_image414

SYN Flood (layer 4)

clip_image416

13.16 Manage resources at scale

clip_image418

clip_image420

clip_image422

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.

clip_image424

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.

clip_image426

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

clip_image428

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.

clip_image430

clip_image432

clip_image434

clip_image436

14 Cloud migration

clip_image438

clip_image440

clip_image442

clip_image444

clip_image446

clip_image448

clip_image450

clip_image452

clip_image454

clip_image456

clip_image458

clip_image460

Tools for cost estimation

clip_image462

AWS support plan

clip_image464

clip_image466

clip_image468

clip_image470

***************用努力照亮现实的梦!***********************
原文地址:https://www.cnblogs.com/orange2016/p/14226297.html