Skip to content

Instantly share code, notes, and snippets.

@filipeandre
Created July 10, 2024 07:33
Show Gist options
  • Save filipeandre/86045f825139ee752e67fed5cc2edc5c to your computer and use it in GitHub Desktop.
Save filipeandre/86045f825139ee752e67fed5cc2edc5c to your computer and use it in GitHub Desktop.
Script used to create a power point presentation
from pptx import Presentation
from pptx.util import Inches
prs = Presentation()
# Slide 1: Title Slide
slide_1 = prs.slides.add_slide(prs.slide_layouts[0])
title_1 = slide_1.shapes.title
subtitle_1 = slide_1.placeholders[1]
title_1.text = "Suspend Manager Event Flow Representation"
subtitle_1.text = "Overview of Event Buses and Workflows\nYour Name\nDate"
# Slide 2: Agenda
slide_2 = prs.slides.add_slide(prs.slide_layouts[1])
title_2 = slide_2.shapes.title
content_2 = slide_2.placeholders[1]
title_2.text = "Agenda"
content_2.text = """1. Introduction
2. Organization Egress Bus
3. Local Bus
4. Ingress Bus
5. Suspend Workflow
6. Resume Workflow
7. Summary
8. Q&A"""
# Slide 3: Introduction
slide_3 = prs.slides.add_slide(prs.slide_layouts[1])
title_3 = slide_3.shapes.title
content_3 = slide_3.placeholders[1]
title_3.text = "Introduction"
content_3.text = """- Brief overview of the Suspend Manager
- Importance of managing events across various accounts
- Goals of the presentation"""
# Slide 4: Organization Egress Bus
slide_4 = prs.slides.add_slide(prs.slide_layouts[1])
title_4 = slide_4.shapes.title
content_4 = slide_4.placeholders[1]
title_4.text = "Organization Egress Bus"
content_4.text = """- Organization scheduled events are managed by rules in the Main account Default Bus
- Events target the Egress bus
- Events are forwarded to all Local buses in organization accounts"""
# img_path = "/mnt/data/organization_egress_bus.png"
#
# slide_4.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 5: Local Bus
slide_5 = prs.slides.add_slide(prs.slide_layouts[1])
title_5 = slide_5.shapes.title
content_5 = slide_5.placeholders[1]
title_5.text = "Local Bus"
content_5.text = """- Events sent to the Local Bus trigger local account events (suspend, resume, reset)
- Changes in RDS or CloudFormation stack status are managed by rules targeting event processor lambdas
- Lambdas target an SNS error topic which forwards messages to the local bus
- Info or error logs are forwarded from the Local bus to the Ingress bus"""
# img_path = "/mnt/data/local_bus.png"
#
# slide_5.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 6: Ingress Bus
slide_6 = prs.slides.add_slide(prs.slide_layouts[1])
title_6 = slide_6.shapes.title
content_6 = slide_6.placeholders[1]
title_6.text = "Ingress Bus"
content_6.text = """- Events sent to the Ingress Bus trigger lambdas like sending notifications to Slack"""
# img_path = "/mnt/data/ingress_bus.png"
#
# slide_6.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 7: Suspend Workflow Overview
slide_7 = prs.slides.add_slide(prs.slide_layouts[1])
title_7 = slide_7.shapes.title
content_7 = slide_7.placeholders[1]
title_7.text = "Suspend Workflow Overview"
content_7.text = """- Overview of the suspend workflow steps
- Explanation of triggers and actions taken during the workflow"""
# Slide 8: Suspend Workflow - First Trigger
slide_8 = prs.slides.add_slide(prs.slide_layouts[1])
title_8 = slide_8.shapes.title
content_8 = slide_8.placeholders[1]
title_8.text = "Suspend Workflow - First Trigger"
content_8.text = """- Suspend is triggered for the first time
- List stacks and suspend each resource
- Record RDS wait condition to DynamoDB if in invalid status
- Update runlevel-0 stack to disable NAT gateway
- Save to DynamoDB and wait for instructions"""
# img_path = "/mnt/data/suspend_workflow_first.png"
#
# slide_8.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 9: Suspend Workflow - Second Trigger
slide_9 = prs.slides.add_slide(prs.slide_layouts[1])
title_9 = slide_9.shapes.title
content_9 = slide_9.placeholders[1]
title_9.text = "Suspend Workflow - Second Trigger"
content_9.text = """- Triggered by runlevel-0 stack status change event
- Triggered by RDS status change event
- Check and execute suspend:RDS callback action
- Check and execute suspend complete callback action"""
# img_path = "/mnt/data/suspend_workflow_second.png"
#
# slide_9.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 10: Resume Workflow Overview
slide_10 = prs.slides.add_slide(prs.slide_layouts[1])
title_10 = slide_10.shapes.title
content_10 = slide_10.placeholders[1]
title_10.text = "Resume Workflow Overview"
content_10.text = """- Overview of the resume workflow steps
- Explanation of triggers and actions taken during the workflow"""
# Slide 11: Resume Workflow - First Trigger
slide_11 = prs.slides.add_slide(prs.slide_layouts[1])
title_11 = slide_11.shapes.title
content_11 = slide_11.placeholders[1]
title_11.text = "Resume Workflow - First Trigger"
content_11.text = """- Resume is triggered for the first time
- List stacks and update runlevel-0 stack to enable NAT gateway
- Save to DynamoDB and wait for instructions"""
# img_path = "/mnt/data/resume_workflow_first.png"
#
# slide_11.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 12: Resume Workflow - Second Trigger
slide_12 = prs.slides.add_slide(prs.slide_layouts[1])
title_12 = slide_12.shapes.title
content_12 = slide_12.placeholders[1]
title_12.text = "Resume Workflow - Second Trigger"
content_12.text = """- Triggered by runlevel-0 stack status change event
- Resume each stack resource
- Record RDS wait condition to DynamoDB if in invalid status"""
# img_path = "/mnt/data/resume_workflow_second.png"
#
# slide_12.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 13: Resume Workflow - Third Trigger
slide_13 = prs.slides.add_slide(prs.slide_layouts[1])
title_13 = slide_13.shapes.title
content_13 = slide_13.placeholders[1]
title_13.text = "Resume Workflow - Third Trigger"
content_13.text = """- Triggered by RDS status change event
- Check and execute resume:RDS callback action
- Check and execute resume complete callback action"""
# img_path = "/mnt/data/resume_workflow_third.png"
#
# slide_13.shapes.add_picture(img_path, Inches(1), Inches(2), width=Inches(8.5), height=Inches(3))
# Slide 14: Summary
slide_14 = prs.slides.add_slide(prs.slide_layouts[1])
title_14 = slide_14.shapes.title
content_14 = slide_14.placeholders[1]
title_14.text = "Summary"
content_14.text = """- Recap of the Suspend Manager event flow
- Importance of each bus (Egress, Local, Ingress)
- Key points from the suspend and resume workflows"""
# Slide 15: Q&A
slide_15 = prs.slides.add_slide(prs.slide_layouts[1])
title_15 = slide_15.shapes.title
content_15 = slide_15.placeholders[1]
title_15.text = "Questions & Answers"
content_15.text = "Open the floor for questions from the audience"
# Slide 16: Thank You
slide_16 = prs.slides.add_slide(prs.slide_layouts[1])
title_16 = slide_16.shapes.title
content_16 = slide_16.placeholders[1]
title_16.text = "Thank You"
content_16.text = "Contact Information\nFinal thoughts"
# Save the presentation
pptx_file = "Suspend_Manager_Event_Flow_Presentation.pptx"
prs.save(pptx_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment