Search for Well Architected Advice
< All Topics
Print

Deploy using immutable infrastructure

Controlled changes are essential for the deployment of new functionality and maintaining consistent operational environments. Immutable infrastructure allows for predictable management of workloads by ensuring that changes don’t affect existing systems, reducing the risk of unforeseen issues and enhancing overall reliability.

Best Practices

Implement Immutable Infrastructure

  • Utilize Infrastructure as Code (IaC) tools such as AWS CloudFormation or Terraform to define and manage infrastructure deployments. This allows for version control and repeatable builds.
  • Adopt a continuous integration and continuous deployment (CI/CD) pipeline to automate the process of building, testing, and deploying your immutable infrastructure. This ensures that changes are rolled out in a controlled and predictable manner.
  • Use containerization platforms (like Docker) to create portable, lightweight, and immutable application environments. Each change can be deployed as a new container with all its dependencies.
  • Incorporate blue/green or canary deployments as part of your deployment strategy. This helps in verifying new changes in production while minimizing impact on users.
  • Ensure comprehensive logging and monitoring is in place to quickly identify and roll back changes if needed. Tools like Amazon CloudWatch can be useful for this.
  • Train teams on the principles of immutable infrastructure to foster a culture of understanding and best practice adherence. Change management should now revolve around creating new instances rather than modifying existing ones.

Questions to ask your team

  • Have you established a process for creating immutable infrastructure?
  • How do you manage versioning of your infrastructure components?
  • What tools are you using to automate the deployment of new infrastructure?
  • How do you ensure that all changes to the system are fully tested before deployment?
  • What monitoring and logging practices do you have in place to verify the stability of new deployments?
  • How do you handle rollbacks in case of failures in the new infrastructure?
  • Is there a documented strategy for transitioning from the old infrastructure to the new?
  • How are team members trained to implement and operate within an immutable infrastructure model?

Who should be doing this?

Cloud Architect

  • Design the infrastructure architecture based on immutable infrastructure principles.
  • Ensure that all components are built to support deploying new environments without in-place changes.
  • Oversee the creation of deployment scripts and automation tools for building and deploying immutable infrastructure.

DevOps Engineer

  • Implement CI/CD pipelines that automate the deployment of immutable infrastructure.
  • Monitor deployment processes to ensure a smooth transition to new infrastructure.
  • Collaborate with development teams to ensure that applications can be easily deployed to new instances.

System Administrator

  • Manage the lifecycle of infrastructure by overseeing the creation and retirement of environments.
  • Ensure that backups and configuration versions are maintained for rollback purposes.
  • Coordinate with support teams to address issues related to new environment deployments.

Security Engineer

  • Implement security policies and access controls on new infrastructures.
  • Conduct vulnerability assessments and ensure compliance before deployment.
  • Collaborate with the Cloud Architect to integrate security best practices into the immutable infrastructure design.

Quality Assurance Engineer

  • Test new environments built on immutable infrastructure to ensure they meet functional and performance requirements.
  • Develop testing protocols that specifically address scenarios involving infrastructure changes.
  • Provide feedback on deployment processes to improve reliability and reduce downtime during new releases.

What evidence shows this is happening in your organization?

  • Immutable Infrastructure Deployment Playbook: A comprehensive playbook detailing the steps to implement immutable infrastructure within the organization. It includes best practices, tool recommendations, and deployment procedures.
  • Change Management Policy: A formal policy outlining the organization’s approach to managing changes in a controlled manner. It emphasizes the use of immutable infrastructure and defines roles, responsibilities, and procedures.
  • Infrastructure as Code (IaC) Template: An example template using IaC tools (like Terraform or AWS CloudFormation) to create immutable infrastructure. It ensures consistent and repeatable deployments in a controlled fashion.
  • Immutable Infrastructure Implementation Checklist: A checklist for teams to follow when implementing changes to ensure adherence to immutable infrastructure practices, covering testing, security, and deployment stages.
  • Incident Response Runbook for Immutable Infrastructure: A runbook that guides teams on how to respond to incidents in an environment utilizing immutable infrastructure, ensuring quick recovery and minimizing downtime.
  • Reliability Monitoring Dashboard: A dashboard that provides real-time insights into the health of immutable infrastructure deployments, including metrics on deployment success rates and system performance.

Cloud Services

AWS

  • Amazon EC2: Amazon EC2 allows you to create and manage virtual servers which can be configured as immutable infrastructure to support controlled deployments.
  • AWS CloudFormation: AWS CloudFormation helps you define your infrastructure as code, allowing you to spin up new environments with precise configuration, supporting the immutable infrastructure model.
  • AWS Elastic Beanstalk: Elastic Beanstalk enables easy deployment of applications in an environment that can be automatically scaled and updated as immutable resources.
  • Amazon ECS/EKS: Amazon ECS and EKS can be used to manage containerized applications where new versions are deployed as new containers, allowing for immutable infrastructure strategies.

Azure

  • Azure Virtual Machines: Azure VMs can be configured to support the immutable infrastructure model by creating new VMs for each change instead of updating in-place.
  • Azure Resource Manager: Azure Resource Manager allows you to deploy and manage resources using templates, supporting immutable infrastructure by ensuring consistent environments.
  • Azure Kubernetes Service: Azure Kubernetes Service simplifies deploying and managing containerized applications, following the immutability approach in application lifecycle management.

Google Cloud Platform

  • Google Compute Engine: Google Compute Engine offers flexible virtual machine configurations that can be managed as immutable infrastructure to ensure controlled deployments.
  • Google Kubernetes Engine: Google Kubernetes Engine helps manage containerized applications efficiently, enabling immutability by deploying new containers instead of modifying existing ones.
  • Cloud Deployment Manager: Cloud Deployment Manager allows you to create and manage resources using configuration files, facilitating the immutable infrastructure approach.

Question: How do you implement change?
Pillar: Reliability (Code: REL)

Table of Contents