SlideShare a Scribd company logo
1 of 47
Download to read offline
awscdk-rootmail 📩
Secure your rootmail boxes on AWS multi-account setups
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
About me
● Senior Cloud Architect 󰠵
● Golden Jacket guy 🧥
● Traveller 🗺
● Yogi 󰩌
● Nerd 🤓
● loves emojis…
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
MV Consulting 2023
Agenda
3
● What was the purpose? 💭
● The challenge 😃
● Obstacles / complications 🚧
● The solution 💎
● Conclusion 😌
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The purpose 💭
5
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Purpose 💭
6
● was a superwerker maintainer
− repo got stalled in the middle of the cdk
migration
− I left my previous company
● again wanted to learn more cdk, especially
custom resources
● what is this project about?
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Why need it at all?
7
1. aws management account root mail
2. aws-roots+<uuid>@manuel-vogel.de
3. other accounts’ root mail
4. aws-roots+<other-uuid>@manuel-vogel.de
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Which tasks can only be performed by the root user?
9
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
● Change account settings.
● Restore IAM user permissions. If the only IAM administrator accidentally revokes their own
permissions
● Billing Console
○ Activate IAM access to the Billing and Cost Management console.
○ View certain tax invoices.
● Register as a seller in the Reserved Instance Marketplace.
● All principals are denied
○ Edit/delete an Amazon SQS resource policy that denies all principals.
○ Edit/delete an Amazon Simple Storage Service (Amazon S3) bucket policy that denies all
principals.
● AWS GovCloud (US)
○ Sign up for
○ Request AWS GovCloud (US) account root user access keys from AWS Support.
● Configure an Amazon S3 bucket to enable MFA (multi-factor authentication).
Root user tasks…
8
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Overview 😃 - looks easy… right?
10
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
What’s in for you 💭
11
● multiple cdk constructs
● quickly to setup (~5 minutes ⏳)
● use it for your own aws root account
● updates are planned for customization
○ use CMK
○ use custom lambda functions
● contribute & let me know your feedback
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The challenge 😃
12
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The challenge 😃
13
● migrate a whole CF stack: rootmail.yaml
○ 748 LoC 📄
○ nested StackSet
○ in another region 󰏚
○ with inline custom resources 🤯
○ written in python 🐍
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The challenge 😃
14
● hidden complexity with CW alarm & CFN wait
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The challenge 😃
15
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The challenge 😃
16
npm run projen
rm -rf node_modules/@mavogel/awscdk-rootmail/node_modules
npm run deploy
# wait… 🧐
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Why not use integration tests …
17
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Quick intro for integ-test runner 󰝄
18
● Assert how constructs interact
● Actual deployments
● Simulate real behaviour
● Contract testing
● still alpha
● cdk team itself uses it 💡
1. USAGE
2. integ-runner [TEST...] --language ts
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Quick intro for integ-test runner 󰝄
19
● Actual deployments
● Simulate real behaviour
1. USAGE
2. integ-runner [TEST...] --language ts
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Quick intro for integ-test runner
20
1. USAGE
2. integ-runner [TEST...] --language ts
or it can also be …
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Quick intro for integ-test runner
21
1. USAGE
2. integ-runner [TEST...] --language ts
what if you need to poll? 🤔
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Quick intro for integ-test runner
22
● does not work for the
lambdas yet…
● implement polling by
yourself… 😕
we will waitForIt…
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Overview 😃 - recap what we wanted to build…
23
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Obstacles on the way 🚧
24
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Obstacles on the way 🚧
25
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Obstacles on the way 🚧
26
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
27
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
28
Used chatGPT to rewrite lambdas from python to
node18
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
29
use chatGPT to have least privilege on lambda
permissions
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
30
use chatGPT to create a script for emptying and
deleting a S3 bucket
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
31
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
32
● However! chatGPT has architecture
limitations!
● Cannot replace a human review 󰲎
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution 💎
33
● everything up and running with integ tests? 🤔
● can we really test this automatically?
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
We’d need some autowiring of the DNS 💡
34
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution v2 💎 😏
35
󰗒 then cdk-app-review from Thorsten Hoeger
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
● rewrite custom resources
− isCompleteHandler
− onEventHandler also for cleanup
The solution v2 💎 😏
36
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
● rewrite custom resources
− isCompleteHandler
The solution v2 💎 😏
37
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution v2 💎 😏
38
● limit to 1 deploy region only
● do DNS lookup
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
The solution v2 💎 😏
39
● AWS news for more regions
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌
40
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌
41
● 🎉 integ tests are nice
○ takes some time to dig into them
○ sample repo from AWS is great
● 💎 takeaways
○ prompt engineering
○ KISS - don’t overcomplicate
○ use cdk native features - grants 󰗒 write
as little IAM permissions by yourself
● 🚀 I can recommend
○ THoeger’s cdk-app-review
○ Cristian’s chatGPT workshop
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌
42
No, we shall not do this 󰗃 🚫
We use grants instead 󰗈 ✅
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌
43
󰗍 here
here 󰗒
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌 - Final design
44
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌 - How can you use it?
45
via cdk construct via cloudformation template (still WIP 🚧) )
󰗒 https://github.com/MV-Consulting/awscdk-rootmail
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌
46
● another opinion from AWS
● https://github.com/aws-samples/aws-account-
factory-email
| AWS UG Frankfurt - Oct 2023
MV Consulting 2023
Conclusion 😌
47
● keep your root mail boxes 📩 secure 🔐
1. aws management account root mail
2. aws-roots+<uuid>@manuel-vogel.de
3. other accounts’ root mail
4. root+<uuid>@aws.manuel-vogel.de
K-1 BusinessClub Main Tower,
Neue Mainzer Str. 52, 60311
Frankfurt, Germany
manuel-vogel.de
Tel: +49151 413 43 721
Book an appointment
Thanks for attending

