Resource: aws_opsworks_stack

Provides an OpsWorks stack resource.

Example Usage

resource "aws_opsworks_stack" "main" {
  name                         = "awesome-stack"
  region                       = "us-west-1"
  service_role_arn             = aws_iam_role.opsworks.arn
  default_instance_profile_arn = aws_iam_instance_profile.opsworks.arn

  tags = {
    Name = "foobar-terraform-stack"
  }

  custom_json = <<EOT
{
 "foobar": {
    "version": "1.0.0"
  }
}
EOT
}

Argument Reference

This resource supports the following arguments:

The custom_cookbooks_source block supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import OpsWorks stacks using the id. For example:

import {
  to = aws_opsworks_stack.bar
  id = "00000000-0000-0000-0000-000000000000"
}

Using terraform import, import OpsWorks stacks using the id. For example:

% terraform import aws_opsworks_stack.bar 00000000-0000-0000-0000-000000000000