Skip to main content

2 posts tagged with "stackops"

View All Tags

Understanding AWS Infrastructure as Code (IaC): Declarative vs. Imperative Approaches

· 3 min read
Simon Morgan

When it comes to managing your AWS infrastructure, there's an ongoing debate about the best approach to Infrastructure as Code (IaC).

Many practitioners on platforms like Reddit, Medium, and Dev.to advocate for using languages such as Python, TypeScript, JavaScript, Java, or C# with AWS Cloud Development Kit (CDK). In this post, I’ll explore why these recommendations are prevalent and introduce StackOps, a tool that enables IaC practitioners to continue using imperative CloudFormation templates effectively.

Programming Language Classification

CloudFormation templates use JSON or YAML, which are classified as "declarative" languages. In contrast, languages supported by AWS SDK and CDK - such as Python and TypeScript - are considered "imperative."

The two paradigms differ fundamentally:

  • Declarative Languages (e.g., CloudFormation templates):

    • Focus on describing what the output should be.
    • Abstracts away how the output is generated.
    • Involves very minimal control flow.
  • Imperative Languages (e.g., Python, TypeScript):

    • Specify both what the output should be and how it is achieved.
    • Involves explicit control flow, error handling, and logic.

What’s the Difference?

The primary differences between declarative and imperative languages pertain to their complexity and use cases:

  • Language Complexity: Declarative languages have simpler syntax and are easier to code.
  • Output Complexity: Imperative languages cater to more complex scenarios and logic.

It seems that declarative languages are great for simple infrastructure setups, while imperative languages are better suited for complex, distributed, and dynamic setups.

Why is this Important?

Many argue for moving away from CloudFormation due to the output complexity imperative languages can handle. Here’s why:

  • Complexity Handling: Imperative languages can manage complex scenarios, such as large, distributed, dynamic infrastructure setups.
  • Code Reusability: Python and TypeScript support variables, functions, and modules, enhancing code reuse and easing maintenance.
  • Logic and Loops: Allow conditional logic and loops, enabling more dynamic infrastructure setups.
  • Error Checking: IDEs offer linting, type-checking, and autocompletion, increasing productivity.
  • Abstractions and Constructs: AWS CDK provides higher-level constructs to simplify resource management.
  • Multi-Environment Deployment: Easier configuration management across environments like dev and prod.

Is Imperative Code for IaC the Best?

Initially, I believed imperative code was the key for IaC. However, challenges soon emerged:

  • Without CDK, the amount of coding becomes overwhelming.
  • Resource drift can be problematic - tracking whether resources match their definitions often leads back to CloudFormation.
  • Dependency management is challenging, particularly with circular dependencies.
  • Managing deployments across multiple accounts and stages remains difficult.

Embracing CloudFormation's Strengths

So I came full circle back to CloudFormation, compelled by its simplicity, declarative nature, and the robust features it offers during stack creation and updates.

Instead of using imperative code to create infrastructure, I coded to create a solution that would compliment CloudFormation, enhancing its capabilities and addressing its limitations. My objective was to develop a solution that was:

  • Fully compatible with CloudFormation and entirely declarative.
  • Capable of supporting multi-account and multi-region deployments.
  • Designed to make stacks modular, with automatic dependencies for large, distributed environments.
  • Secure and fully contained within a customer’s AWS account.
  • Equipped with a simple, user-friendly web console for deployment execution and oversight.

Introducing StackOps

Grappling with the pros and cons of declarative versus imperative languages inspired the creation of StackOps, a CloudFormation deployment pipeline and management console. It can be set up in under five minutes in your AWS account, leveraging CloudFormation’s strengths while addressing multi-account and modularity challenges—all using declarative code.

If you’re interested in learning more or need assistance getting started with IaC, visit StackOps or reach out for support.

Introducing StackOps — The Future of AWS IaC with CloudFormation!

· 2 min read
Simon Morgan

Hey fellow AWS Cloud Enthusiasts!

I’m proud to announce StackOps, a groundbreaking new infrastructure-as-code solution for AWS Architects and DevOps Engineers that I personally wrote.

What is StackOps?

Built natively for AWS, StackOps is a powerful Infrastructure as Code (IaC) solution that provides a code pipeline and deployment console. It installs into your AWS Account and links to a GitHub repository. Infrastructure change management has never been easier!

Overview at https://www.youtube.com/watch?v=EBN7y5PGSk4

Why StackOps?

  • GitHub Integration: Fully integrated with GitHub for seamless CI/CD automation and version control, making it easy to manage infrastructure with modern DevOps practices.
  • Compatible with Existing CloudFormation Templates: Already using CloudFormation? StackOps works with your existing templates, so you don’t need to make any changes to get started.
  • Single and Multi-account Ready: Works well for single AWS account environments as well as large, complex multi-account/region environments.
  • Data-rich Console: View code, deployment, stack, and resource events in real-time, without needing a page refresh. Each Stack is also linked into the AWS Console with a single click for easy access.

Key Features

  • Automated CloudFormation Stack Management: Easily deploy and manage AWS CloudFormation stacks with just a few clicks across accounts and regions.
  • Infrastructure Visibility: Gain real-time insights into your infrastructure deployments via the StackOps deployment console, which streams CloudFormation events in real time to the browser without needing to be refreshed.
  • Advanced Stack Dependencies: Automatic dependency resolution of Stack outputs to Stack parameters, even across accounts and regions. Stack executions honour dependencies yet also parallelise execution of Stacks across accounts and regions to the maximum extent possible, making deployments fast.
  • Enhanced Security: StackOps is installed into each customer’s own AWS account, ensuring that your infrastructure data stays securely within your own environment

Ready to Start Your AWS IaC Journey?

As the founder of StackOps, I’m excited to offer assistance to anyone looking to start or enhance their AWS Infrastructure as Code journey. Don’t hesitate to reach out for help!

Check out StackOps and join me in reshaping the way we approach automated AWS infrastructure change management. 🚀