More Related Content

Similar to 2023-10-18-awscdk-rootmail.pdf

Dcamp ldn presentation
Dcamp ldn presentationDcamp ldn presentation
Dcamp ldn presentation
a_c_m
 

Similar to 2023-10-18-awscdk-rootmail.pdf (20)

Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
Architecting Analytic Pipelines on GCP - Chicago Cloud Conference 2020
 
Orchestrating workflows Apache Airflow on GCP & AWS
Orchestrating workflows Apache Airflow on GCP & AWSOrchestrating workflows Apache Airflow on GCP & AWS
Orchestrating workflows Apache Airflow on GCP & AWS
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
 
Nextflow and AWS Batch - GCC/BOSC 2018
Nextflow and AWS Batch - GCC/BOSC 2018Nextflow and AWS Batch - GCC/BOSC 2018
Nextflow and AWS Batch - GCC/BOSC 2018
 
Azure kubernetes service (aks)
Azure kubernetes service (aks)Azure kubernetes service (aks)
Azure kubernetes service (aks)
 
Building an analytics workflow using Apache Airflow
Building an analytics workflow using Apache AirflowBuilding an analytics workflow using Apache Airflow
Building an analytics workflow using Apache Airflow
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applications
 
Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016
 
Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016
 
Explore AWS Course Outline: Dive into Comprehensive Training at ONLC
Explore AWS Course Outline: Dive into Comprehensive Training at ONLCExplore AWS Course Outline: Dive into Comprehensive Training at ONLC
Explore AWS Course Outline: Dive into Comprehensive Training at ONLC
 
Cloud comparison - AWS vs Azure vs Google
Cloud comparison - AWS vs Azure vs GoogleCloud comparison - AWS vs Azure vs Google
Cloud comparison - AWS vs Azure vs Google
 
AWS Techniques and lessons writing low cost autoscaling GitLab runners
AWS Techniques and lessons writing low cost autoscaling GitLab runnersAWS Techniques and lessons writing low cost autoscaling GitLab runners
AWS Techniques and lessons writing low cost autoscaling GitLab runners
 
Dcamp ldn presentation
Dcamp ldn presentationDcamp ldn presentation
Dcamp ldn presentation
 
