Skip to content

/AWS1/CL_OWX=>CREATELAYER()

About CreateLayer

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

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.

Method Signature

IMPORTING

Required arguments:

IV_STACKID TYPE /AWS1/OWXSTRING /AWS1/OWXSTRING

The layer stack ID.

IV_TYPE TYPE /AWS1/OWXLAYERTYPE /AWS1/OWXLAYERTYPE

The layer type. A stack cannot have more than one built-in layer of the same type. It can have any number of custom layers. Built-in layers are not available in Chef 12 stacks.

IV_NAME TYPE /AWS1/OWXSTRING /AWS1/OWXSTRING

The layer name, which is used by the console. Layer names can be a maximum of 32 characters.

IV_SHORTNAME TYPE /AWS1/OWXSTRING /AWS1/OWXSTRING

For custom layers only, use this parameter to specify the layer's short name, which is used internally by OpsWorks Stacks and by Chef recipes. The short name is also used as the name for the directory where your app files are installed. It can have a maximum of 32 characters, which are limited to the alphanumeric characters, '-', '_', and '.'.

Built-in layer short names are defined by OpsWorks Stacks. For more information, see the Layer Reference.

Optional arguments:

IT_ATTRIBUTES TYPE /AWS1/CL_OWXLAYERATTRIBUTES_W=>TT_LAYERATTRIBUTES TT_LAYERATTRIBUTES

One or more user-defined key-value pairs to be added to the stack attributes.

To create a cluster layer, set the EcsClusterArn attribute to the cluster's ARN.

IO_CLOUDWATCHLOGSCONF TYPE REF TO /AWS1/CL_OWXCLOUDWATCHLOGSCONF /AWS1/CL_OWXCLOUDWATCHLOGSCONF

Specifies CloudWatch Logs configuration options for the layer. For more information, see CloudWatchLogsLogStream.

IV_CUSTOMINSTANCEPROFILEARN TYPE /AWS1/OWXSTRING /AWS1/OWXSTRING

The ARN of an IAM profile to be used for the layer's EC2 instances. For more information about IAM ARNs, see Using Identifiers.

IV_CUSTOMJSON TYPE /AWS1/OWXSTRING /AWS1/OWXSTRING

A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances. For more information, see Using Custom JSON. This feature is supported as of version 1.7.42 of the CLI.

IT_CUSTOMSECURITYGROUPIDS TYPE /AWS1/CL_OWXSTRINGS_W=>TT_STRINGS TT_STRINGS

An array containing the layer custom security group IDs.

IT_PACKAGES TYPE /AWS1/CL_OWXSTRINGS_W=>TT_STRINGS TT_STRINGS

An array of Package objects that describes the layer packages.

IT_VOLUMECONFIGURATIONS TYPE /AWS1/CL_OWXVOLUMECONF=>TT_VOLUMECONFIGURATIONS TT_VOLUMECONFIGURATIONS

A VolumeConfigurations object that describes the layer's Amazon EBS volumes.

IV_ENABLEAUTOHEALING TYPE /AWS1/OWXBOOLEAN /AWS1/OWXBOOLEAN

Whether to disable auto healing for the layer.

IV_AUTOASSIGNELASTICIPS TYPE /AWS1/OWXBOOLEAN /AWS1/OWXBOOLEAN

Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer.

IV_AUTOASSIGNPUBLICIPS TYPE /AWS1/OWXBOOLEAN /AWS1/OWXBOOLEAN

For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances. For more information, see How to Edit a Layer.

IO_CUSTOMRECIPES TYPE REF TO /AWS1/CL_OWXRECIPES /AWS1/CL_OWXRECIPES

A LayerCustomRecipes object that specifies the layer custom recipes.

IV_INSTALLUPDATESONBOOT TYPE /AWS1/OWXBOOLEAN /AWS1/OWXBOOLEAN

Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment to run the update_dependencies stack command or by manually running yum (Amazon Linux) or apt-get (Ubuntu) on the instances.

To ensure that your instances have the latest security updates, we strongly recommend using the default value of true.

IV_USEEBSOPTIMIZEDINSTANCES TYPE /AWS1/OWXBOOLEAN /AWS1/OWXBOOLEAN

Whether to use Amazon EBS-optimized instances.

IO_LIFECYCLEEVENTCONF TYPE REF TO /AWS1/CL_OWXLIFECYCLEEVENTCONF /AWS1/CL_OWXLIFECYCLEEVENTCONF

A LifeCycleEventConfiguration object that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_OWXCREATELAYERRESULT /AWS1/CL_OWXCREATELAYERRESULT