Class CfnInstance
The AWS::Lightsail::Instance
resource specifies an Amazon Lightsail instance.
Inherited Members
Namespace: Amazon.CDK.AWS.Lightsail
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnInstance : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnInstance
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-instance.html
CloudformationResource: AWS::Lightsail::Instance
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.Lightsail;
var cfnInstance = new CfnInstance(this, "MyCfnInstance", new CfnInstanceProps {
BlueprintId = "blueprintId",
BundleId = "bundleId",
InstanceName = "instanceName",
// the properties below are optional
AddOns = new [] { new AddOnProperty {
AddOnType = "addOnType",
// the properties below are optional
AutoSnapshotAddOnRequest = new AutoSnapshotAddOnProperty {
SnapshotTimeOfDay = "snapshotTimeOfDay"
},
Status = "status"
} },
AvailabilityZone = "availabilityZone",
Hardware = new HardwareProperty {
CpuCount = 123,
Disks = new [] { new DiskProperty {
DiskName = "diskName",
Path = "path",
// the properties below are optional
AttachedTo = "attachedTo",
AttachmentState = "attachmentState",
Iops = 123,
IsSystemDisk = false,
SizeInGb = "sizeInGb"
} },
RamSizeInGb = 123
},
KeyPairName = "keyPairName",
Location = new LocationProperty {
AvailabilityZone = "availabilityZone",
RegionName = "regionName"
},
Networking = new NetworkingProperty {
Ports = new [] { new PortProperty {
AccessDirection = "accessDirection",
AccessFrom = "accessFrom",
AccessType = "accessType",
CidrListAliases = new [] { "cidrListAliases" },
Cidrs = new [] { "cidrs" },
CommonName = "commonName",
FromPort = 123,
Ipv6Cidrs = new [] { "ipv6Cidrs" },
Protocol = "protocol",
ToPort = 123
} },
// the properties below are optional
MonthlyTransfer = new MonthlyTransferProperty {
GbPerMonthAllocated = "gbPerMonthAllocated"
}
},
State = new StateProperty {
Code = 123,
Name = "name"
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
UserData = "userData"
});
Synopsis
Constructors
CfnInstance(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnInstance(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnInstance(Construct, String, ICfnInstanceProps) |
Properties
AddOns | An array of add-ons for the instance. |
AttrHardwareCpuCount | The number of vCPUs the instance has. |
AttrHardwareRamSizeInGb | The amount of RAM in GB on the instance (for example, |
AttrInstanceArn | The Amazon Resource Name (ARN) of the instance (for example, |
AttrIpv6Addresses | The IPv6 addresses of the instance. |
AttrIsStaticIp | A Boolean value indicating whether the instance has a static IP assigned to it. |
AttrLocationAvailabilityZone | The AWS Region and Availability Zone where the instance is located. |
AttrLocationRegionName | The AWS Region of the instance. |
AttrNetworkingMonthlyTransferGbPerMonthAllocated | The amount of allocated monthly data transfer (in GB) for an instance. |
AttrPrivateIpAddress | The private IP address of the instance. |
AttrPublicIpAddress | The public IP address of the instance. |
AttrResourceType | The resource type of the instance (for example, |
AttrSshKeyName | The name of the SSH key pair used by the instance. |
AttrStateCode | The status code of the instance. |
AttrStateName | The state of the instance (for example, |
AttrSupportCode | The support code of the instance. |
AttrUserName | The user name for connecting to the instance (for example, |
AvailabilityZone | The Availability Zone for the instance. |
BlueprintId | The blueprint ID for the instance (for example, |
BundleId | The bundle ID for the instance (for example, |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
Hardware | The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM. |
InstanceName | The name of the instance. |
KeyPairName | The name of the key pair to use for the instance. |
Location | The location for the instance, such as the AWS Region and Availability Zone. |
Networking | The public ports and the monthly amount of data transfer allocated for the instance. |
State | The status code and the state (for example, |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | An array of key-value pairs to apply to this resource. |
UserData | The optional launch script for the instance. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnInstance(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnInstance(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnInstance(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnInstance(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnInstance(Construct, String, ICfnInstanceProps)
public CfnInstance(Construct scope, string id, ICfnInstanceProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnInstanceProps
Resource properties.
Properties
AddOns
An array of add-ons for the instance.
public virtual object AddOns { get; set; }
Property Value
System.Object
AttrHardwareCpuCount
The number of vCPUs the instance has.
public virtual double AttrHardwareCpuCount { get; }
Property Value
System.Double
Remarks
CloudformationAttribute: Hardware.CpuCount
AttrHardwareRamSizeInGb
The amount of RAM in GB on the instance (for example, 1.0
).
public virtual double AttrHardwareRamSizeInGb { get; }
Property Value
System.Double
Remarks
CloudformationAttribute: Hardware.RamSizeInGb
AttrInstanceArn
The Amazon Resource Name (ARN) of the instance (for example, arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE
).
public virtual string AttrInstanceArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: InstanceArn
AttrIpv6Addresses
The IPv6 addresses of the instance.
public virtual string[] AttrIpv6Addresses { get; }
Property Value
System.String[]
Remarks
CloudformationAttribute: Ipv6Addresses
AttrIsStaticIp
A Boolean value indicating whether the instance has a static IP assigned to it.
public virtual IResolvable AttrIsStaticIp { get; }
Property Value
Remarks
CloudformationAttribute: IsStaticIp
AttrLocationAvailabilityZone
The AWS Region and Availability Zone where the instance is located.
public virtual string AttrLocationAvailabilityZone { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Location.AvailabilityZone
AttrLocationRegionName
The AWS Region of the instance.
public virtual string AttrLocationRegionName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Location.RegionName
AttrNetworkingMonthlyTransferGbPerMonthAllocated
The amount of allocated monthly data transfer (in GB) for an instance.
public virtual string AttrNetworkingMonthlyTransferGbPerMonthAllocated { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Networking.MonthlyTransfer.GbPerMonthAllocated
AttrPrivateIpAddress
The private IP address of the instance.
public virtual string AttrPrivateIpAddress { get; }
Property Value
System.String
Remarks
CloudformationAttribute: PrivateIpAddress
AttrPublicIpAddress
The public IP address of the instance.
public virtual string AttrPublicIpAddress { get; }
Property Value
System.String
Remarks
CloudformationAttribute: PublicIpAddress
AttrResourceType
The resource type of the instance (for example, Instance
).
public virtual string AttrResourceType { get; }
Property Value
System.String
Remarks
CloudformationAttribute: ResourceType
AttrSshKeyName
The name of the SSH key pair used by the instance.
public virtual string AttrSshKeyName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: SshKeyName
AttrStateCode
The status code of the instance.
public virtual double AttrStateCode { get; }
Property Value
System.Double
Remarks
CloudformationAttribute: State.Code
AttrStateName
The state of the instance (for example, running
or pending
).
public virtual string AttrStateName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: State.Name
AttrSupportCode
The support code of the instance.
public virtual string AttrSupportCode { get; }
Property Value
System.String
Remarks
Include this code in your email to support when you have questions about an instance or another resource in Lightsail . This code helps our support team to look up your Lightsail information.
CloudformationAttribute: SupportCode
AttrUserName
The user name for connecting to the instance (for example, ec2-user
).
public virtual string AttrUserName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: UserName
AvailabilityZone
The Availability Zone for the instance.
public virtual string AvailabilityZone { get; set; }
Property Value
System.String
BlueprintId
The blueprint ID for the instance (for example, os_amlinux_2016_03
).
public virtual string BlueprintId { get; set; }
Property Value
System.String
BundleId
The bundle ID for the instance (for example, micro_1_0
).
public virtual string BundleId { get; set; }
Property Value
System.String
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
Hardware
The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.
public virtual object Hardware { get; set; }
Property Value
System.Object
InstanceName
The name of the instance.
public virtual string InstanceName { get; set; }
Property Value
System.String
KeyPairName
The name of the key pair to use for the instance.
public virtual string KeyPairName { get; set; }
Property Value
System.String
Location
The location for the instance, such as the AWS Region and Availability Zone.
public virtual object Location { get; set; }
Property Value
System.Object
Networking
The public ports and the monthly amount of data transfer allocated for the instance.
public virtual object Networking { get; set; }
Property Value
System.Object
State
The status code and the state (for example, running
) of the instance.
public virtual object State { get; set; }
Property Value
System.Object
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
An array of key-value pairs to apply to this resource.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
UserData
The optional launch script for the instance.
public virtual string UserData { get; set; }
Property Value
System.String
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>