SlideShare una empresa de Scribd logo
1 de 23
The Silence of the Lambda
Automate Windows AMI updates to stop the screaming
Why automate AMI updates?
• Security
• Consistency
• Cost
Stage 1– Identify AMIs (to update)
Tagging with “AutoUpdate = yes”
Stage 1 Technical Detail: Identify AMIs
Stage 1 – Identify AMIs( Completed)
Stage 2 – Update AMIs
Step 1: Launch EC2 Instances
Stage 2 – Update AMIs
WSUS
Server
Step 2: Run Update on EC2 Instances
Step 3: Create Updated AMIs
Stage 2 – Update AMIs
Step 1 – Launch EC2 Instance
resource.create_instances(ImageId=ami_id, … )
Stage 2 Technical Detail: Update AMI
Step 2 – Update EC2 Instance
params = {
"commands":["wuauclt.exe ..."],
"workingDirectory":["C:WindowsSystem32"],
}
ssm_client.send_command (
instance_id,
params, ... )
Stage 2 Technical Detail: Update AMI
Step 3 – Create Updated AMI
ami = client.create_image(
DryRun=False,
InstanceId=instance_id,
Description='Automated AMI creator',
Name="{0}-
{1}".format(name,int(time.time())))
Stage 2 Technical Detail: Update AMI
Appendix : 2 Lambda Functions linked via S3 Bucket
Stage 2 Technical Detail: Update AMI
Lambda Function BLambda Function A
Find AMI
Launch EC2A
Run UpdateB
Log update in S3 fileC
D
HousekeepingStage 1
Stage 2
Stage 3
Stage 2
Appendix : S3 Bucket Configuration
Stage 2 Technical Detail: Update AMI
Appendix – S3 Bucket Call
OutputS3BucketName='fc-automation',
OutputS3KeyPrefix="windowsupdates-{0}-{1}-
".format(instance_id, ami_id))
Stage 2 Technical Detail: Update AMI
Appendix : S3 Bucket Updates
Stage 2 Technical Detail: Update AMI
Stage 2 –Update AMIs ( Complete)
Stage 3 – Housekeeping
Step 1: De-register Earlier Version AMIs
Stage 3 – Housekeeping
Step 2: Terminate EC2 Instances
Deregister Earlier AMIs & Terminate EC2 Instances
Stage 3 Technical Detail: Housekeeping
client.deregister_image(ImageId=ami_id)
client.terminate_instances(InstanceIds=[instance_id])
Outcome: Updated AMIs
Stage 3 Technical Detail: Housekeeping
Stage 3 – Housekeeping ( Complete)
Stage 1
Identify AMIs
Stage 2
Update AMIs
Stage 3
Housekeeping
Automated AMI Update ( Complete)
Contact Details
jobs@terraalto.com
www.terraalto.com

Más contenido relacionado

Similar a Silence of the Lambda - Use AWS Lambda & Python to automate operating system updates on AMI - TerraAlto

Going Serverless
Going ServerlessGoing Serverless
Going Serverlessdehms
 
Cloud Insecurity
Cloud InsecurityCloud Insecurity
Cloud InsecurityMarco Arena
 
Unity Class 13 Presentation - .
Unity Class 13 Presentation -           .Unity Class 13 Presentation -           .
Unity Class 13 Presentation - .TaydeMCruz
 
How to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWSHow to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWSDenis Gundarev
 
JAX 2019 - Workflow automation reinvented
JAX 2019 - Workflow automation reinventedJAX 2019 - Workflow automation reinvented
JAX 2019 - Workflow automation reinventedBernd Ruecker
 
Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...
Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...
Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...Amazon Web Services
 
Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...
Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...
Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...Amazon Web Services
 
AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...
AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...
AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...Amazon Web Services
 
AWS Summit Nordics - Getting Started With AWS
AWS Summit Nordics - Getting Started With AWSAWS Summit Nordics - Getting Started With AWS
AWS Summit Nordics - Getting Started With AWSAmazon Web Services
 
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2Amazon Web Services
 
Training AWS: Module 2 - Computing in AWS
Training AWS: Module 2 - Computing in AWSTraining AWS: Module 2 - Computing in AWS
Training AWS: Module 2 - Computing in AWSBùi Quang Lâm
 
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...Serverless User Group Poland
 
"Building a Production-Grade Serverless Deployment" - Eoin Shanaghy, CTO, fo...
"Building a Production-Grade Serverless Deployment"  - Eoin Shanaghy, CTO, fo..."Building a Production-Grade Serverless Deployment"  - Eoin Shanaghy, CTO, fo...
"Building a Production-Grade Serverless Deployment" - Eoin Shanaghy, CTO, fo...LCloud
 
Rails in the Cloud
Rails in the CloudRails in the Cloud
Rails in the Cloudiwarshak
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersAmbarish Hazarnis
 
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudSupporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudOved Ourfali
 

Similar a Silence of the Lambda - Use AWS Lambda & Python to automate operating system updates on AMI - TerraAlto (20)

AWS EC2
AWS EC2AWS EC2
AWS EC2
 
Going Serverless
Going ServerlessGoing Serverless
Going Serverless
 
Cloud Insecurity
Cloud InsecurityCloud Insecurity
Cloud Insecurity
 
Unity Class 13 Presentation - .
Unity Class 13 Presentation -           .Unity Class 13 Presentation -           .
Unity Class 13 Presentation - .
 
Getting Started with Amazon EC2
Getting Started with Amazon EC2Getting Started with Amazon EC2
Getting Started with Amazon EC2
 
How to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWSHow to build a Citrix infrastructure on AWS
How to build a Citrix infrastructure on AWS
 
JAX 2019 - Workflow automation reinvented
JAX 2019 - Workflow automation reinventedJAX 2019 - Workflow automation reinvented
JAX 2019 - Workflow automation reinvented
 
Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...
Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...
Operations and Security at Cloud Scale with Amazon EC2 System Manager - AWS S...
 
Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...
Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...
Leveraging AWS Systems Manager for your hybrid Microsoft Workloads - Pop-up L...
 
AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...
AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...
AWS re:Invent 2016: Workshop: Adhere to the Principle of Least Privilege by U...
 
AWS Summit Nordics - Getting Started With AWS
AWS Summit Nordics - Getting Started With AWSAWS Summit Nordics - Getting Started With AWS
AWS Summit Nordics - Getting Started With AWS
 
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
Day 2 - Amazon EC2 Masterclass - Getting the most from Amazon EC2
 
Training AWS: Module 2 - Computing in AWS
Training AWS: Module 2 - Computing in AWSTraining AWS: Module 2 - Computing in AWS
Training AWS: Module 2 - Computing in AWS
 
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
AWS UG Warsaw & Serverless warsztatowo! 19.09.2019 | Eoin Shanaghy's presenta...
 
"Building a Production-Grade Serverless Deployment" - Eoin Shanaghy, CTO, fo...
"Building a Production-Grade Serverless Deployment"  - Eoin Shanaghy, CTO, fo..."Building a Production-Grade Serverless Deployment"  - Eoin Shanaghy, CTO, fo...
"Building a Production-Grade Serverless Deployment" - Eoin Shanaghy, CTO, fo...
 
AWS CodeCommit Setup
AWS CodeCommit SetupAWS CodeCommit Setup
AWS CodeCommit Setup
 
Rails in the Cloud
Rails in the CloudRails in the Cloud
Rails in the Cloud
 
Titanium Appcelerator - Beginners
Titanium Appcelerator - BeginnersTitanium Appcelerator - Beginners
Titanium Appcelerator - Beginners
 
Amazon s3ec2
Amazon s3ec2Amazon s3ec2
Amazon s3ec2
 
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via DeltacloudSupporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
Supporting and Using EC2/CIMI on top of Cloud Environments via Deltacloud
 

Último

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Último (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Silence of the Lambda - Use AWS Lambda & Python to automate operating system updates on AMI - TerraAlto

  • 1. The Silence of the Lambda Automate Windows AMI updates to stop the screaming
  • 2. Why automate AMI updates? • Security • Consistency • Cost
  • 3. Stage 1– Identify AMIs (to update)
  • 4. Tagging with “AutoUpdate = yes” Stage 1 Technical Detail: Identify AMIs
  • 5. Stage 1 – Identify AMIs( Completed)
  • 6. Stage 2 – Update AMIs Step 1: Launch EC2 Instances
  • 7. Stage 2 – Update AMIs WSUS Server Step 2: Run Update on EC2 Instances
  • 8. Step 3: Create Updated AMIs Stage 2 – Update AMIs
  • 9. Step 1 – Launch EC2 Instance resource.create_instances(ImageId=ami_id, … ) Stage 2 Technical Detail: Update AMI
  • 10. Step 2 – Update EC2 Instance params = { "commands":["wuauclt.exe ..."], "workingDirectory":["C:WindowsSystem32"], } ssm_client.send_command ( instance_id, params, ... ) Stage 2 Technical Detail: Update AMI
  • 11. Step 3 – Create Updated AMI ami = client.create_image( DryRun=False, InstanceId=instance_id, Description='Automated AMI creator', Name="{0}- {1}".format(name,int(time.time()))) Stage 2 Technical Detail: Update AMI
  • 12. Appendix : 2 Lambda Functions linked via S3 Bucket Stage 2 Technical Detail: Update AMI Lambda Function BLambda Function A Find AMI Launch EC2A Run UpdateB Log update in S3 fileC D HousekeepingStage 1 Stage 2 Stage 3 Stage 2
  • 13. Appendix : S3 Bucket Configuration Stage 2 Technical Detail: Update AMI
  • 14. Appendix – S3 Bucket Call OutputS3BucketName='fc-automation', OutputS3KeyPrefix="windowsupdates-{0}-{1}- ".format(instance_id, ami_id)) Stage 2 Technical Detail: Update AMI
  • 15. Appendix : S3 Bucket Updates Stage 2 Technical Detail: Update AMI
  • 16. Stage 2 –Update AMIs ( Complete)
  • 17. Stage 3 – Housekeeping Step 1: De-register Earlier Version AMIs
  • 18. Stage 3 – Housekeeping Step 2: Terminate EC2 Instances
  • 19. Deregister Earlier AMIs & Terminate EC2 Instances Stage 3 Technical Detail: Housekeeping client.deregister_image(ImageId=ami_id) client.terminate_instances(InstanceIds=[instance_id])
  • 20. Outcome: Updated AMIs Stage 3 Technical Detail: Housekeeping
  • 21. Stage 3 – Housekeeping ( Complete)
  • 22. Stage 1 Identify AMIs Stage 2 Update AMIs Stage 3 Housekeeping Automated AMI Update ( Complete)