顯示具有 AWS Associate SysOps準備 標籤的文章。 顯示所有文章
顯示具有 AWS Associate SysOps準備 標籤的文章。 顯示所有文章

2016年11月23日 星期三

AWS Associate SysOps準備(第七天)

Simple Storage Service

常見問答集

S3資源策略 分為 Bucket Policy , acl與 IAM

IAM S3資源策略

ACL 能授權的使用者對象,不能針對user,能針對group

Canional User 的 Policy 可用於指定整個桶或物件

S3類型
標準版 standard availability 99.99%,  durability 99.999999999%

S3 IA avability 99.9% durability 99.999999999%

RRS版 avability 99.99%, durability 99.99%

Amazon S3 Transfer Acceleration
  • Transfer Acceleration enables fast, easy, and secure transfers of files over long distances between your client and an S3 bucket. 

S3 的加密方式 分為 Server-side 與 Client-side
資料保護可分為在傳送時與存放時兩種
  • 傳送時加密,可以透過ssl or Client-side Encryption
  • 存放時加密,可以透過 Server or Client-side Encryption 

Server-side加密的三種方式
  • KMS-Managed Encryption Keys
  • S3-Managed Encryption Keys
  • Customer-Provided Encryption Keys


Client-side加密的兩種方式
  • Using an AWS KMS-Managed Customer Master Key
  • 存放於Client,自行管理

使用CustomerKeys資料保密的方式

資料保密的方式

Enable Enhanced uploaded 

一致性
Eventual Consistency, 所有AZ間都為eventually consistency

Version
設定bucket為Version後,則不能對該bucket的version功能關閉,可管控版本數,每個版本都佔容量,要算錢,刪除後,並不會真的刪除,只是隱藏,若要刪除必須打開version可見,將被標記delete的檔案再次刪除,才會刪除

Life Cycle
可對檔案(包括version),設定過一段時間後,需進行什麼動作,可刪除亦可transfer to glacier

做網頁link

使用 Amazon S3 時,是否可以遵守歐盟資料隱私法規?
客戶可以選擇使用歐洲 (愛爾蘭) 的歐洲 (法蘭克福) 區域將所有資料存放在歐洲。您有責任確保自己遵守歐盟隱私法律。

Amazon S3 跨區域複寫 (CRR)?
CRR 是可跨 AWS 區域自動複寫資料的 Amazon S3 功能。

Transfer Acceleration?
Amazon S3 Transfer Acceleration 可在用戶端與 Amazon S3 儲存貯體之間提供快速、輕鬆且安全的長距離檔案傳輸。Transfer Acceleration 是利用 Amazon CloudFront 分佈在全球的 AWS 節點。

S3透過三種方式限制資料存取


Security Token Service


簡介
Grants users limited and temporary access to AWS resource.





Simple Queue Service


 基本定義
 Amazon Simple Queue Service (SQS) is a fast, reliable, scalable, fully managed message queuing service. SQS makes it simple and cost-effective to decouple the components of a cloud application. You can use SQS to transmit any volume of data, at any level of throughput, without losing messages or requiring other services to be always available.

AWS SQS 是分散式的,訊息處理時要做的事情。


AWS SQS default visibility timeout
可見性逾期時間
支援最長 12 小時的最大可見性逾時時間。
訊息保留期
SQS 訊息保留期是可設定的,可設定為 1 分鐘到 2 個星期之間的任何值。預設值為 4 天,一旦達到訊息保留期,您的訊息會被自動刪除。

sqs的url format

使用須知

SQS offers a message-oriented API

SQS  need to handle duplicated messages and may also need to ensure that a message is processed only once

SQS need to implement ur own application-level tracking, especially if ur application uses multiple queses.

沒有FIFO,裡面的request至少都會執行一次,是pull, Application須從queue裡拉request出來執行

若要有連續性,建議在message裡放入連續性資訊,透過回傳的時候重新排序

message 上限為256KB of text in any format,一個request裡能有1-10個不等的message,直到上限256kb

Each 64KB 'Chunk' of payload is billed as 1 request.
for example a single api call with a 256KB payload, will be billed as four requests



Simple Workflow Service



SWF presens a task-oriented API,

SWF ensures that a task is assigned only once and is never duplicated

SWF keeps track of all the tasks and events in an application

SWF Metrics for CloudWatch
CloudWatch that you can use to track your workflows and activities and set alarms on threshold values that you choose. 

Storage Gateway

常見問答集

介紹
AWS Storage Gateway 是連接現場部署軟體設備與雲端儲存的服務,在組織的現場部署 IT 環境和 AWS 的儲存基礎設施之間提供無縫且安全的整合。

Gateway-Cached Volumes
您可以將主要資料存放在 Amazon S3 中,然後將經常存取的資料保留在本機。