Aws Developer Associate Overview
Aws Developer Associate OverviewAws Developer Associate Overview
Aws Developer Associate Overview
 
AWS CSA Associate 07-07
AWS CSA Associate 07-07AWS CSA Associate 07-07
AWS CSA Associate 07-07
 
AWS CSA Associate 03-07
AWS CSA Associate 03-07AWS CSA Associate 03-07
AWS CSA Associate 03-07
 
PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applications
 
Serverless Architecture in Azure and AWS
Serverless Architecture in Azure and AWSServerless Architecture in Azure and AWS
Serverless Architecture in Azure and AWS
 
AWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 RecapAWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 Recap
 
Trivadis TechEvent 2017 Skills für die Reise in die Cloud by Daniel Steiger
Trivadis TechEvent 2017 Skills für die Reise in die Cloud by Daniel SteigerTrivadis TechEvent 2017 Skills für die Reise in die Cloud by Daniel Steiger
Trivadis TechEvent 2017 Skills für die Reise in die Cloud by Daniel Steiger
 

Recently uploaded

一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
AS
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
F
 
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
ayvbos
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
apekaom
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
A
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
F
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
mikehavy0
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
c6eb683559b3
 

Recently uploaded (20)

20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Nungambakkam (Chennai) Independent Escorts - 9632533318 100% genuine
Nungambakkam (Chennai) Independent Escorts - 9632533318 100% genuineNungambakkam (Chennai) Independent Escorts - 9632533318 100% genuine
Nungambakkam (Chennai) Independent Escorts - 9632533318 100% genuine
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
 
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptxA LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
 
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
 

