Class CfnInstance
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.opsworks.CfnInstance
- All Implemented Interfaces:
IInspectable,IInstanceRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:44.351Z")
@Stability(Stable)
public class CfnInstance
extends CfnResource
implements IInspectable, IInstanceRef
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.opsworks.*;
CfnInstance cfnInstance = CfnInstance.Builder.create(this, "MyCfnInstance")
.instanceType("instanceType")
.layerIds(List.of("layerIds"))
.stackId("stackId")
// the properties below are optional
.agentVersion("agentVersion")
.amiId("amiId")
.architecture("architecture")
.autoScalingType("autoScalingType")
.availabilityZone("availabilityZone")
.blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
.ebs(EbsBlockDeviceProperty.builder()
.deleteOnTermination(false)
.iops(123)
.snapshotId("snapshotId")
.volumeSize(123)
.volumeType("volumeType")
.build())
.noDevice("noDevice")
.virtualName("virtualName")
.build()))
.ebsOptimized(false)
.elasticIps(List.of("elasticIps"))
.hostname("hostname")
.installUpdatesOnBoot(false)
.os("os")
.rootDeviceType("rootDeviceType")
.sshKeyName("sshKeyName")
.subnetId("subnetId")
.tenancy("tenancy")
.timeBasedAutoScaling(TimeBasedAutoScalingProperty.builder()
.friday(Map.of(
"fridayKey", "friday"))
.monday(Map.of(
"mondayKey", "monday"))
.saturday(Map.of(
"saturdayKey", "saturday"))
.sunday(Map.of(
"sundayKey", "sunday"))
.thursday(Map.of(
"thursdayKey", "thursday"))
.tuesday(Map.of(
"tuesdayKey", "tuesday"))
.wednesday(Map.of(
"wednesdayKey", "wednesday"))
.build())
.virtualizationType("virtualizationType")
.volumes(List.of("volumes"))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExample:static final classA fluent builder forCfnInstance.static interfaceExample:static interfaceExample:Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.opsworks.IInstanceRef
IInstanceRef.Jsii$Default, IInstanceRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnInstance(software.amazon.jsii.JsiiObjectRef objRef) CfnInstance(software.constructs.Construct scope, String id, CfnInstanceProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe default OpsWorks Stacks agent version.getAmiId()A custom AMI ID to be used to create the instance.The instance architecture.The Availability Zone of the OpsWorks instance, such asus-east-2a.The private DNS name of the OpsWorks instance.The private IP address of the OpsWorks instance, such as192.0.2.0.The public DNS name of the OpsWorks instance.The public IP address of the OpsWorks instance, such as192.0.2.0.For load-based or time-based instances, the type.The Availability Zone of the OpsWorks instance, such asus-east-2a.An array ofBlockDeviceMappingobjects that specify the instance's block devices.Whether to create an Amazon EBS-optimized instance.A list of Elastic IP addresses to associate with the instance.The instance host name.Whether to install operating system and package updates when the instance boots.A reference to a Instance resource.The instance type, such ast2.micro.An array that contains the instance's layer IDs.getOs()The instance's operating system, which must be set to one of the following.The instance root device type.The instance's Amazon EC2 key-pair name.The stack ID.The ID of the instance's subnet.The instance's tenancy option.The time-based scaling configuration for the instance.The instance's virtualization type,paravirtualorhvm.A list of OpsWorks volume IDs to associate with the instance.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAgentVersion(String value) The default OpsWorks Stacks agent version.voidA custom AMI ID to be used to create the instance.voidsetArchitecture(String value) The instance architecture.voidsetAutoScalingType(String value) For load-based or time-based instances, the type.voidsetAvailabilityZone(String value) The Availability Zone of the OpsWorks instance, such asus-east-2a.voidsetBlockDeviceMappings(List<Object> value) An array ofBlockDeviceMappingobjects that specify the instance's block devices.voidAn array ofBlockDeviceMappingobjects that specify the instance's block devices.voidsetEbsOptimized(Boolean value) Whether to create an Amazon EBS-optimized instance.voidsetEbsOptimized(IResolvable value) Whether to create an Amazon EBS-optimized instance.voidsetElasticIps(List<String> value) A list of Elastic IP addresses to associate with the instance.voidsetHostname(String value) The instance host name.voidsetInstallUpdatesOnBoot(Boolean value) Whether to install operating system and package updates when the instance boots.voidWhether to install operating system and package updates when the instance boots.voidsetInstanceType(String value) The instance type, such ast2.micro.voidsetLayerIds(List<String> value) An array that contains the instance's layer IDs.voidThe instance's operating system, which must be set to one of the following.voidsetRootDeviceType(String value) The instance root device type.voidsetSshKeyName(String value) The instance's Amazon EC2 key-pair name.voidsetStackId(String value) The stack ID.voidsetSubnetId(String value) The ID of the instance's subnet.voidsetTenancy(String value) The instance's tenancy option.voidThe time-based scaling configuration for the instance.voidThe time-based scaling configuration for the instance.voidsetVirtualizationType(String value) The instance's virtualization type,paravirtualorhvm.voidsetVolumes(List<String> value) A list of OpsWorks volume IDs to associate with the instance.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnInstance
protected CfnInstance(software.amazon.jsii.JsiiObjectRef objRef) -
CfnInstance
protected CfnInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnInstance
@Stability(Stable) public CfnInstance(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnInstanceProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrAvailabilityZone
The Availability Zone of the OpsWorks instance, such asus-east-2a. -
getAttrId
-
getAttrPrivateDnsName
The private DNS name of the OpsWorks instance. -
getAttrPrivateIp
The private IP address of the OpsWorks instance, such as192.0.2.0. -
getAttrPublicDnsName
The public DNS name of the OpsWorks instance. -
getAttrPublicIp
The public IP address of the OpsWorks instance, such as192.0.2.0.Use this attribute only when the OpsWorks instance is in an OpsWorks layer that auto-assigns public IP addresses.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getInstanceRef
A reference to a Instance resource.- Specified by:
getInstanceRefin interfaceIInstanceRef
-
getInstanceType
The instance type, such ast2.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. -
setInstanceType
The instance type, such ast2.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. -
getLayerIds
An array that contains the instance's layer IDs. -
setLayerIds
An array that contains the instance's layer IDs. -
getStackId
The stack ID. -
setStackId
The stack ID. -
getAgentVersion
The default OpsWorks Stacks agent version.You have the following options:.
-
setAgentVersion
The default OpsWorks Stacks agent version.You have the following options:.
-
getAmiId
A custom AMI ID to be used to create the instance. -
setAmiId
A custom AMI ID to be used to create the instance. -
getArchitecture
The instance architecture. -
setArchitecture
The instance architecture. -
getAutoScalingType
For load-based or time-based instances, the type. -
setAutoScalingType
For load-based or time-based instances, the type. -
getAvailabilityZone
The Availability Zone of the OpsWorks instance, such asus-east-2a. -
setAvailabilityZone
The Availability Zone of the OpsWorks instance, such asus-east-2a. -
getBlockDeviceMappings
An array ofBlockDeviceMappingobjects that specify the instance's block devices.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnInstance.BlockDeviceMappingProperty> -
setBlockDeviceMappings
An array ofBlockDeviceMappingobjects that specify the instance's block devices. -
setBlockDeviceMappings
An array ofBlockDeviceMappingobjects that specify the instance's block devices. -
getEbsOptimized
Whether to create an Amazon EBS-optimized instance.Returns union: either
BooleanorIResolvable -
setEbsOptimized
Whether to create an Amazon EBS-optimized instance. -
setEbsOptimized
Whether to create an Amazon EBS-optimized instance. -
getElasticIps
A list of Elastic IP addresses to associate with the instance. -
setElasticIps
A list of Elastic IP addresses to associate with the instance. -
getHostname
The instance host name.The following are character limits for instance host names.
-
setHostname
The instance host name.The following are character limits for instance host names.
-
getInstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots.Returns union: either
BooleanorIResolvable -
setInstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots. -
setInstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots. -
getOs
The instance's operating system, which must be set to one of the following. -
setOs
The instance's operating system, which must be set to one of the following. -
getRootDeviceType
The instance root device type. -
setRootDeviceType
The instance root device type. -
getSshKeyName
The instance's Amazon EC2 key-pair name. -
setSshKeyName
The instance's Amazon EC2 key-pair name. -
getSubnetId
The ID of the instance's subnet. -
setSubnetId
The ID of the instance's subnet. -
getTenancy
The instance's tenancy option. -
setTenancy
The instance's tenancy option. -
getTimeBasedAutoScaling
The time-based scaling configuration for the instance.Returns union: either
IResolvableorCfnInstance.TimeBasedAutoScalingProperty -
setTimeBasedAutoScaling
The time-based scaling configuration for the instance. -
setTimeBasedAutoScaling
@Stability(Stable) public void setTimeBasedAutoScaling(@Nullable CfnInstance.TimeBasedAutoScalingProperty value) The time-based scaling configuration for the instance. -
getVirtualizationType
The instance's virtualization type,paravirtualorhvm. -
setVirtualizationType
The instance's virtualization type,paravirtualorhvm. -
getVolumes
A list of OpsWorks volume IDs to associate with the instance. -
setVolumes
A list of OpsWorks volume IDs to associate with the instance.
-