Gateway-Stored Volumes:
如果您需要低延遲存取整個資料集,可以配置現場部署資料閘道用於在本機存放主要資料,並將此資料的時間點快照異步備份到 Amazon S3。

Gateway-Virtual Tape Library (VTL)
用閘道 VTL 可擁有無限的虛擬磁帶集合。每個虛擬磁帶都可以儲存在 Amazon S3 支援的虛擬磁帶櫃或 Amazon Glacier 支援的虛擬磁帶架 (VTS) 中。

TroubleShoot issues with storage gateway

two sections:
gateways that are on-premises

on-premises gateway troubleshooting information covers gateways deployed on both the VMware ESXi and Microsoft Hyper-V clients.  

gateways that are deployed on Amazon EC2. 


Support



四種等級 Basic, Developer, Business, Enterprise


計費方式
在您註冊時收取一筆當月 (依比例分配) 和下個月的最低月服務費。接下來幾個月,則會向您預先收取下個月的最低費用。如果您的用量費用超過最低月服務費,則會在月底向您收取兩者的差額費用。由於月帳單結束的日期是下個月的第一天,因此帳單會同時反映當月用量費用以及下個月的最低月服務費



VPC


VPC 讓您能夠在 Amazon Web Services (AWS) 雲端佈建一個在邏輯上隔離的部分,以在自己定義的虛擬網路中啟動 AWS 資源。可以在公司資料中心和 VPC 之間建立硬體虛擬私人網路 (VPN) 連接,將 Amazon AWS 雲端當成公司資料中心的延伸。
 
組成要素
  • Virtual Private Cloud (VPC):AWS 雲端中邏輯隔離的虛擬網路。您可以從所選的範圍內定義 VPC 的 IP 地址空間。
  • 子網路:在 VPC 的 IP 地址範圍內的某個區段,可將隔離資源的群組放入其中。
  • 網際網路閘道:公有網際網路連線的 Amazon VPC 端。
  • NAT 執行個體:提供連接埠位址轉譯的 EC2 執行個體,可讓非 EIP 執行個體透過網際網路閘道存取網際網路。
  • 硬體 VPN 連接:您的 Amazon VPC 與資料中心、家用網路或主機代管設施之間的硬體 VPN 連接。
  • 虛擬私有閘道:VPN 連接的 Amazon VPC 端。
  • 客戶閘道:您的 VPN 連接端。
  • 路由器:路由器可以互相連接子網路,以及在網際網路閘道、虛擬私有閘道、NAT 執行個體和子網路之間引導流量。
  • 對等連線:對等連線可讓您透過兩個對等 VPC 之間的私有 IP 地址路由流量。
  • 適用於 S3 的 VPC 端點:可從 VPC 內存取 Amazon S3,而不使用網際網路閘道或 NAT,且允許您使用 VPC 端點政策控制存取。

vpc 精靈創造的template,需要重確認是否會幫忙創造NAT,有的template會

若vpc裡面還有instance,則不可以直接刪除vpc

VPC 的 CIDR,一經設定後,即不可再變動

Subnet 的 CIDR範圍若是overlap會報錯

軟限制
Amazon VPC 支援大小在 /28 (CIDR 標記法) 和 /16 之間的 VPC

每個 VPC 可以建立 200 個子網路,可申請提高。

每個Region都只能有5個vpc、可申請擴增

只能五個EIP、Internet gateways

每個region 有 50個VPN connection、50個Customer 
Gateways 、 200張Route table、

每一個vpc有100個Security Groups

每一個˙Security Groups  能有50條Rules

使用須知

一個子網域只能協派給一個az

每個子網域內的ip會被aws保留五個,Amazon 會保留每個子網路的前四 (4) 個 IP 地址和最後一 (1) 個 IP 地址

刪除VPC時,Virtual Private Gateway會被保留下來

Security Group vs Network ACL

除了安全群組之外,透過網路存取控制清單 (ACL) 也可允許或拒絕進出每個子網路的網路流量。

VPC 中的安全群組指定獲允許進出 Amazon EC2 執行個體的流量。網路 ACL 會在子網路層級上運作,並評估進出子網路的流量。網路 ACL 可用來設定允許和拒絕規則。網路 ACL 不會篩選相同子網路中執行個體之間的流量。此外,網路 ACL 執行無狀態篩選,而安全群組則執行狀態篩選。 

安全群組不能跨越區域。

監控

可以使用 Amazon VPC Flow Logs 功能來監控 VPC 中的網路流量。

對等連線


對等連線只限於相同區域中的 VPC 之間,對等 VPC 必須擁有互不重疊的 IP 範圍。

能將我的 VPC 對等連接到其他 AWS 帳戶的 VPC

