-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathAWS_Solution_Architecture_Associate.txt
More file actions
2975 lines (2394 loc) · 189 KB
/
Copy pathAWS_Solution_Architecture_Associate.txt
File metadata and controls
2975 lines (2394 loc) · 189 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Disclaimer:
------------
The information has been taken from the content in https://acloudguru.com/
I highly recommend you to purchase the course from https://acloudguru.com/
The purpose of these notes is to help students with their revision prior to taking the certification.
=----------------------------------------=
= AWS Solution Architect Associate Notes =
=----------------------------------------=
==========================================================================================================================================================================================
* IAM 101 and S3
==========================================================================================================================================================================================
identity access management offers the following features.
* Centralised control of your AWS account.
* Shared access to your AWS account.
* Granular permissions. So you can say, okay, I want people to be able to access this service, but I don't want people to be able to access that service.
* Identity Federation (including Active Directory, Facebook, LinkedIn ... etc)
* Multifactor authentication.
* Provides temporary access for users or devices and services where necessary
* Allows you to set up your own password rotation policy.
* Integrates with many different AWS services
* It supports PCI DSS compliance.
* PCI DSS compliance just is basically a compliant framework that if you're taking credit card details, you need to be compliant with the framework. So IAM supports PCI DSS.
https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html
Key Terminology for IAM:
1. Users: End users such as people, employees of an organisation ... etc
2. Groups: A collection of users. So each user in the group will inherit the permissions of the group.
3. Policies: policies are made up of documents, called policy documents. These documents are in a format called JSON and they give permission as to what a User/Group is able to do.
4. Roles: You can create roles and assign them to AWS resources
* Exam Tips:
* IAM is universal (Global). It doesn't apply to regions at this time.
* The "root account" is simply the account created when first setup your AWS account. It has complete Admin access.
* New Users have NO permissions when first created.
* New Users are assigned Access Key ID & Secret Access Keys when first created.
* These are not the same as a password. You cannot use the Access key ID & Secret Access to login to the console. You can use this to access AWS via the APIs and Command Line, however.
* You can get to view these once. If you lose them, you have to regenerate them. So, save them in a secure location.
* Always setup Multifactor Authentication on your root account.
* You can create and customise your own password rotation policies.
* S3 Exam Tips:
1. Remember that S3 is Object-based: i.e allows you to upload files.
2. Files can be 0 Bytes to 5 TB.
3. There is unlimited storage.
4. Files are stored in Buckets.
5. S3 is a universal namespace. That is, names must be unique globally. Example: https://s3-eu-west-1.amazonaws.com/acloudguru
6. Not suitable to install operating systems on S3 due to it being object based (not block storage - EBS), can only be used to store files
7. Successful upload will generate a HTTP 200 status code.
8. You can turn on MFA delete to avoid accidental delete.
9. The key fundamentals of S3 are:
- Key (This is simply the name of the object)
- Value (This is simply the data and is made up of a sequence of bytes).
10. S3 Model:
- Read after Write consistency for PUTS of new objects (if you write a new files and read it immediately afterwards, you will be able to view the data)
- Eventual Consistency for overwrite PUTS and DELETES (can take sometime to propagate) (If you update AN EXISTING file or delete a file and read it immediately, you may get the older version, or you may not. Basically changes to objects can take a little bit of time to propagate.)
11. S3 Storage Classes
1. S3 Standard: 99.99% availability, 99.99999999999% durability stored redundantly across multiple devices in multiple facilities and is designed to sustain the loss of 2 facilities concurrently.
2. S3 - IA (Infrequently Accessed): 99.9% availability, For the data that is accessed less frequently, but requires rapid access when needed. Lower fee than S3, but you are charged a retrieval fee.
3. S3 - Intelligent Tiering: 99.9% availability, Designed to optimise costs by automatically moving data to the most cost-effective access tier, without performance impact or operational overhead.
4. S3 One Zone IA (also called S3 RRS): 99.5% availability, For where you want a lower-cost option for infrequently accessed data, but do not require the multiple availability zone data resilience.
5. S3 Glacier: S3 Glacier is a secure, durable and low-cost storage class for data archiving. You can reliably store any amount of data at costs that are competitive with or cheaper than on-premises solutions. Retrieval times are configurable from minutes to hours.
6. S3 Glacier Deep Archive: S3 Glacier Deep Archive is Amazon's lowest-cost storage class where a retrieval time of 12 hours is acceptable.
7. S3 Outposts for on-premises object storage to meet data residency needs.
* S3 Bucket Exam Tips:
12. Bucket names share a common name space, you can't have the same bucket name as the others.
13. When you view Buckets you view them globally but you can have buckets in individual regions.
14. We can use cross region replication to replicate buckets automatically to different regions.
15. We can change storage class and encryption on the fly.
16. Transfer acceleration
17. Restricting Bucket Access:
1. Bucket Policies - Applies across the bucket.
2. Object Policies - Applies to individual files.
3. IAM Policies to Users & Groups - Applies to Users & Groups.
18. By default Buckets are not public.
19. You can use bucket policies to make entire S3 buckets public.
20. You can use S3 bucket to host static websites but can't host dynamic websites or websites which require database, for ex: Wordpress...etc.
21. Control access to buckets using either a bucket ACL or bucket policies.
22. When we change from Allow to Deny on a policy OR create a policy with DENY, it's called an explicit DENY and it would always overwrite the allow in any other policy.
23. By default, all permissions are implicitly denied.
* Important: Read S3 FAQ's: https://aws.amazon.com/s3/faqs/
* S3 Pricing Tier: What drives the price?
What makes up the cost?
1. Storage
2. Requests and Data Retrievals
3. Data Transfer
4. Management and Replication
* S3 Pricing (Very Important) Exam Tips:
Understand how to get the best value out of s3
1. S3 Standard - Avoid S3 Standard, use S3 - Intelligent Tiering
2. S3 IA
3. S3 - Intelligent Tiering
4. S3 One Zone - IA (No redundancy, if the zone fails, we loose the data)
5. S3 Glacier - For Archival services
6. S3 Glacier Deep Archive - For Archival services
* S3 Security & Encryption:
1. By default, all newly created buckets are PRIVATE, you can setup access control to your buckets using;
a. Bucket Policies
b. ACL'S
2. S3 buckets can be configured to create access logs which log all requests made to the S3 bucket.
This can be sent to another bucket or even another bucket in another account.
* S3 Encryption (Very important - will be tested on this in the exam)
1. Encryption In Transit is achieved by
a. SSL/TLS (HTTPS)
2. Encryption at Rest (Server Side) is achieved by
a. Serve-Side
1. S3 Managed Keys - SSE - S3
2. AWS Key Management Service, Managed Keys - SSE-KMS
3. Serve-Side Encryption with Customer Provided Keys - SSE-C
b. Client-Side Encryption
4. Done by the client
Lab: We can encrypt the files in S3 by using AES-256 or AWS-KMS.
Note: AWS-KMS is beyond the scope of this exam
* S3 Encryption Demo
1. Stores all versions of an object (including all writes and even if you delete an object)
2. Great backup tool.
3. Once enabled, Versioning cannot be disabled, only be suspended. You have to delete the bucket and create a new one.
4. Integrates with Lifecycle rules.
5. Versioning's MFA Delete capability, which uses multi-factor authentication, can be used to provide an additional layer of security.
* S3 Versioning Lab
Imp:
1. With versioning enabled, when we upload a newer version of the file - the newer file's permission need to be made public. Older versions permissions remain the same.
2. From Architecture perspective - based on the requirements, versioning need to be enabled as the size of S3 bucket will increase exponentially.
Or make a decision to enable lifecycle policy to retire old versions quickly.
* S3 Versioning Exam Tips:
1. Stores all versions of an object (including all writes and even if you delete an object)
2. Great backup tool.
3. Once enabled, Versioning cannot be disabled, only suspended
4. Integrates with Lifecycle rules.
5. Versioning's MFA Delete capability, which uses multi-factor authentication, can be used to provide an additional layer of security.
* S3 LifeCycle Management Lab
Note:
1. Transitioning small objects to Glacier or Glacier Deep Archive will increase costs
Before creating a lifecycle rule that transitions small objects to Glacier or Glacier Deep Archive, consider how many objects will be transitioned and how long you plan to keep the objects. Lifecycle request charges for these objects will increase your costs.
2. Expire current versions of objects: Min days must be greater than 60
* S3 LifeCycle Management - Exam Tips
1. Automates moving your objects between the different storage tiers.
2. Can be used in conjunction with versioning.
3. Can be applied to current and previous versions.
* S3 Object Lock and Glacier Vault Lock
1. S3 Object Lock: Store objects using a write-once-read-many (WORM) model to help you prevent objects from being deleted or overwritten for a fixed amount of time or indefinitely.
2. You can use S3 Object lock to meet regulatory requirements that require WORM storage, or add an extra layer of protection against object changes and deletion.
3. To enable object lock, it must be first enabled at the bucket level. Amazon S3 currently does not support enabling object lock after a bucket has been created. To enable object lock for this bucket, contact customer support.
4. Comes in different modes:
a. Governance Mode: Users can't overwrite or delete an object version or alter its lock settings unless they have special permissions.
With governance mode, you protect objects against being deleted by most users, but you can still grant some user permissions to alter the retention settings or delete the object if unnecessary.
b. Compliance Mode: A protected object version can't be overwritten or deleted by any user, including the root user in your AWS account. When an object is locked in compliance mode, its retention mode can't be changed and its retention period can't be shortened. Compliance mode ensures an object version can't be overwritten or deleted for the duration of the retention period.
5. Retention Period: A retention period protects an object version for a fixed amount of time. When you place a retention period on an object version, Amazon S3 stores a timestamp in the object version's metadata to indicate when the retention period expires. After the retention period expired, the object version can be overwritten or deleted unless you also placed a legal hold on the object version.
6. Legal Hold: S3 Object lock also enables you to okay a legal hold on an object version. Like a retention period, a legal prevents object version from being overwritten or deleted. However, a legal hold doesn't have an associated retention period and remains in effect until removed. Legal holds can be freely placed and removed by any user who has the s3:PutObjectLegalHold permission.
* Glacier Vault Lock: It allows you to easily deploy and enforce compliance controls for individual S3 Glacier vaults with a Vault Lock policy. You can specify controls, such as WORM, in a Vault Lock policy from future edits. Once locked, the policy can no longer be changed.
* S3 Object Lock and Glacier Vault Lock - Exam Tips
1. Use S3 Object lock to store objects using a write once, read many (WORM) model.
2. Object locks can be on individual objects or applied across the bucket as a whole.
3. Object locks come in two models: Governance mode and Compliance mode.
4. With governance mode, Users can't overwrite or delete an object version or alter its lock settings unless they have special permissions.
5. With Compliance Mode: A protected object version can't be overwritten or deleted by any user, including the root user in your AWS account.
6. S3 Glacier Vault Lock allows you to easily deploy and enforce compliance controls for individual S3 Glacier vaults with a Vault Lock policy. You can specify controls, such as WORM, in a Vault Lock policy from future edits. Once locked, the policy can no longer be changed.
* S3 Performance
1. S3 Prefix:
mybucketname/folder1/subfolder1/myfile.jpg > /folder1/subfolder1 is the prefix
mybucketname/folder2/subfolder1/myfile.jpg > /folder2/subfolder1 is the prefix
mybucketname/folder3/myfile.jpg > /folder3 is the prefix
mybucketname/folder4/subfolder4/myfile.jpg > /folder4/subfolder4 is the prefix
Why is prefix important?
1. S3 is all about performance, S3 has extremely low latency. You can get the first byte out of S3 within 100-200 milliseconds
You can also achieve a high number of requests: 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per prefix
2. You can get better performance by spreading your reads across different prefixes. For Example, If you are using two prefixes, you can achieve 11,000 requests per second.
3. If we used all four prefixes in the last example, you would achieve 22,000 requests per second.
2. S3 Limitations when using KMS
1. If you are using SSE-KMS to encrypt your objects in S3, you must keep in mind the KMS limits.
2. When you upload a file, you will call GenerateDataKey in the KMS API.
3. When you download a file, you will call Decrypt in the KMS API.
4. Uploading/Downloading will count towards the KMS quota.
5. Region-specific, however, it's either 5,500, 10,000 or 30,000 requests our second.
6. Currently, you cannot request a quota increase for KMS.
3. S3 Performance Uploads
Multipart Uploads:
1. Recommended for files over 100MB
2. Required for files over 5GB
3. Parallelise uploads (increase efficiency)
4. S3 Performance Downloads:
S3 Byte-Range Downloads:
1. Parallelise downloads by specifying byte ranges.
2. If there's a failure in the download, it's only for a specific byte range.
S3 Byte-Range Fetches:
1. Can be used to speed up downloads
2. Can be used to just download partial amounts of the file (eg., header information)
* S3 Performance - Exam Tips:
1. mybucketname/folder1/subfolder1/myfile.jpg > /folder1/subfolder1 is the prefix
2. You can also achieve a high number of requests: 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per prefix
3. You can get better performance by spreading your reads across different prefixes. For Example, If you are using two prefixes, you can achieve 11,000 requests per second.
4. If you are using SSE-KMS to encrypt your objects in S3, you must keep in mind the KMS limits.
a. Uploading/Downloading will count towards the KMS quota.
b. Region-specific, however, it's either 5,500, 10,000 or 30,000 requests our second.
c. Currently, you cannot request a quota increase for KMS.
5. Use multipart uploads to increase performance when uploading files to S3.
6. Should be used for any files over 100MB and must be used for any file over 5GB.
7. Use S3 byte-range fetches to increase performance when downloading files to S3.
* S3 Select and Glacier Select:
S3 Select: S3 Select enables applications to retrieve only a subset of data from an object by using simple SQL expressions.
By using S3 Select to retrieve only the data needed by your application, you can achieve drastic performance increases - in many cases, you can get as much as 400% improvement (up to 80% cheaper)
Glacier Select: Some companies in highly regulated industries - e.g., financial services, healthcare, and others - write data directly to Amazon Glacier to satisfy compliance needs like SEC Rule 17a-4 or HIPAA. Many S3 users have lifecycle policies designed to save on storage costs by moving their data into Glacier when they no longer need to access to on a regular basis.
Glacier Select allows you to run SQL queries against Glacier directly.
* S3 Select and Glacier Select - Exam Tips
1. Remember that S3 Select is used to retrieve only a subset of data from an object by using simple SQL expressions.
2. Get data by rows or columns using simple SQL expressions.
3. Save money on data transfer and increase speed.
* AWS organisations & Consolidated Billing
1. AWS organisations is an account management service that enables you to consolidate multiple AWS accounts into an organisation that you create and centrally manage.
2. We can have a group within a group and a user can belong to more than one group as they inherit from the super groups.
3. Policy will trickle down to all the other accounts and OU's underneath it.
4. Can do consolidated billing: more that you use, the less that you pay.
5. Paying accounts is independent. Cannot access resources of the other accounts.
6. All linked accounts are independent.
Advantages of Consolidated Billing:
1. One bill per AWS account.
2. Very easy to track charges and allocate costs.
3. Volume pricing discount.
* AWS organisations & Consolidated Billing - Exam Tips
1. Always enable multi-factor authentication on root account.
2. Always use a strong and complex password on root account.
3. Paying account should be used for billing purposes only. Do no deploy resources into the paying account.
4. Enable/Disable AWS services using Service Control Policies (SCP) either on OU or on individual accounts.
* Lab - Sharing S3 buckets across accounts - Exam Tips:
3 different ways to share S3 buckets across accounts
1. Using Bucket policies & IAM (applies across the entire bucket). Programmatic access only.
2. Using Bucket ACLs & IAM (individual objects). Programmatic access only.
3. Cross-account IAM Roles. Programmatic and Console access.
* Lab - AWS Cross-Region Replication - Demo and Exam Tips
1. Versioning must be enabled on both the source and destination buckets.
2. Files in an existing bucket are not replicated automatically.
3. Delete markers are not replicated.
4. Deleting individual versions or delete markets will not be replicated.
5. Understand what Cross Region Replication is at a high level
* S3 Transfer Acceleration
S3 Transfer Acceleration utilised the CLoudFront Edge Network to accelerate your uploads to S3. Instead of uploading to your S3 bucket, you can use a distinct URL to upload directly to an edge location which will then transfer that file to S3. You will get a distinct URL to upload to sri-s3-accelarate.amazonaws.com
* AWS DataSync: Exam Tips
1. Used to move large amounts of data from on-premises to AWS.
2. Used with NFS and SMB compatible file systems (On premise).
3. Replication can be done hourly, daily or weekly.
4. Install the DataSync agent to start the replication.
5. Can be used to replicate EFS to EFS.
6. AWS DataSync securely connects to Amazon S3, Amazon EFS or Amazon Fsx (Windows File Server) to copy data and metadata to and from AWS.
* CloudFront
CloudFront is a content delivery network (CDN) is a system of distributed servers (network) that deliver webpages and other web content to a user based on the geographic locations of the user, the origin of the webpage and a content delivery server.
CloudFront - Key Terminology:
1. Edge location: This is the location where content will be cached. This is separate to an AWS Region/AZ.
2. Origin - This is the origin of all the files that the CDN will distribute. This can be an S3 Bucket, an EC2 Instance, an Elastic Load Balancer or Route 53.
3. Distribution - This is the name given the CDN which consists of a collection of Edge locations.
Amazon CloudFront can be used to deliver your entire website, including dynamic, static, streaming and interactive content using a global network of edge locations.
Requests for your content are automatically routed to the nearest edge location, so content is delivered with the best possible performance.
When the first user queries for a file, it gets downloaded from the server. The second user gets a cached copy from the Edge Location instead of downloading it again from the server. The file has Time to live defined usually 48 hours.
2 types of distribution:
Web Distribution - Typically used for Websites
RTMP - Used for Media Streaming
* CloudFront Exam Tips
1. Edge location: This is the location where content will be cached. This is separate to an AWS Region/AZ.
2. Origin - This is the origin of all the files that the CDN will distribute. This can be an S3 Bucket, an EC2 Instance, an Elastic Load Balancer or Route 53.
3. Distribution - This is the name given the CDN which consists of a collection of Edge locations.
2 types of distribution:
Web Distribution - Typically used for Websites
RTMP - Used for Media Streaming
Note:
1. Edge Locations are not just READ only - you can write them too. (ie Put an object on to them).
2. Objects are cached for the life of TTL (Time to live)
3. You can clear cached objects, but you will be charged.
4. We can restrict access using signed URL's (Example: Netflix - Option in AWS CloudFront is "Restrict Viewer access (Use Signed URL's or Signed cookies)")
* Create a CloudFront Distribution - Demo
1. Exam Tip: We use Create invalidation to invalidate an object in CloudFront. Example: We pushed out some data but it is not showing up correctly, in order to deal with this we use Invalidations.
2. We need to disable before we delete a CloudFront distribution.
* CloudFront Signed URLs and Cookies vs S3 Signed URL
CloudFront Signed URL:
1. A signed URL is for individual files, 1 files = 1 URL.
2. A signed cookie is for multiple file, 1 cookie = multiple files.
3. When we create a signed URL or signed cookie, we attach a policy.
The policy can include:
a. URL expiration.
b. IP ranges
c. Trusted Signers (which AWS accounts can create signed URL's)
4. Can have different origins. Does not have to be EC2.
5. Key-pair is account wide and managed by the root user.
6. Can utilise caching features.
7. Can filter by date, path, IP address, expiration, etc.
S3 Signed URL:
1. Issues a request as the IAM user who creates the pre-signed URL.
2. Limited lifetime.
Exam Tips:
1. Use signed URLs/cookies when you want to secure content so that only the people you authorise are able to access it.
2. A signed URL is for individual files, 1 files = 1 URL.
3. A signed cookie is for multiple file, 1 cookie = multiple files.
4. If your origin is EC2, then use CloudFront.
5. If your origin is S3, then use S3 signed URL instead of CloudFront Signed URL.
* Snowball
What is Snowball?
1. AWS Snowball is a PB-Scale data transport solution that uses secure appliances to transfer large amounts of data in and out of the AWS cloud. Think of it as a gigantic disk to move your data into AWS. Using Snowball addresses common challenges with large-scale data transfers including high network costs, long transfer times, and security concerns.
Transferring data with snowball is simple, fast. Secure and can be as little as one-fifth the cost of high-speed internet.
2. AWS Snowball Edge is a 100TB data transfer device with on-board storage and compute capabilities. You can use Snowball Edge to move large amounts of data into and out of AWS, as a temporary storage tier for large local datasets, or to support local workloads in remote or offline locations.
3. AWS Snowmobile is an Exabyte-scale data transfer service used to move extremely large amounts of data to AWS. You can transfer up to 100PB per Snowmobile, a 45-foot long ruggedised shipping container, pulled by a semi-trailer truck. Snowmobile makes it easy to move massive volumes of data to the cloud, including video libraries, image repositories, or even a complete data centre migration. Transferring data with Snowmobile is secure, fast and cost effective.
- What determines price for Snowball?
1. Service fee per job
- Snowball 50 TB: $200
- Snowball 80 TB: $250
2. Snowball uses multiple layers of security designed to protect your data including tamper-resistant enclosures, 256-bit encryption, and an industry-standard Trusted Platform Module (TPM) designed to ensure both security and full chain-of-custody of your data. Once the data transfer job has been processed and verified, AWS performs a software erasure of the Snowball appliance.
3. Daily Charge
- First 10 days are free, after that it's $15 a day.
4. Data transfer
- Data transfer in to S3 is free. Data transfer out is not.
5. Snowball can Import to S3 and Export from S3.
- When should I use Snowball
Available Internet Connection Theoretical Min. No of days to transfer 100TB at 80% n/w utilisation When to Consider AWS Import/Export Snowball?
T3 (44.736 Mbps) 269 days 2TB or more
100 Mbps 120 days 5TB or more
1000 Mbps 12 days 60TB or more
* Storage Gateway
1. AWS Storage Gateway is a service that connects an on-premises software appliance with cloud-based storage to provide seamless and secure integration between an organisation's on-premise IT environment and AWS's storage infrastructure. The service enables you to securely store data to the AWS cloud for scalable and cost effective storage.
2. AWS Storage Gateway's software appliance is available for download as a VM image that you install on a host in your datacenter. StorageGateway supports either VMWare ESXi or Microsoft Hyper-V. Once you've installed your gateway and associated it with your AWS account through the activation process, you can use the AWS management console to create the storage gateway option that is right for you.
3. Three different types of Storage gateway:
a. File Gateway (NFS & SMB): Files are stored as objects in your S3 buckets, accessed through a Network File System (NFS) mount point. Ownership, permissions and timestamps are durably stored in S3 in the user-metadata of the object associated with the file. Once objects are transferred to S3, they can be managed as native S3 objects, and bucket policies such as versioning, lifecycle management and cross-region replication apply directly to objects stored in your bucket.
b. Volume Gateway (iSCSI)
1. Stored Volumes:
- The volume interface presents your applications with disk volumes using the iSCSI block protocol.
- Data written to these volumes can be asynchronously backed up as point-in-time snapshots of your volumes, and stored in the cloud as Amazon EBS snapshots.
- Snapshots are incremental backups that capture only changed blocks. All snapshot storage is also compressed to minimise your storage charges.
- Stored Volumes let you store your primary data locally, while asynchronously backing up the data to AWS. Stored volumes provide your on-premises applications with low-latency access to their entire datasets, while providing durable, off-site backups. You can create storage volumes and mount them as iSCSI devices from your on-premises application servers.
Data written to your stored volumes in stored on your on-premises storage hardware. This data is asynchronously backed up to Amazon Simple Storage Service (Amazon S3) in the form of Amazon Elastic Block Store (Amazon EBS) snapshots. 1 GB - 16 TB in size for Stored Volumes.
2. Cached Volumes: Cached Volumes let you use Amazon Simple Storage Service (Amazon S3) as your primary data storage while retaining frequently accessed data locally in your storage. Cached volumes minimise the need to scale your on-premises storage infrastructure, while still providing your applications with low-latency access to their frequently accessed data,
You can create storage volumes up to 32TB in size and attach to them as iSCSI devices from your on-premises application servers. Your gateway stores data that you write to these volumes in Amazon S3 and retains recently read data in your on-premises storage gateways cache and upload buffer storage. 1GB - 32TB in size for Cached Volumes.
c. Tape Gateway (VTL): Tape Gateway offers a durable, cost-effective solution to archive your data in the AWS Cloud. The VTL interface it provides lets you leverage your existing tape-based backup application infrastructure to store data on virtual tape cartridges that you create on your tape gateway, Each tape gateway is preconfigured with a media changer and tape drives, which are available to your existing client backup applications as iSCSI devices. You add tape cartridges as you need to archive your data. Supported by NetBackup, Backup Exec, Veeam etc.
Exam Tips:
1. Three different types of Storage gateway:
a. File Gateway (NFS & SMB): For flat files, stored directly on S3
b. Volume Gateway (iSCSI)
1. Stored Volumes: Entire Dataset is stored on site and is asynchronously backed up to S3.
2. Cached Volumes: Entire Dataset is stored on S3 and the most frequently accessed data is cached on site.
c. Tape Gateway (VTL)
* Athena Vs Macie (Exam Tips)
- What is Athena?
- Interactive query service which enables you to analyse and query data located in S3 using standard SQL
- Serverless, nothing to provision, pay per query / per TB scanned
- No need to set up complex Extract/Transform/Load (ETL) process
- Works directly with data stored in S3
- Athena can be used for
1. Can be used to query log files stores in S3. Ex: ELB Logs, S3 access logs ... etc
2. Generate business reports on data stored in S3.
3. Analyse AWS cost and usage reports
4. Run queries on click-stream data.
- What is Macie?
- Security service which uses machine learning and NLP (natural language processing) to discover, classify and protect sensitive data stored in S3
- Uses AI to recognise if your S3 objects contain sensitive data such as personal identification information (PII).
- Dashboards, reporting and alerts
- Works directly with data stored in S3
- Can also analyse CloudTrail logs
- Great for PCI-DSS and preventing ID theft.
** IAM Summary
- IAM is universal, it does not apply to regions at this time.
- The root account is simply the account that's created when you first set up your AWS account and it has complete administrator access.
- New users have no permissions when first created and you'll find this is a theme within Amazon. It's called least privilege.
- So, whenever you create a new user, that user's not going to have any rights or any privileges until you grant them privileges. Likewise when we look at S3, when we create our bucket,
it's locked down, it's not public and making objects public is not that easy. You have to go through a process to do it. So, that's a common theme within Amazon Web Services.
- New users are assigned an access key ID and secret access key when first created.
- These are not the same as a password. You cannot use the access key ID and secret access key to log into the console.
You use it to access AWS via the APIs and the Command Lines, however.
- You only get to view your access key ID and secret access key once. If you lose them you have to regenerate them. So, make sure you save them in a secure location.
- Always setup multi-factor authentication on your root account and you can also create and customize your own password rotation policies.
** S3 Summary
- S3 is object based. i.e. allows you to upload files.
- Files can be zero bytes all the way up to 5 terabytes
- There is unlimited storage
- Files are stored in buckets
- S3 is a universal namespace. That is, bucket names must be unique.
- https://s3-eu-west-1.amazonaws.com/acloudguru
- Not suitable to install an operating system on or a database or anything like that.
- Successful uploads will generate HTTP 200 status code.
- By default all newly created buckets are PRIVATE.
- You set up access control to your bucket using
a. Bucket policies and bucket policies are bucket wide
b. Access control lists and these can go down to the individual files or objects in your bucket.
- S3 buckets can be configured to create access logs which logs all requests made to the S3 bucket
and these can be sent to another bucket in the same AWS account or even another bucket in another AWS account.
- The key fundamentals of S3 are:
a. key (This is simply the name of the object.)
b. value (This is simply the data is made up a sequence of bytes). so some sometimes people refer to S3 as a key value pair.
c. Version ID (Important for versioning)
d. Metadata (Data about data you are storing) and we do that through tags and then you get some sub resources such as access control lists and then torrents as well
- Read after write consistency of puts of new objects
- Eventual consistency for overwrite puts and deletes and this can take some time to propagate.
- Exam Tips:
1. S3 Standard: 99.99% availability, 99.99999999999% durability, stored redundantly across multiple devices, and is designed to sustain the loss of 2 facilities
2. S3 - IA (Infrequently accessed): For data that is accessed less frequently, but requires rapid access when needed. Lower fee than S3, but you are charged a retrieval fee.
3. S3 One Zone IA: For where you want a lower cost option for infrequently accessed data, but do not require the multiple availability zone.
4. S3 Intelligent Tiering: Designed to optimise costs by automatically moving data to the most cost-effective access tier, without performance impact or operational overhead.
5. S3 Glacier: S3 Glacier is a secure, durable and a low-cost storage class for data archiving. Retrieval times configurable from mins to hours.
6. S3 Glacier Deep Archive: S3 Glacier Deep Archive is Amazon S3's lowest-cost storage class where a retrieval time of 12 hours is acceptable.
7. You can use bucket policies to make entire S3 buckets public.
8. You can use S3 to host STATIC websites (such as .html). Websites that require database connections such as Wordpress etc cannot be hosted on S3.
9. S3 Scales automatically to meet your demand. Many enterprises will put static websites on S3 when they think there is going to be a large number of requests (such as for a movie preview for example)
- Understand how to get the best value out of S3
1. S3 Standard (Availability: 99.99%)
2. S3 - IA (Availability: 99.9%)
3. S3 - Intelligent Tiering (Availability: 99.9%)
4. S3 One Zone - IA (Don't use this if the data is crucial) (Availability: 99.5%)
5. S3 Glacier - Data Archival (Availability: 99.99%)
6. S3 Glacier Deep Archive (Availability: 99.99%)
- Encryption in transit is achieved by using SSL/TLS.
- S3 also has encryption at rest (Server Side) is achieved by three different ways.
1. S3 managed keys - SSE-S3: This is where S3 just handle all our encryption for us and we don't have to worry about them.
2. AWS key management service or KMS: This is where we can start using keys from the KMS service.
3. Server side encryption with customer provided keys - SSE-C: This is where you provide your keys and you manage the encryption and the actual you know maintenance of those keys.
4. Client-side encryption: This is where you encrypt the objects and then you upload them to S3.
- AWS Organizations: Some best practices with AWS Organizations.
1. Always enable multi-factor authentication on root or master account.
2. Always use strong and complex passwords on root account.
3. Paying account should be used for billing purposes only. Do not deploy resources into the paying account, into the root account or the master account,
4. Enable and disable AWS services using service control policies (SCPs) either on organisational units or on individual accounts.
- three different ways to share S3 buckets across accounts.
1. Using bucket policies and IAM (applies across the entire bucket). Programmatic access only.
2. Using bucket ACLs and IAM (individual objects). Programmatic access only.
3. Cross account IAM Roles, Programmatic and Console access
- Cross Region Replication
1. Versioning to be enabled on both the source and the destination buckets.
2. Files in an existing bucket are not replicated automatically.
3. All subsequent updated files will be replicated automatically.
4. Delete markers are not replicated
5. Deleting individual versions or delete markers will also not be replicated.
6. Understand what cross region replication is at a high level.
- Lifecycle policies
1. Automates moving your objects between the different storage tiers.
2. Used in conjunction with versioning.
3. Can be applied to current versions as well as previous versions.
- S3 Transfer Accelerations.
So, we have our users, they're all around the world. We have our edge locations. Our users will upload their files to the edge locations first and then those files will go over the AWS backbone network to S3. And we saw how mostly it can improve speed and performance. So, if you do need to increase the performance of your, you know, of your users being able to upload files to S3, look at S3 Transfer Acceleration.
- CloudFront.
1. Edge location - This is the location where the content is going to be cached and it's separate to an AWS region or availability zone.
2. Origin - This is the origin of all our files that the CDN will distribute and this can either be an S3 bucket, an EC2 instance, an elastic load balancer or Route 53.
3. Distribution - This is simply the name given to the CDN which consists of a collection of edge locations.
4. We have two different types of distributions.
a. Web distributions - This is typically used for websites
b. RTMP - this is used for Adobe media and it's used for media streaming.
5. Edge locations are not read-only, you can write to them as well, i.e. put an object to them.
6. Objects are cached for the time to live or TTL (Time To Live) and that value is always in seconds
7. You can clear cache objects by invalidating them but you will be charged.
- Snowball: Understand what Snowball is
1. It's a big disk that you can use to move your data in and out of the AWS cloud.
2. Snowball can be imported into S3. So, you can import data into S3.
3. You can also use Snowball to move large amounts of data out of S3.
- Storage Gateway.
1. File Gateway - This is used for flat files that are stored directly on S3 and that's NFS.
2. Volume gateway - That's iSCSI and we have two different types of volume gateways.
a. Stored Volumes - Entire dataset is stored on site so it's literally a 100% copy (asynchronously) of your data being stored on-site and then it's backed up to S3.
b. Cached Volume - This is where the entire data set is stored on S3 and only the most frequently accessed data is cached on site.
3. Gateway virtual tape library - This is used for backups and works with really popular backup applications like NetBackup, Backup Exec, Veeam ... etc.
- Athena (This is a very popular exam topic.)
1. Athena is an interactive query service.
2. It allows you to query data located in S3 using standard SQL.
3. It's serverless
4. Commonly used to analyse log data stored in S3
- Macie
1. Macie uses AI to analyse data in S3 and helps to identify personally identifiable information or PII.
2. It can also be used to analyse CloudTrail logs for suspicious API activity.
3. It includes dashboards, reports and alerting
4. it's great for PCI-DSS compliance as well as preventing ID theft.
*** Read the S3 FAQ before going into your exam because S3 is going to come up an awful lot in the Solutions Architect Associate Exam.
==========================================================================================================================================================================================
* EC2 101 Elastic Compute Cloud
==========================================================================================================================================================================================
1. Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It's just a virtual server (or servers) in the cloud.
2. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change.
** EC2 Pricing Models:
1. On Demand: Allows you to pay a fixed rate by the hour (or by the second) with no commitment.
2. Reserved: Provides you with a capacity reservation, and offer significant discount on the hourly charge for an instance. Contracts are 1 - 3 year terms. Higher discount with upfront payments and longer contracts.
3. Spot: Enables you to bid whatever price you want for instance capacity, providing for even greater savings if your applications have flexible start and end times.
4. Dedicated Hosts: Physical EC2 server dedicated for your use. Dedicated hosts can help reduce the costs by allowing you to use your existing server-bound software licenses.
- On Demand pricing is useful for:
1. Users that want the low cost and flexibility of Amazon EC2 without any up-front payment for long-term commitment.
2. Applications with short term, spiky or unpredictable workloads that cannot be interrupted
3. Applications being developed or tested on Amazon EC2 for the first time.
- Reserved Pricing is useful for:
1. Applications with steady or predictable usage.
2. Applications that require reserved capacity.
3. Users able to make upfront payments to reduce their total computing costs even further.
- Reserved Pricing Types:
1. Standard Reserved Instances: These offer up to 75% off on demand instances. The more you pay up front and the longer the contract, the greater the discount.
2. Convertible Reserved Instances: These offer up to 54% off on demand capability to change the attributed of the RI as long as the exchange results in creation of Reserved Instances of equal or greater value.
3. Scheduled Reserved Instances: These are available to launch within the time windows you reserve. This option allows you to match your capacity reservation to a predictable recurring schedule that only requires a fraction of a day, a week or a month.
- Spot pricing is useful for:
1. Applications that have flexible start and end times.
2. Applications that are only feasible at very low compute prices.
3. Users with urgent computing needs for large amounts of additional capacity.
- Dedicated Hosts pricing is useful for:
1. Useful for regulatory requirements that may not support multi-tenant virtualisation.
2. Great for licensing which doesn't support multi-tenancy or cloud.
3. Can be purchased On-Demand (hourly)
4. Can be purchased as a Reservation for up to 70% off the On-Demand price.
- EC2 instance classes FIGHTDRMCPXZ
1. F1 - For FPGA (Filed Programmable gate array) - Genomics research, financial analytics, real-time video processing, big data etc
2. I3 - For IOPS (High Speed Storage) - NoSQL DBs, Data Warehousing etc
3. G3 - Graphics Intensive (Video Encoding/3D Application Streaming)
4. H1 - High Disk Throughput (MapReduced-based networks, distributed file systems such as HDFS and MapR-FS)
5. T3 - Low Cost and Cheap general purpose (think T2 micro) (Web Servers/Small DB's)
6. D2 - Dense Storage (FileServers/Data Warehousing/Hadoop)
7. R5 - RAM, Memory optimised (Memory Intensive Apps/DBs)
8. M5 - Main choice for general purpose apps (Application Servers)
9. C5 - Compute Optimised (CPU Intensive Apps/DBs)
10. P3 - Graphics/General Purpose GPU (think Pics) (Machine Leaning, Bit Coin Mining etc)
11. X1 - Extreme Memory (SAP HANA/Apache Spark etc)
12. Z1D - Extreme Memory and CPU (Ideal for electronic design automation (EDA) and certain relational database workloads with high per-core licensing costs.)
13. A1 - Arm-based workloads (Scale-out workloads such as web servers)
14. U-6tb1 - Bare Metal (Bare metal capabilities that eliminate virtualisation overhead)
* EC2 Exam Tips:
1. EC2 is a compute based service. It is not server less. It's a Server!
2. Use a private key to connect to EC2.
3. Common Ports: Linux (port 22), Microsoft - RDP (port 3389), HTTP (80) and HTTPS (443)
4. Security groups are virtual firewalls. To let everything in 0.0.0.0/0. To let a single IP address in X.X.X.X/32 (32 means this ip address)
5. Always design for failure. Have one EC2 instance in each availability zone.
6. Root device volumes can be encrypted now (a popular exam topic)
7. Termination protection is turned off by default, you must turn it on.
8. On an EBS-backed instance, the default action is for the root EBS volume to be deleted when the instance is terminated. Any additional EBS volumes by default won't be deleted.
9. EBS Root volumes of your DEFAULT AMI's CAN be encrypted. You can also use a third party tool (such as bit locker etc) to encrypt the root volume, or this can be done when creating AMI's (lab to follow) in the AWS console or using the API.
10. Additional volumes can be encrypted as well.
- EC2 Exam Tips: Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provided resizable compute capacity in the cloud. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change.
1. On Demand: Allows you to pay a fixed rate by the hour (or by the second) with no commitment.
2. Reserved: Provides you with a capacity reservation and offer a significant discount on the hourly charge for an instance. Contract Terms are 1 year or 3 year terms.
3. Spot: Enables you to bid whatever price you want for instance capacity, providing for even greater savings if your application have flexible start and end times.
Imp Note: If the spot instance is terminated by Amazon EC2, you will not be charged for a partial hour of usage. However, if you terminate the instance yourself, you will be charged for any hour in which the instance ran.
4. Dedicated Hosts: Physical EC2 server dedicated for your use. Dedicated Hosts can help reduce costs by allowing you to use your existing server-bound software licenses.
* Security Groups Exam Tips:
1. All inbound traffic is blocked by default - so we enable some IP and ports using Security Groups.
2. All outbound traffic is allowed.
3. Security Groups are STATEFUL, when you create an inbound rule and an outbound rule is automatically created.
4. NACL's are STATELESS, when you create an inbound rule and an outbound rule is not automatically created.
5. You CANNOT block specific IP's/Port's using Security Groups instead use Network Access Control Lists.
6. You can have any number of EC2 instances within a security group.
7. You can have multiple Security Groups attached/assigned to EC2 instances.
8. Changes to Security Groups take effect immediately.
9. You can specify allows rule, but not deny rules.
** EBS 101
Amazon Elastic Block Storage (EBS) provides persistent block storage volumes for use with Amazon EC2 instances in the AWS cloud.
Each Amazon EBS volume is automatically replicated within it's Availability Zone to protect you from component failure, offering high availability and durability.
- 5 different types of EBS Storage:
SSD:
1. General purpose SSD (GP2) - balances prices and performance for a wide variety of workloads
2. Provisioned IOPS SSD (IO1) - higher-performance SSD volume for mission-critical low-latency or high throughput workloads.
Magnetic/HDD:
1. Throughput Optimised Hard Disk Drive (ST1) - Low cost HDD volume designed for frequently accessed, throughput-intensive workloads.
2. Cold Hard Disk Drive (SC1) - Lowest cost HDD volume designed for less frequently accessed workloads (File Servers)
3. Magnetic - Previous generation and some point will probably be phased out.
- Compare EBS Types (Exam Tip: Important: API names are important for the exam)
https://aws.amazon.com/ebs/features/
** EBS Volumes & Snapshots - Lab (Exam Tips)
1. Important: Where-ever you have EC2 instance it's EBS volume will be in the same region.
2. Important: When we terminate EC2 instance, it removes EBS volumes automatically.
3. Volumes exist on EBS. Think of EBS as a virtual hard disk.
4. Snapshots exist on S3. Think of snapshots as a photograph of the disk.
5. Snapshots are point in time copies of Volumes.
6. Snapshots are incremental - this means that only the blocks that have changed since your last snapshot are moved to S3.
7. If this is your first snapshot, it may take some time to create.
8. To create a snapshot for Amazon EBS volumes that serve as a root devices, you should stop the instance before taking the snapshot.
9. However you can take a snap while the instance is running.
10. You can create AMI's from both Volumes and Snapshots.
11. You can change EBS volume sizes on the fly, including changing the size and storage type.
12. Volumes will be in the same Availability Zone as the EC2 instance.
13. To move an EC2 volume from one AZ to another, take a snapshot of it, create an AMI from the snapshot and then use the AMI to launch the EC2 instance in a new AZ.
14. To move an EC2 volume from one region to another, take a snapshot of it, create an AMI from the snapshot and then copy the AMI from one region to other. Then use the copied AMI to launch the new EC2 instance in the new region.
15. Virtualisation Type: PV or HVM, use Hardware-assisted virtualisation as it will give lot more different EC2 instance types.
Linux Amazon Machine Images use one of two types of virtualisation: paravirtual (PV) or hardware virtual machine (HVM). The main differences between PV and HVM AMIs are the way in which they boot and whether they can take advantage of special hardware extensions (CPU, network, and storage) for better performance.
For the best performance, we recommend that you use current generation instance types and HVM AMIs when you launch your instances
16. Snapshots of encrypted volumes are encrypted automatically.
17. Volumes restored from encrypted snapshots are encrypted automatically.
18. You can share snapshots, but only if they are unencrypted.
19. These snapshots can be shared with other AWS accounts or made public.
** AMI Types (EBS vs. Instance Store) - Important for the exam
1. You can select your AMI based on:
1. Region (see Regions and AZ's)
2. Operating System.
3. Architecture (32-bit or 64-bit)
4. Launch Permissions
5. Storage for the Root Device (Root Device Volume)
5.1 Instance Store (EPHEMERAL STORAGE)
5.2 EBS Backed Volumes
2. All AMI's are categorised as either backed by Amazon EBS or backed by Instance Store
2.1 For EBS Volumes: The root device for an instance launched from the Ami is an Amazon EBS volume created from an Amazon EBS snapshot
2.2 For Instance Store Volumes: The root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3.
AMI Types (EBS vs. Instance Store) - Exam Tips
1. Instance Store Volumes are sometimes called Ephemeral Storage (For some reason if the underlying hypervisor is stopped then we are going to loose all our data)
2. You cannot see the volumes of Instance Store EC2 under volumes because its Instance Store.
3. Instance Store volumes cannot be stopped. If the underlying host fails, you will lose your data.
4. EBS backed instances can be stopped. You will not lose the data on this instance if it is stopped.
5. You can reboot both, you will not loose data.
6. By default, both ROOT volumes will be deleted on termination. However, with EBS volumes, you can tell AWS to keep the root device volume.
** ENI vs. ENA vs. EFA (Important for the exam - Scenario based questions)
1. ENI: Elastic Network Interface - essentially a virtual network card.
1.1 An ENI is simply virtual network card on your EC2 instance, when you provision an EC2 instance, it's going to have a ENI attached to it automatically, and then you can add additional ones.
1.2 It basically allows a primary private IPv4 address, from the IPv4 address range of your VPC.
1.3 it also allows one or more secondary private IPv4 addresses from the IPv4 address range of your VPC.
1.4 With an ENI you get one elastic IP address, per private IPv4 address
1.5 You get one public IPv4 address
1.6 You get one or more IPv6 addresses.
1.7 One or more security groups
1.8 A MAC address source
1.9 A source/destination check flag
2.0 A description of what the ENI is.
Scenarios for Network Interfaces:
1. You might have multiple ENIs if you want to create a management network and you wanted to have, that separate to your production network.
2. You can also, have an additional ENI if you're using network and security appliances in your VPC.
3. It also allows you by having multiple ENIs you can create dual-homed instances with workloads or roles on distinct subnets.
4. You might have your production subnet, and then you might have your database subnet, and you might want to segregate that by using multiple ENIs, and it allows you to create low budget high availability solutions.
2. EN: Enhanced Networking uses what's called single root I/O virtualisation or SR-IOV, to provide high performance networking capabilities to unsupported instance types.
ENA is a subset of Enhanced networking
2.1 Is uses single root IO virtualisation, or SR-IOV, to provide high performance networking capabilities on supported instance types.
SR-IOV is a method of device virtualisation, that provides higher IO performance and lower CPU utilisation, when compared to traditional network interfaces.
So it's just a way of speeding up your network essentially.
2.2 Enhanced Networking provides higher bandwidth, higher packets per second performance consistently lower it into instance latencies, and there's no additional charge for using Enhanced Networking, but your EC2 instance does have to support it.
2.3 Use Enhanced Networking where you want good network performance.
2.4 Depending on your instance type, Enhance Networking can be enabled using two methodologies,
2.4.1 Elastic Network Adapter or ENA, which supports network speeds of up to 100 gigabits per second for supported instance types.
Or
Intel 82599 Virtual Function, or VF interface, which supports network speeds of up to 10 gigabits per second, for supported instance types.
And this is typically used on older instances.
Tip: In any scenario, question that you get in your exam, you probably want to choose ENA (100 Gbps) over VF (10 Gbps)
3. Elastic Fabric Adapter: A network device that you attach to your EC2 instance to accelerate High Performance Compute, so HPC and machine learning applications.
3.1 An Elastic Fabric Adapter (EFA) is a network device that you can attach to your EC2 instance to accelerate High Performance Computing or HPC, and machine learning applications.
3.2 It's really important, if you get a scenario question and they're talking about ENI versus ENA versus EFA, and they're talking about HPC and machine learning, then you want to choose an Elastic Fabric Adapter.
3.3 Elastic Fabric Adapters, provides lower and more consistent latency and higher throughputs than TCP transport, traditionally used in cloud based, HPC systems.
3.4 EFA can use OS-bypass. OS-bypass enables high performance compute and machine learning applications to bypass the operating system kernel and to communicate directly with the EFA device. It makes it a lot faster with a lot lower latency. However, it's not supported on Windows currently, it's only supported with Linux.
ENI vs. ENA vs. EFA - Exam Tips
In the exam you will be given different scenario questions and you'll be asked to choose whether you should be using an ENI enhance networking or an Elastic Fabric Adapter
1. ENI
For basic networking, perhaps you need a separate management workload to your production network or a separate logging network and you need to do this at a low cost.
In this scenario, just use multiple ENI's for each network.
2. Enhanced Network
For when you need speeds between 10 gigabits per second and 100 gigabits per second anywhere where you need reliable high throughput.
3. Elastic Fabric Adapter
For when you need to accelerate, High Performance Computing, HPC and machine learning applications or if you need to do an OS bypass.
If you see a scenario question mentioning HPC, or machine learning or asking about OS-bypass, then you want to choose an Elastic Fabric Adapter.
** Encrypted Root Device Volumes & Snapshots - LAB (Exam Tips)
1. Snapshots of encrypted volumes are encrypted automatically.
2. Volumes resorted from encrypted snapshots are encrypted automatically.
3. You can share snapshots, but only if they are unencrypted.
4. These snapshots can be shared with other AWS accounts or made public.
5. You can now encrypt root device volumes upon creation of the EC2 instance.
6. If for some reason, if we didn't encrypt the root device volume then the process to encrypt is as follows
6.1 Create a Snapshot of the unencrypted root device volume
6.2 Create a copy of the Snapshot and select the encrypt option
6.3 Create an AMI from the encrypted Snapshot.
6.4 Use that AMI to launch new encrypted instances.
** Spot Instances & Spot Fleets
1. AMAZON EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud.
2. Spot instances are available at up to a 90% discount compared to On-Demand prices.
3. You can use Spot Instances for various stateless, fault-tolerant or flexible applications, such as
3.1 Big data and analytics
3.2 Containerised workloads
3.3 CI/CD
3.4 Web Services
3.5 High-performance computing (HPC)
3.6 Image and media rendering
3.7 and other test and development workloads
4. Spot Instances can be used with flexible workloads (can be terminated)
5. Spot Instances are not good for
5.1 Critical applications/Persistent workloads.
5.2 Critical Jobs
5.3 Databases
6. To use Spot Instances, you must first decide on your maximum Spot price. The instance will be provisioned as long as the Spot price is BELOW your maximum Spot price.
7. The hourly Spot price varies depending on capacity and region.
8. If the Spot price goes above your maximum, you have two minutes to choose whether to stop or terminate your instance.
9. You may also use a Spot Block to stop your Spot Instances from being terminated even if the Spot price goes over your max Spot price. You can set Spot blocks for between one to six hours currently.
10. How to terminate Spot Instances: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html
** Spot Fleets
1. Spot fleets and a spot fleet is just a collection of spot instances and optionally on-demand instances.
2. The spot fleet attempts to launch the number of spot and on-demand instances to meet the target capacity that you specified in the spot fleet requests. The request for spot instances is fulfilled if there's available capacity and if the maximum price that you specified in the request exceeds the current spot price. The spot fleet also attempts to maintain its target capacity fleet,
if your spot instances are interrupted. So it will relaunch those instances.
3. Spot fleets, will try and match the get capacity with your price restraints
3.1 Set up different launch pools and define things like your EC2 instance type, your operating system and Availability Zone
3.2 You can have multiple pools and the fleet will choose the best way to implement depending on the strategy that you define
3.3 Spot fleets will stop launching instances once reach your price threshold or your capacity desire.
4 Strategies: You can have the following different strategies that you can have with spot fleets.
4.1 capacityOptimized: The spot instances comes from the pool with optimal capacity for the number of instances launching. So you're basically guaranteeing that you have a certain amount of capacity.
4.2 lowestPrice: The spot instances come from the pool with the lowest price and that's the default strategy.
4.3 Diversified: The spot instances distributed across all your different pools that you defined
4.4 InstancePoolsToUseCount: The spot instances are distributed across the number of spot instance pools that you specify and the parameter is only valid when used in combination with the lowest price. So this is kind of like a combination of diversified with lowest price, but with diversified, it's using all the pools.
With instance pools to use count you define which pools that you want. It will launch in those pools at the lowest price.
Exam Tips:
1. Spot instances can save you up to 90% of on-demand instances.
2. Useful for any type of computing where you don't need persistent storage.So ephemeral computing, for example
3. You can block spot instances from terminating by using spot block
4. A Spot Fleet is a collection of spot instances and optionally on-demand instances
** EC2 Hibernate:
We have learned so far we can stop and terminate EC2 instances. If we stop the instance, the data is kept on the disk (EBS) and will remain on the disk until the EC2 instance is started.
If the instance is terminated, then by default the root device volume will also be terminated.
When we start our EC2 instance, the following happens:
1. OS boots up
2. User data script is run (bootstrap scripts)
3. Applications start (can take some time)
EC2 Hibernate: When you hibernate an EC2 instance, the OS is told to perform hibernation (suspend-to-disk). Hibernation saves the content from the instance memory (RAM) to your Amazon EBS root volume. We persist the instance's Amazon EBS root volume and any attached Amazon EBS data volumes.
When you start your instance out of Hibernation:
1. The Amazon EBS root volume is restored to its previous state
2. The RAM contents are reloaded
3. The processes that were previously running on the instance are resumed.
4. Previously attached data volumes are reattached and the instance retains its instance ID.
With EC2 Hibernate, the instance boots much faster. The OS does not need to reboot because the in-memory state (RAM) is preserved.
This is useful for:
1. Long-running processes
2. Services that take time to initialise
Important: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html
Exam Tips:
1. EC2 Hibernate preserves the in-memory RAM on persistent storage (EBS)
2. Much faster to boot up because you do not need to reload the OS
3. Instance RAM must be less than 150 GB
4. Instance families include C3, C4, C5, M3, M4, M5, R3, R4 and R5
5. Available for Windows, Amazon Linux 2 AMI, and Ubuntu
6. Instances can't be hibernated for more than 60 days.
7. Available for On-Demand instances and Reserved Instances.
8. To hibernate an instance, it must first be enabled for hibernation. To enable hibernation, you must do it while launching the instance.
Important: You can't enable or disable hibernation for an instance after you launch it.
** CloudWatch 101
1. CloudWatch is to monitor performance
2. Monitors
2.1 EC2 Instances
2.2 Autoscaling Groups
2.3 Elastic Load Balancers
2.4 Route53 Health Checks
3. Storage and Content Delivery
3.1 EBS Volumes
3.2 Storage Gateways
3.3 CloudFront
4. CloudWatch and Ec2: Important: It can monitor host level metrics such as CPU, Network, Status check and Disk
* CloudWatch 101 - Exam Tips:
1. CloudWatch is used for monitoring performance.
2. CloudWatch can monitor most of AWS as well as your applications that run on AWS
3. CloudWatch with EC2 will monitor events every 5 mins by default.
4. You can have 1 min interval by turning on detailed monitoring
5. You can create CloudWatch alarms which trigger not monitoring.
6. CloudWatch is all about performance.
7. CloudTrail is all about auditing.
8. Standard Monitoring is 5 mins
9. Detailed monitoring is 1 min with additional cost.
10. Dashboards: Creates dashboards to see what is happening with your AWS environment
11. Alarms: Allows you to set Alarms that notify you when particular thresholds are hit.
12. Events: CloudWatch Events helps you to respond to state changes in your AWS resources.
13. Logs - CloudWatch Logs helps you to aggregate, monitor and store logs.
** CloudTrail vs CloudWatch
- CloudWatch monitors performance.
- CloudTrail monitors API calls in the AWS platform.
CloudTrail (Exam Tips)
1. Per AWS account and is enabled per region.
2. Can consolidate logs using S3 bucket:
2.1 Turn on CloudTrail in paying account.
2.2 Create a bucket policy that allows cross-account access.
2.3 Turn on CloudTrail in the other accounts and use the bucket in the paying account.
** AWS Command Line (CLI) Lab
*Using the command line: Exam Tips:
1. You can interact with AWS in 3 different ways
a. Using the console
b. Using the command line interface (CLI)
c. Using the SDK's
2. You will need to set up access in IAM.
3. Command themselves are not in the exam but some basic commands will be useful to know for real life.
*Using Roles: Exam Tips
1. Roles are much more secure than using access key id's and secret access keys and are easier to manage.
2. Adding/Modifying policies to roles are instantaneous. You can apply roles to EC2 instances anytime. When you do this, the change takes place immediately.
3. Roles are universal. You do not need to specify what region they are in, similar to users.
** IAM Management Roles - Lab (Exam Tips)
1. Roles are more secure than storing your access key and secret access key on individual EC2 instances.
2. Roles are easier to manage.
3. Roles can be assigned to an EC2 instance after it is created using both the console & command line.
4. Roles are universal.
** Bootstrap scripts
** Instance Metadata - Demo
Used to get information about an instance (such as public ip)
In EC2:
1. curl http://169.254.169.254/latest/user-data (stores bootstrap scripts)
2. curl http://169.254.169.254/latest/meta-data/ (stores meta-data)
3. curl http://169.254.169.254/latest/public-ipv4 (gives public ip)
** EFS Lab (REPEAT)
EFS stands for Elastic File System and it's a file storage service for Amazon's Elastic Compute Cloud or EC2 instances.
Important: So it's similar to EBS, except where you've got EBS, you can only mount your virtual disk to one EC2 instance and that's just the way it works.
You cannot have an EC2 instance, two EC2 instances sharing an EBS volume.
However, you can have them sharing an EFS volume. So EFS is an easy way to use and provide a simple interface that allows you to create and configure file systems
quickly and easily and with the EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove files so your applications have the storage
they need when they need it.
So it is actually really cool. Basically if you provision an EFS instance,
it will just grow automatically so you could put like one terabyte file on there and then add another terabyte, you don't need to pre-provision storage like you do with EBS.
So EFS is a way, it's great for basically file servers, it's a great way to share files between different EC2 instances. So as always, the best way to learn EFS is to go in and start using it.
What we're going to do is we're going to create two little EC2 instances, we're going to run a bootstrap script on them to install some tools as well as Apache
and then what we're going to do is we're going to go and mount this, our var dub-dub-dub HTML directory to an EFS mount point and then that way, we only need one copy of our website or our website will be stored on EFS and when we go and update or make changes to it we're just that those changes are replicated automatically across all our EC2 instances. So if you've got the time, please join me in the AWS console.
For the Lab:
#!/bin/bash
yum update -y
yum install http -y
service httpd start
chkconfig httpd on
yum install -y amazon-efs-utils
Exam Tips:
1. Supports the Network File System version 4 (NFSv4) protocol
2. You only pay for the storage you use (no pre-provisioning required)
3. Can scale up to the petabytes
4. Can support thousands of concurrent NFS connections.
5. Data is stored across multiple AZ's within a region
6. Read After Write Consistency.
** Amazon FSx for Windows and Amazon FSx for Lustre
1. Amazon Fsx for Windows File Server provides a fully managed native Microsoft Windows file system so you can easily move your Windows-based applications that require file storage to AWS.
Amazon FSx is built on Windows Server.
How is Windows FSx different to EFS
- Windows FSx:
1. A managed Windows Server that runs Windows Server Message Block (SMB)-based file services.
2. Designed for Windows and Windows applications.
3. Supports AD users, access control lists, groups and security policies, along with Distributed File System (DFS) namespaces and replication.
- EFS:
1. A managed NFS filer for EC2 instances based on Network File System (NFS) version 4.
2. One of the first network file sharing protocols native to Unix and Linux.
2. Amazon FSx for Lustre is a fully managed file system that is optimised for compute-intensive workloads, such as high-performance computing, machine learning, media data processing workflows, and electronic design automation (EDA).
With Amazon FSx, you can launch and run a Lustre file system that can process massive data sets at up to hundreds of gigabytes per second of throughput, millions of IOPS and sub-millisecond latencies.
How is Amazon FSx for Lustre different to EFS
- Lustre FSx:
1. Designed specifically for fast processing of workloads such as machine learning, high performance computing (HOC), video processing, financial modelling and electronic design automation (EDA).
2. Lets you launch and run a file system that provides sub-millisecond access to your data and allows you to read and write data at speeds of up to hundreds of gigabytes per second of throughput and millions of IOPS.
- EFS:
1. A managed NFS filer for EC2 instances based on Network File System (NFS) version 4.
2. One of the first network file sharing protocols native to Unix and Linux.
* Exam Tips: In the exam you'll be given different scenarios and asked to choose whether you should use an EFS, FSx for Windows or FSx for Lustre
1. EFS:
When you need distributed, highly resilient storage for Linux instances and Linux-based applications.