AWS OpsWorks Custom Layer

This page shows how to write Terraform and CloudFormation for OpsWorks Custom Layer and write them securely.


Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.


Terraform Example (aws_opsworks_custom_layer)

Provides an OpsWorks custom layer resource.


Example Usage (from GitHub)

resource "aws_opsworks_custom_layer" "master" {
  name                        = "master"
  short_name                  = "master"
  stack_id                    =
  auto_assign_elastic_ips     = false
  auto_assign_public_ips      = false
resource "aws_opsworks_custom_layer" "mainlayer" {
  name                  = "PHP-apache2 layer"
  short_name            = "PHP-apache2"
  stack_id              =
  elastic_load_balancer =
resource "aws_opsworks_custom_layer" "application" {
  name       = "Application Layer"
  short_name = "app"
  stack_id   =
  custom_security_group_ids = []
  custom_setup_recipes = ["configuration::configFile"]

CloudFormation Example (AWS::OpsWorks::Layer)

Creates a layer. For more information, see How to Create a Layer.

Note You should use CreateLayer for noncustom layer types such as PHP App Server only if the stack does not have an existing layer of that type. A stack can have at most one instance of each noncustom layer; if you attempt to create a second instance, CreateLayer fails. A stack can have an arbitrary number of custom layers, so you can call CreateLayer as many times as you like for that layer type. Required Permissions: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.


Frequently asked questions

What is AWS OpsWorks Custom Layer?

AWS OpsWorks Custom Layer is a resource for OpsWorks of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS OpsWorks Custom Layer?

For Terraform, the shanmugakarna/terraform-elasticsearch, 1smii/iac_terraform_aws and sdr077/AppMonitor source code examples are useful. See the Terraform Example section for further details.