對等 VPC 中的執行個體之間的流量會保持私密且隔離

建立 VPC 對等連線是免費的,但是對等連線之間的數據傳輸則要收費。

問:如果將 VPC A 對等連接到 VPC B,再將 VPC B 對等連接到 VPC C,是否表示 VPC A 和 VPC C 已經對等連接? 
否。不支援轉移對等關係。

What Is a Customer Gateway?

Your company has decided to use an optional Amazon VPC VPN connection that links your data center (or network) to your Amazon VPC virtual private cloud (VPC). 


VPC Endpoints
A VPC endpoint enables you to create a private connection between your VPC and another AWS service without requiring access over the Internet, through a NAT device, a VPN connection, or AWS Direct Connect. 

VPC Flow logs


簡介
VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. 
Flow log data is stored using Amazon CloudWatch Logs. After you've created a flow log, you can view and retrieve its data in Amazon CloudWatch Logs.

應用場景
to troubleshoot why specific traffic is not reaching an instance, which in turn can help you diagnose overly restrictive security group rules. You can also use flow logs as a security tool to monitor the traffic that is reaching your instance.

付費按一般cloudwatch logs
no additional charge for using flow logs; however, standard CloudWatch Logs charges apply. 

使用時的情況
 If you create a flow log for a subnet or VPC, each network interface in the VPC or subnet is monitored. Flow log data is published to a log group in CloudWatch Logs, and each network interface has a unique log stream. Log streams contain flow log records, which are log events consisting of fields that describe the traffic for that network interface. 
 
 Flow logs限制
 
