Questions tagged [infrastructure-as-code]

Use this tag for DevOps related questions about 'Infrastructure as Code' (IaC), which is a way to automate and backup environments.

From Wikipedia:

Infrastructure as code (IaC) is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools. The IT infrastructure managed by this comprises both physical equipment such as bare-metal servers as well as virtual machines and associated configuration resources. The definitions may be in a version control system. It can use either scripts or declarative definitions, rather than manual processes, but the term is more often used to promote declarative approaches.

IaC approaches are promoted for cloud computing, which is sometimes marketed as infrastructure as a service (IaaS). IaC supports IaaS, but should not be confused with it.

49 questions
32
votes
4 answers

Best practices for app and infrastructure code repositories

We're looking for guidance on how to structure application code versus infrastructure code (IaC). More specifically, are there typical advantages/disadvantages to storing the two types of code in the same repository versus in different…
GaTechThomas
  • 380
  • 1
  • 3
  • 9
14
votes
2 answers

What is "Infrastructure as Code"?

The phrase "Infrastructure as Code" has been mentioned several times in the last two weeks in different contexts. What does it actually mean in a practical sense to have Infrastructure as Code?
Richard Slater
  • 11,747
  • 7
  • 43
  • 82
12
votes
4 answers

Infrastructure as code and TDD

Infrastructure as code tells us to use tools that automate your builds. Great. Tools like ansible, chef, puppet, salt stack and others push us towards writing how infrastructure looks like, while resolving the differences. In Salt Stack those bits…
JackLeo
  • 223
  • 1
  • 6
10
votes
3 answers

How should we automatically rebuild immutable infrastructure when new packages are available?

We're going to be using Terraform to automate our infrastructure deployment and Packer to create the machine images deployed by Terraform. By following immutable infrastructure design principles, we will implement patching by creating a new image…
9
votes
2 answers

How to Chef things that don't exist yet

Let us say I have some Chef code like: require 'mixlib/shellout' yum_package 'somepackage' myvar = Mixlib::ShellOut.new('/bin/somecommand').run_command.stdout.strip Where /bin/somecommand does not exist yet because it is installed by somepackage.…
Gaius
  • 1,096
  • 10
  • 18
8
votes
2 answers

What are ChatOps approach use cases of production infrastructure management?

Many "simple" use cases shown in examples of ChatOps approach, creation of cloud instances, deployments to test environment etc., are there any use cases for production infrastructure management?
rombob
  • 657
  • 5
  • 16
8
votes
1 answer

How to organize infrastructure as code projects?

I have completed an Infrastructure-as-Code project using Terraform and Ansible. Currently, I organize my project as follows: Project1 Terraform ec2.tf rds.tf … variables.tf scripts\
8
votes
2 answers

AllowedPattern for emails in Cloudformation template

I am struggling with specifying a regular expression for email parameter of Cloudformation : Parameters: MyEmail : Type: String Description: Email for notifications AllowedPattern: /[^\s@]+@[^\s@]+\.[^\s@]+/ ConstraintDescription:…
Abdennour TOUMI
  • 291
  • 3
  • 12
6
votes
2 answers

How to reconcile Infrastructure as Code and not storing env config in code?

When developing a Web App, and trying to adhere to what is generally considered best practice, e.g. The 12 factor app methodology etc. One key concept is to keep configuration and sensitive data out of your source code - access keys, connection…
5
votes
2 answers

If we are using containers do we still need to worry about configuration management at an infrastructure level?

We are about to begin our journey with containers and I am wondering if we still need to utilize something like Chef, Ansible, Terraform, etc. to ensure that our infrastructure is properly maintained? Since containers simply sit on that environment…
5
votes
1 answer

What is a suitable strategy for provisioning Chef Server through code?

Background I am tasked with setting up a Chef server on our Azure Cloud for a new DevOps automation project. We are using the Resource Manager model for Azure, in case it's relevant. We will likely use free versions of Chef i.e. Chef Automate is…
Vish
  • 601
  • 5
  • 14
5
votes
1 answer

How to apply using Terraform to launch multiple EC2 Resource with different configs (VPC not maintained by TF)

We are planning to use Terraform for provisioning EC2 instance which will host Oracle DB. While we are able to achieve this, there are some questions for which I am searching for suggestions / feedback's. Below is the directory structure we are…
4
votes
1 answer

How to "inject" AWS Lambda code into a CloudFormation?

I'm exercising an idea of not using S3 bucket to refer to the code of a lambda function. The usual example of a lambda CloudFormation code might look like: MyLambda: Type: AWS::Lambda::Function Properties: FunctionName:…
4
votes
4 answers

DevOps tools and automation of manual processes

This is a general question, but couldn't find a better place to ask. I'm a new DevOps member in a company, and I've been ask to "update" our DevOps technologies. Generally speaking, in what areas do we need to provide tools, and what are some…
4
votes
2 answers

Cloud-Init Script Won't Run?

I am working through this Terraform tutorial, which boots up a Go web app on an EC2 instance, using Terraform and cloud-init. This is my Terraform config file: terraform { required_version = ">= 0.13" required_providers { aws = { …
1
2 3 4