Class CfnInstanceProps
Properties for defining a CfnInstance
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.OpsWorks
Assembly: Amazon.CDK.AWS.OpsWorks.dll
Syntax (csharp)
public class CfnInstanceProps : Object, ICfnInstanceProps
Syntax (vb)
Public Class CfnInstanceProps
Inherits Object
Implements ICfnInstanceProps
Remarks
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.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 cfnInstanceProps = new CfnInstanceProps {
InstanceType = "instanceType",
LayerIds = new [] { "layerIds" },
StackId = "stackId",
// the properties below are optional
AgentVersion = "agentVersion",
AmiId = "amiId",
Architecture = "architecture",
AutoScalingType = "autoScalingType",
AvailabilityZone = "availabilityZone",
BlockDeviceMappings = new [] { new BlockDeviceMappingProperty {
DeviceName = "deviceName",
Ebs = new EbsBlockDeviceProperty {
DeleteOnTermination = false,
Iops = 123,
SnapshotId = "snapshotId",
VolumeSize = 123,
VolumeType = "volumeType"
},
NoDevice = "noDevice",
VirtualName = "virtualName"
} },
EbsOptimized = false,
ElasticIps = new [] { "elasticIps" },
Hostname = "hostname",
InstallUpdatesOnBoot = false,
Os = "os",
RootDeviceType = "rootDeviceType",
SshKeyName = "sshKeyName",
SubnetId = "subnetId",
Tenancy = "tenancy",
TimeBasedAutoScaling = new TimeBasedAutoScalingProperty {
Friday = new Dictionary<string, string> {
{ "fridayKey", "friday" }
},
Monday = new Dictionary<string, string> {
{ "mondayKey", "monday" }
},
Saturday = new Dictionary<string, string> {
{ "saturdayKey", "saturday" }
},
Sunday = new Dictionary<string, string> {
{ "sundayKey", "sunday" }
},
Thursday = new Dictionary<string, string> {
{ "thursdayKey", "thursday" }
},
Tuesday = new Dictionary<string, string> {
{ "tuesdayKey", "tuesday" }
},
Wednesday = new Dictionary<string, string> {
{ "wednesdayKey", "wednesday" }
}
},
VirtualizationType = "virtualizationType",
Volumes = new [] { "volumes" }
};
Synopsis
Constructors
CfnInstanceProps() |
Properties
AgentVersion | The default AWS OpsWorks Stacks agent version. You have the following options:. |
AmiId | A custom AMI ID to be used to create the instance. |
Architecture | The instance architecture. |
AutoScalingType | For load-based or time-based instances, the type. |
AvailabilityZone | The Availability Zone of the AWS OpsWorks instance, such as |
BlockDeviceMappings | An array of |
EbsOptimized | Whether to create an Amazon EBS-optimized instance. |
ElasticIps | A list of Elastic IP addresses to associate with the instance. |
Hostname | The instance host name. The following are character limits for instance host names. |
InstallUpdatesOnBoot | Whether to install operating system and package updates when the instance boots. |
InstanceType | The instance type, such as |
LayerIds | An array that contains the instance's layer IDs. |
Os | The instance's operating system, which must be set to one of the following. |
RootDeviceType | The instance root device type. |
SshKeyName | The instance's Amazon EC2 key-pair name. |
StackId | The stack ID. |
SubnetId | The ID of the instance's subnet. |
Tenancy | The instance's tenancy option. |
TimeBasedAutoScaling | The time-based scaling configuration for the instance. |
VirtualizationType | The instance's virtualization type, |
Volumes | A list of AWS OpsWorks volume IDs to associate with the instance. |
Constructors
CfnInstanceProps()
public CfnInstanceProps()
Properties
AgentVersion
The default AWS OpsWorks Stacks agent version. You have the following options:.
public string AgentVersion { get; set; }
Property Value
System.String
Remarks
The default setting is INHERIT
. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions . AgentVersion cannot be set to Chef 12.2.
AmiId
A custom AMI ID to be used to create the instance.
public string AmiId { get; set; }
Property Value
System.String
Remarks
The AMI should be based on one of the supported operating systems. For more information, see Using Custom AMIs .
If you specify a custom AMI, you must set Os
to Custom
.
Architecture
The instance architecture.
public string Architecture { get; set; }
Property Value
System.String
Remarks
The default option is x86_64
. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types .
AutoScalingType
For load-based or time-based instances, the type.
public string AutoScalingType { get; set; }
Property Value
System.String
Remarks
Windows stacks can use only time-based instances.
AvailabilityZone
The Availability Zone of the AWS OpsWorks instance, such as us-east-2a
.
public string AvailabilityZone { get; set; }
Property Value
System.String
Remarks
BlockDeviceMappings
An array of BlockDeviceMapping
objects that specify the instance's block devices.
public object BlockDeviceMappings { get; set; }
Property Value
System.Object
Remarks
For more information, see Block Device Mapping . Note that block device mappings are not supported for custom AMIs.
EbsOptimized
Whether to create an Amazon EBS-optimized instance.
public object EbsOptimized { get; set; }
Property Value
System.Object
Remarks
ElasticIps
A list of Elastic IP addresses to associate with the instance.
public string[] ElasticIps { get; set; }
Property Value
System.String[]
Remarks
Hostname
The instance host name. The following are character limits for instance host names.
public string Hostname { get; set; }
Property Value
System.String
Remarks
InstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots.
public 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.
We strongly recommend using the default value of true
to ensure that your instances have the latest security updates.
InstanceType
The instance type, such as t2.micro
. For a list of supported instance types, open the stack in the console, choose Instances , and choose + Instance . The Size list contains the currently supported types. For more information, see Instance Families and Types . The parameter values that you use to specify the various types are in the API Name column of the Available Instance Types table.
public string InstanceType { get; set; }
Property Value
System.String
Remarks
LayerIds
An array that contains the instance's layer IDs.
public string[] LayerIds { get; set; }
Property Value
System.String[]
Remarks
Os
The instance's operating system, which must be set to one of the following.
public string Os { get; set; }
Property Value
System.String
Remarks
Not all operating systems are supported with all versions of Chef. For more information about the supported operating systems, see AWS OpsWorks Stacks Operating Systems .
The default option is the current Amazon Linux version. If you set this parameter to Custom
, you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. Block device mappings are not supported if the value is Custom
. For more information about how to use custom AMIs with AWS OpsWorks Stacks, see Using Custom AMIs .
RootDeviceType
The instance root device type.
public string RootDeviceType { get; set; }
Property Value
System.String
Remarks
SshKeyName
The instance's Amazon EC2 key-pair name.
public string SshKeyName { get; set; }
Property Value
System.String
Remarks
StackId
The stack ID.
public string StackId { get; set; }
Property Value
System.String
Remarks
SubnetId
The ID of the instance's subnet.
public string SubnetId { get; set; }
Property Value
System.String
Remarks
If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks Stacks to launch the instance in a different subnet.
Tenancy
The instance's tenancy option.
public string Tenancy { get; set; }
Property Value
System.String
Remarks
The default option is no tenancy, or if the instance is running in a VPC, inherit tenancy settings from the VPC. The following are valid values for this parameter: dedicated
, default
, or host
. Because there are costs associated with changes in tenancy options, we recommend that you research tenancy options before choosing them for your instances. For more information about dedicated hosts, see Dedicated Hosts Overview and Amazon EC2 Dedicated Hosts . For more information about dedicated instances, see Dedicated Instances and Amazon EC2 Dedicated Instances .
TimeBasedAutoScaling
The time-based scaling configuration for the instance.
public object TimeBasedAutoScaling { get; set; }
Property Value
System.Object
Remarks
VirtualizationType
The instance's virtualization type, paravirtual
or hvm
.
public string VirtualizationType { get; set; }
Property Value
System.String
Remarks
Volumes
A list of AWS OpsWorks volume IDs to associate with the instance.
public string[] Volumes { get; set; }
Property Value
System.String[]