Trouble shooting
  • Incomplete Flow Log Records
  • Rate limited`: This error can occur if CloudWatch logs throttling has been applied — when the number of flow log records for a network interface is higher than the maximum number of records that can be published within a specific timeframe. 

  • Access error`: The IAM role for your flow log does not have sufficient permissions to publish flow log records to the CloudWatch log group. 

  • Unknown error`: An internal error has occurred in the flow logs service.

  • Flow Log is Active, But No Flow Log Records or Log Group

VPN Connections

災難備援


所謂RTO, RPO 的定義
RTO (Recovery Time Objective)
  • the length of time from which you can recover from a disaster

RPO (Recovery Point Objective)
  • the amount of data your organisation is prepared to lose in the event of a disaster

災難備份的幾種方式選擇

Backup & Restore

Pilot Light

Warm Standby
extends the pilot loight elements and preparation.

Multisite

Mult solution 要注意的地方
db的資料一致性問題,作者建議就都先指向一個db,另外一個dc的db會定期備份

Failing Back

Backup and restore 
Freeze data changes to the DR Site → Take a backup → Restore the backup to the primary site → Re-point users to the primary site → Unfreeze the changes

Pilot light, warm standby and multi-site

Establish reverse mirroring/replication from the DR site back to the primary site, once the primary site has caught up with the changes

Freeze data changes to the DR site

Repoint users to the primary site
 
unfreeze the changes

其他


AWS的免費方案

Canonical user id

能夠Root access OS底層的幾種服務
EC2, EMR, ElasticBeanstalk, Oopswork

做滲透測試的時候要先通知AWS

ELB的Pre-warming 要告訴AWS,連同告知預測的用量


Bastion host
  • a security measure that u can implement which acts as a gateway between you and your EC2 instances

Resource Groups
make it easy to group resources using the tags that are assigned to them. u can group resource that share one or more tags

TRIM

DevPay 

SLA 服務水準協議

AWS Associate SysOps準備(第六天)

Route53


常見問答集

分流依據的幾種方式

50條Domain name 軟限制
有軟限制,在未提出申請前,最多只能管50條domain names

Route53支援DNS類型

  • A (地址記錄)
  • AAAA (IPv6 地址記錄)
  • CNAME (正式名稱記錄)
  • MX (郵件交換記錄)
  • NS (名稱伺服器記錄)
  • PTR (指標記錄)
  • SOA (起始授權記錄)
  • SPF (寄件者政策架構)
  • SRV (服務定位器)
  • TXT (文字記錄)

別名 Alias
「別名」記錄 (Route 53 特定的虛擬記錄)。別名記錄用於將託管區域的資源紀錄集對應到 Elastic Load Balancing 負載平衡器、CloudFront 分發或設定為網站的 S3 儲存貯體。別名記錄與 CNAME 記錄的工作原理類似,您可將一個 DNS 名稱 (example.com) 對應到另一個「目標」DNS 名稱 (elb1234.elb.amazonaws.com)。

Alias支援的種類

私有DNS
私有 DNS 是 Route 53 的一項功能,可以讓您在 VPC 中擁有授權 DNS,而不會將您的 DNS 記錄 (包括資源名稱及其 IP 地址) 公開給網際網路。

是否可以將多個 IP 地址與單一記錄關聯?
是。將多個 IP 地址與單一記錄關聯,通常用於平衡地理位置上分散的 Web 伺服器負載。Amazon Route 53 允許您為一個 A 記錄列出多個 IP 地址,並使用所有已設定 IP 地址清單回應 DNS 請求。

DNSSEC?

支援加權輪詢均衡 (WRR)?
是。加權輪詢均衡可讓您為資源紀錄集指派權數,以指定發出不同回應的頻率。


Amazon Route 53 的 Latency Based Routing (LBR) 功能?
LBR (Latency Based Routing) 是 Amazon Route 53 的一項新功能,有助於您為全球用戶提高應用程式的效能。

Amazon Route 53 的 Geo DNS 功能?
Route 53 Geo DNS 會根據請求發出的地理位置將其送至特定的終端節點,藉此調整負載平衡。Geo DNS 可以自訂當地語系化的內容,例如,以正確的語言呈現詳細資訊頁面,或將內容限制為僅配送到您已經授權的市場。

 Amazon Route 53 Traffic Flow?
Amazon Route 53 Traffic Flow 是一項簡單易用且經濟實惠的全球流量管理服務。

能在多個 VPC 使用同一個私有 Route 53 託管區域?
是,您可以將多個 VPC 關聯到單一託管區域。

私有 DNS 是否能跨 AWS 區域使用?
是。DNS 回答可以在與私有託管區域關聯的每個 VPC 中使用。

DNS 備援?
DNS 備援包含兩個部分,即運作狀態檢查和容錯移轉。



Tag

Tag的使用基本知識

Redshift


1 block size 為 1024kb

備份是存在s3, 每天自動備份一次

領導節點和運算節點分別有什麼作用?

領導節點會接收來自用戶端應用程式的查詢、分析查詢並且開發執行計劃,所謂的執行計劃是一套處理這些查詢的順序步驟。然後,領導節點與運算節點會協調這些計劃的平行執行、彙總來自這些節點的中繼結果,最後將結果傳回給用戶端應用程式。
運算節點會執行在執行計劃中指定的步驟,並在它們之間傳輸資料以服務這些查詢。中繼結果在傳回用戶端應用程式之前,會傳回給領導節點進行彙總。


Redshift 如何保護資料的安全?

Amazon Redshift 使用產業標準加密技術進行資料加密,確保傳輸中和靜態資料的安全。為了確保傳輸中的資料安全,Amazon Redshift 支援用戶端應用程式及 Redshift 資料倉儲叢集之間的已啟用 SSL 連線。而為了確保靜態資料安全,Amazon Redshift 使用硬體加速型 AES-256,在寫入磁碟時加密每個區塊。

Amazon Redshift 僅支援單一可用區部署。透過將資料從同一組 Amazon S3 輸入檔載入到不同 AZ 的兩個 Amazon Redshift 資料倉儲叢集,便可在多個 AZ 中執行資料倉儲叢集。

Amazon Redshift 如何備份資料?

載入資料時,Amazon Redshift 會複製資料倉儲叢集內的所有資料,並將其持續備份至 S3。Amazon Redshift 會一直嘗試至少維護三份資料 (運算節點上的原始資料和複本,以及 Amazon S3 中的備份)。



Simple Notifcation Service


常見問答集

可用於類似SMS的功能

Amazon SNS 與 Amazon SQS 有何不同?
Amazon Simple Queue Service (SQS) 和 Amazon SNS 都是 AWS 的簡訊服務,但為開發人員提供不同的優點。Amazon SNS 允許應用程式透過「推送」機制向多個訂閱者傳送時效性訊息,並且無需定期檢查或「輪詢」更新。Amazon SQS 是供分散式應用程式使用的訊息佇列服務,它透過輪詢模式交換訊息,可用來分開傳送和接收元件。



SNS and SQS are Both Messaging Services in AWS

SNS 每一百萬個request 0.5美


每十萬個Notification deliveries over HTTP  0.06美

$0.75 per 100 Notification deliveries over SMS

Amazon’s SNS has the following subscribers; Lambda, SQS, HTTPS, Email, SMS

Monitoring Amazon SNS with CloudWatch


Amazon SNS and CloudWatch are integrated so you can collect, view, and analyze metrics for every active Amazon SNS notifications.

gain better insight into the performance of your Amazon SNS topics, push notifications, and SMS deliveries.

amazon sns metrics

SNS integrate CloudTrail

Amazon SNS is integrated with CloudTrail, a service that captures API calls made by or on behalf of Amazon SNS in your AWS account and delivers the log files to an Amazon S3 bucket that you specify.

cloudtrail紀錄的行為