Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Mastering AWS IaC with Pulumi and Python – Part 2

    Mastering AWS IaC with Pulumi and Python – Part 2

    April 5, 2025

    In Part 1 of this series, we learned about the importance of AWS and Pulumi. Now, let’s explore the demo part in this practical session, which will create a service on AWS VPC by using Pulumi.

    Before We Start, Ensure You Have the Following

    AWS Account with IAM permissions for resource creation

    • Install Pulumi CLI:
      • # curl -fsSL https://get.pulumi.com | sh
    • Install Python & Virtual Environment:
      • # python3 -m venv venv
      • # source venv/bin/activate # On Windows: venvScriptsactivate
        •  # pip install pulumi boto3

    Configure AWS Credentials

    • Check if AWS CLI is Installed
      • Run the command:
      • # aws –version
    • If AWS CLI is not installed, download and install it from AWS CLI installation guide.

    Create an IAM User and Assign Permissions

    • Go to the AWS Management Console → IAM → Users
    • Click Create User, provide a username, and check Access Key – Programmatic Access
    • Assign necessary policies/permissions (e.g., AdministratorAccess or a custom policy).

    Generate Security Credentials

    • After creating the user, download or copy the Access Key ID and Secret Access Key.

    Configure AWS CLI with IAM User Credentials

    • Run:
      • # aws configure
    • Enter the credentials when prompted:
      • Access Key ID
      • Secret Access Key
      • Default region (e.g., us-east-1)
      • Output format (e.g., json)

    Verify Configuration

    • Run a test command, such as:
      • # aws sts get-caller-identity
    • If everything is set up correctly, this will return the IAM user details.

    Pulumi Version

    Part2 1

    AWS Configuration

    Picture2 2

    Pulumi Dashboard

    Picture3

    It will be included with the details mentioned above

    • Overview
    • Readme
    • Updates
    • Deployments
    • Resources
    • Settings

    Deployment Steps with Commands and Screenshots

    Step 1: Initialize a Pulumi Project

    • # pulumi new aws-python

    Step 2: Define AWS Resources

    • Modify __main__.py to create a VPC:

    Picture4

    Step 3. Pulumi Preview

    • # Pulumi Preview

    Pulumi Preview shows a dry-run of changes before applying them. It helps you see what resources will be created (+), updated (~), or deleted (-) without actually making any changes.

    Picture5

    Step 4: Deploy Infrastructure

    • # pulumi up

    Pulumi up deploys or updates infrastructure by applying changes from your Pulumi code.

    Picture6

    Picture7

    Step 5: Verify Deployment

    AWS Console Page

    Creating VPC Peering with Pulumi

    Picture8

    Pulumi destroy

    • # Pulumi Destroy

    Removes all resources managed by Pulumi, restoring the environment to its original state.  Picture9

    Picture10

    Step 6: Pulumi Stack Remove

    • # Pulumi Stack rm <stack name>

    Pulumi stack rm removes a Pulumi stack and its state but does not delete cloud resources unless –force is used.

    Picture11

    Picture12

    After removed Stack

    Picture13

    AWS Console Page after deleting VPC

    Picture14

    Conclusion

    Pulumi offers a powerful, flexible, and developer-friendly approach to managing AWS infrastructure. By leveraging Pulumi, you can:

    • Simplify Infrastructure Management – Define cloud resources as code for consistency and repeatability.
    • Enhance Productivity—Create a dynamic infrastructure by using Python’s full capabilities, including loops, functions, and modules.
    • Improve Collaboration – Version control your infrastructure with Git and integrate seamlessly with CI/CD pipelines.
    • Achieve Multi-Cloud Flexibility – Deploy AWS, Azure, and Google Cloud workloads without changing tools.
    • Maintain Security & Compliance – Use IAM policies, automated policies, and state management to enforce best practices.

    With Pulumi’s modern IaC approach, you can move beyond traditional Terraform and CloudFormation and embrace a more scalable, flexible, and efficient way to manage AWS resources.

    Key Takeaways

    • Code-Driven Infrastructure – Use loops, conditionals, and functions for dynamic configurations.
    • Multi-Cloud & Hybrid Support – Pulumi works across AWS, Azure, Google Cloud, and Kubernetes.
    • State Management & Versioning – Store state remotely with Pulumi Cloud or AWS S3 + DynamoDB.
    • Developer-Friendly – No need to learn a new domain-specific language (DSL); use Python!
    • Experiment with More AWS Services – Deploy API Gateway, Lambda, or DynamoDB.
    • Implement CI/CD with Pulumi – Automate deployments using GitHub Actions, Jenkins, or AWS CodePipeline.
    • Explore Pulumi Stacks – Manage multiple environments efficiently.
    • Read the Official Pulumi Docs – Pulumi AWS Documentation

    References

    • Pulumi Official Website: https://www.pulumi.com
    • Pulumi AWS Documentation: https://www.pulumi.com/docs/clouds/aws
    • Pulumi Python SDK: https://www.pulumi.com/docs/using-pulumi/languages/python
    • AWS CLI Configuration: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
    • AWS IAM Best Practices: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
    • Pulumi GitHub Repository: https://github.com/pulumi/pulumi

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDomain Setup and Mail Flow Configuration in Microsoft 365
    Next Article Don’t ignore this troubling metric that your smart air purifier tracks – here’s why

    Related Posts

    Development

    GPT-5 is Coming: Revolutionizing Software Testing

    July 22, 2025
    Development

    Win the Accessibility Game: Combining AI with Human Judgment

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Orthodontist Orange County

    Web Development

    Microsoft Edge is now faster than ever — again — with 40% quicker load speeds

    News & Updates

    CVE-2025-4312 – SourceCodester Advanced Web Store SQL Injection

    Common Vulnerabilities and Exposures (CVEs)

    Boosting ROI with React Native: Why It’s a Smart Investment for Modern Businesses

    Web Development

    Highlights

    CVE-2025-40775 – BIND DNS Invalid TSIG Algorithm Field Vulnerability

    May 21, 2025

    CVE ID : CVE-2025-40775

    Published : May 21, 2025, 1:16 p.m. | 1 hour, 34 minutes ago

    Description : When an incoming DNS protocol message includes a Transaction Signature (TSIG), BIND always checks it. If the TSIG contains an invalid value in the algorithm field, BIND immediately aborts with an assertion failure.
    This issue affects BIND 9 versions 9.20.0 through 9.20.8 and 9.21.0 through 9.21.7.

    Severity: 7.5 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    A Step-by-Step Coding Guide to Defining Custom Model Context Protocol (MCP) Server and Client Tools with FastMCP and Integrating Them into Google Gemini 2.0’s Function‑Calling Workflow

    April 21, 2025

    Chinese Hackers Target Taiwan’s Semiconductor Sector with Cobalt Strike, Custom Backdoors

    July 18, 2025

    Rilasciato Mozilla Firefox 137: Ecco le Novità

    April 2, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.