Class CfnLayer
A CloudFormation AWS::OpsWorks::Layer
.
Inherited Members
Namespace: Amazon.CDK.AWS.OpsWorks
Assembly: Amazon.CDK.AWS.OpsWorks.dll
Syntax (csharp)
public class CfnLayer : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnLayer
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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 .
CloudformationResource: AWS::OpsWorks::Layer
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.OpsWorks;
var customJson;
var cfnLayer = new CfnLayer(this, "MyCfnLayer", new CfnLayerProps {
AutoAssignElasticIps = false,
AutoAssignPublicIps = false,
EnableAutoHealing = false,
Name = "name",
Shortname = "shortname",
StackId = "stackId",
Type = "type",
// the properties below are optional
Attributes = new Dictionary<string, string> {
{ "attributesKey", "attributes" }
},
CustomInstanceProfileArn = "customInstanceProfileArn",
CustomJson = customJson,
CustomRecipes = new RecipesProperty {
Configure = new [] { "configure" },
Deploy = new [] { "deploy" },
Setup = new [] { "setup" },
Shutdown = new [] { "shutdown" },
Undeploy = new [] { "undeploy" }
},
CustomSecurityGroupIds = new [] { "customSecurityGroupIds" },
InstallUpdatesOnBoot = false,
LifecycleEventConfiguration = new LifecycleEventConfigurationProperty {
ShutdownEventConfiguration = new ShutdownEventConfigurationProperty {
DelayUntilElbConnectionsDrained = false,
ExecutionTimeout = 123
}
},
LoadBasedAutoScaling = new LoadBasedAutoScalingProperty {
DownScaling = new AutoScalingThresholdsProperty {
CpuThreshold = 123,
IgnoreMetricsTime = 123,
InstanceCount = 123,
LoadThreshold = 123,
MemoryThreshold = 123,
ThresholdsWaitTime = 123
},
Enable = false,
UpScaling = new AutoScalingThresholdsProperty {
CpuThreshold = 123,
IgnoreMetricsTime = 123,
InstanceCount = 123,
LoadThreshold = 123,
MemoryThreshold = 123,
ThresholdsWaitTime = 123
}
},
Packages = new [] { "packages" },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
UseEbsOptimizedInstances = false,
VolumeConfigurations = new [] { new VolumeConfigurationProperty {
Encrypted = false,
Iops = 123,
MountPoint = "mountPoint",
NumberOfDisks = 123,
RaidLevel = 123,
Size = 123,
VolumeType = "volumeType"
} }
});
Synopsis
Constructors
CfnLayer(Construct, String, ICfnLayerProps) | Create a new |
CfnLayer(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnLayer(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Attributes | One or more user-defined key-value pairs to be added to the stack attributes. |
AutoAssignElasticIps | Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer . |
AutoAssignPublicIps | For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
CustomInstanceProfileArn | The ARN of an IAM profile to be used for the layer's EC2 instances. |
CustomJson | A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances. |
CustomRecipes | A |
CustomSecurityGroupIds | An array containing the layer custom security group IDs. |
EnableAutoHealing | Whether to disable auto healing for the layer. |
InstallUpdatesOnBoot | Whether to install operating system and package updates when the instance boots. |
LifecycleEventConfiguration | A |
LoadBasedAutoScaling | The load-based scaling configuration for the AWS OpsWorks layer. |
Name | The layer name, which is used by the console. |
Packages | An array of |
Shortname | For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS OpsWorks Stacks and by Chef recipes. |
StackId | The layer stack ID. |
Tags | Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer. |
Type | The layer type. |
UseEbsOptimizedInstances | Whether to use Amazon EBS-optimized instances. |
VolumeConfigurations | A |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnLayer(Construct, String, ICfnLayerProps)
Create a new AWS::OpsWorks::Layer
.
public CfnLayer(Construct scope, string id, ICfnLayerProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnLayerProps
- resource properties.
CfnLayer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnLayer(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnLayer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnLayer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Attributes
One or more user-defined key-value pairs to be added to the stack attributes.
public virtual object Attributes { get; set; }
Property Value
System.Object
Remarks
To create a cluster layer, set the EcsClusterArn
attribute to the cluster's ARN.
AutoAssignElasticIps
Whether to automatically assign an Elastic IP address to the layer's instances. For more information, see How to Edit a Layer .
public virtual object AutoAssignElasticIps { get; set; }
Property Value
System.Object
Remarks
AutoAssignPublicIps
For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances.
public virtual object AutoAssignPublicIps { get; set; }
Property Value
System.Object
Remarks
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
CustomInstanceProfileArn
The ARN of an IAM profile to be used for the layer's EC2 instances.
public virtual string CustomInstanceProfileArn { get; set; }
Property Value
System.String
Remarks
For more information about IAM ARNs, see Using Identifiers .
CustomJson
A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances.
public virtual object CustomJson { get; set; }
Property Value
System.Object
Remarks
For more information, see Using Custom JSON . This feature is supported as of version 1.7.42 of the AWS CLI .
CustomRecipes
A LayerCustomRecipes
object that specifies the layer custom recipes.
public virtual object CustomRecipes { get; set; }
Property Value
System.Object
Remarks
CustomSecurityGroupIds
An array containing the layer custom security group IDs.
public virtual string[] CustomSecurityGroupIds { get; set; }
Property Value
System.String[]
Remarks
EnableAutoHealing
Whether to disable auto healing for the layer.
public virtual object EnableAutoHealing { get; set; }
Property Value
System.Object
Remarks
InstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots.
public virtual object InstallUpdatesOnBoot { get; set; }
Property Value
System.Object
Remarks
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
.
LifecycleEventConfiguration
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.
public virtual object LifecycleEventConfiguration { get; set; }
Property Value
System.Object
Remarks
LoadBasedAutoScaling
The load-based scaling configuration for the AWS OpsWorks layer.
public virtual object LoadBasedAutoScaling { get; set; }
Property Value
System.Object
Remarks
Name
The layer name, which is used by the console.
public virtual string Name { get; set; }
Property Value
System.String
Remarks
Layer names can be a maximum of 32 characters.
Packages
An array of Package
objects that describes the layer packages.
public virtual string[] Packages { get; set; }
Property Value
System.String[]
Remarks
Shortname
For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS OpsWorks Stacks and by Chef recipes.
public virtual string Shortname { get; set; }
Property Value
System.String
Remarks
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 AWS OpsWorks Stacks. For more information, see the Layer Reference .
StackId
The layer stack ID.
public virtual string StackId { get; set; }
Property Value
System.String
Remarks
Tags
Specifies one or more sets of tags (key–value pairs) to associate with this AWS OpsWorks layer.
public virtual TagManager Tags { get; }
Property Value
Remarks
Use tags to manage your resources.
Type
The layer type.
public virtual string Type { get; set; }
Property Value
System.String
Remarks
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.
UseEbsOptimizedInstances
Whether to use Amazon EBS-optimized instances.
public virtual object UseEbsOptimizedInstances { get; set; }
Property Value
System.Object
Remarks
VolumeConfigurations
A VolumeConfigurations
object that describes the layer's Amazon EBS volumes.
public virtual object VolumeConfigurations { get; set; }
Property Value
System.Object
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>