2023-10-18-awscdk-rootmail.pdf

  • 1. awscdk-rootmail 📩 Secure your rootmail boxes on AWS multi-account setups
  • 2. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 About me ● Senior Cloud Architect 󰠵 ● Golden Jacket guy 🧥 ● Traveller 🗺 ● Yogi 󰩌 ● Nerd 🤓 ● loves emojis…
  • 3. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 MV Consulting 2023 Agenda 3 ● What was the purpose? 💭 ● The challenge 😃 ● Obstacles / complications 🚧 ● The solution 💎 ● Conclusion 😌
  • 4. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The purpose 💭 5
  • 5. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Purpose 💭 6 ● was a superwerker maintainer − repo got stalled in the middle of the cdk migration − I left my previous company ● again wanted to learn more cdk, especially custom resources ● what is this project about?
  • 6. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Why need it at all? 7 1. aws management account root mail 2. aws-roots+<uuid>@manuel-vogel.de 3. other accounts’ root mail 4. aws-roots+<other-uuid>@manuel-vogel.de
  • 7. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Which tasks can only be performed by the root user? 9
  • 8. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 ● Change account settings. ● Restore IAM user permissions. If the only IAM administrator accidentally revokes their own permissions ● Billing Console ○ Activate IAM access to the Billing and Cost Management console. ○ View certain tax invoices. ● Register as a seller in the Reserved Instance Marketplace. ● All principals are denied ○ Edit/delete an Amazon SQS resource policy that denies all principals. ○ Edit/delete an Amazon Simple Storage Service (Amazon S3) bucket policy that denies all principals. ● AWS GovCloud (US) ○ Sign up for ○ Request AWS GovCloud (US) account root user access keys from AWS Support. ● Configure an Amazon S3 bucket to enable MFA (multi-factor authentication). Root user tasks… 8
  • 9. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Overview 😃 - looks easy… right? 10
  • 10. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 What’s in for you 💭 11 ● multiple cdk constructs ● quickly to setup (~5 minutes ⏳) ● use it for your own aws root account ● updates are planned for customization ○ use CMK ○ use custom lambda functions ● contribute & let me know your feedback
  • 11. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The challenge 😃 12
  • 12. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The challenge 😃 13 ● migrate a whole CF stack: rootmail.yaml ○ 748 LoC 📄 ○ nested StackSet ○ in another region 󰏚 ○ with inline custom resources 🤯 ○ written in python 🐍
  • 13. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The challenge 😃 14 ● hidden complexity with CW alarm & CFN wait
  • 14. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The challenge 😃 15
  • 15. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The challenge 😃 16 npm run projen rm -rf node_modules/@mavogel/awscdk-rootmail/node_modules npm run deploy # wait… 🧐
  • 16. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Why not use integration tests … 17
  • 17. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Quick intro for integ-test runner 󰝄 18 ● Assert how constructs interact ● Actual deployments ● Simulate real behaviour ● Contract testing ● still alpha ● cdk team itself uses it 💡 1. USAGE 2. integ-runner [TEST...] --language ts
  • 18. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Quick intro for integ-test runner 󰝄 19 ● Actual deployments ● Simulate real behaviour 1. USAGE 2. integ-runner [TEST...] --language ts
  • 19. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Quick intro for integ-test runner 20 1. USAGE 2. integ-runner [TEST...] --language ts or it can also be …
  • 20. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Quick intro for integ-test runner 21 1. USAGE 2. integ-runner [TEST...] --language ts what if you need to poll? 🤔
  • 21. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Quick intro for integ-test runner 22 ● does not work for the lambdas yet… ● implement polling by yourself… 😕 we will waitForIt…
  • 22. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Overview 😃 - recap what we wanted to build… 23
  • 23. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Obstacles on the way 🚧 24
  • 24. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Obstacles on the way 🚧 25
  • 25. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Obstacles on the way 🚧 26
  • 26. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 27
  • 27. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 28 Used chatGPT to rewrite lambdas from python to node18
  • 28. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 29 use chatGPT to have least privilege on lambda permissions
  • 29. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 30 use chatGPT to create a script for emptying and deleting a S3 bucket
  • 30. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 31
  • 31. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 32 ● However! chatGPT has architecture limitations! ● Cannot replace a human review 󰲎
  • 32. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution 💎 33 ● everything up and running with integ tests? 🤔 ● can we really test this automatically?
  • 33. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 We’d need some autowiring of the DNS 💡 34
  • 34. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution v2 💎 😏 35 󰗒 then cdk-app-review from Thorsten Hoeger
  • 35. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 ● rewrite custom resources − isCompleteHandler − onEventHandler also for cleanup The solution v2 💎 😏 36
  • 36. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 ● rewrite custom resources − isCompleteHandler The solution v2 💎 😏 37
  • 37. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution v2 💎 😏 38 ● limit to 1 deploy region only ● do DNS lookup
  • 38. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 The solution v2 💎 😏 39 ● AWS news for more regions
  • 39. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 40
  • 40. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 41 ● 🎉 integ tests are nice ○ takes some time to dig into them ○ sample repo from AWS is great ● 💎 takeaways ○ prompt engineering ○ KISS - don’t overcomplicate ○ use cdk native features - grants 󰗒 write as little IAM permissions by yourself ● 🚀 I can recommend ○ THoeger’s cdk-app-review ○ Cristian’s chatGPT workshop
  • 41. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 42 No, we shall not do this 󰗃 🚫 We use grants instead 󰗈 ✅
  • 42. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 43 󰗍 here here 󰗒
  • 43. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 - Final design 44
  • 44. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 - How can you use it? 45 via cdk construct via cloudformation template (still WIP 🚧) ) 󰗒 https://github.com/MV-Consulting/awscdk-rootmail
  • 45. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 46 ● another opinion from AWS ● https://github.com/aws-samples/aws-account- factory-email
  • 46. | AWS UG Frankfurt - Oct 2023 MV Consulting 2023 Conclusion 😌 47 ● keep your root mail boxes 📩 secure 🔐 1. aws management account root mail 2. aws-roots+<uuid>@manuel-vogel.de 3. other accounts’ root mail 4. root+<uuid>@aws.manuel-vogel.de
  • 47. K-1 BusinessClub Main Tower, Neue Mainzer Str. 52, 60311 Frankfurt, Germany manuel-vogel.de Tel: +49151 413 43 721 Book an appointment Thanks for attending