Class CfnInstancePropsMixin
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.ec2.CfnInstancePropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-03-11T13:19:58.454Z")
@Stability(Stable)
public class CfnInstancePropsMixin
extends Mixin
implements software.constructs.IMixin
Specifies an EC2 instance.
If an Elastic IP address is attached to your instance, AWS CloudFormation reattaches the Elastic IP address after it updates the instance. For more information about updating stacks, see AWS CloudFormation Stacks Updates .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.ec2.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnInstancePropsMixin cfnInstancePropsMixin = CfnInstancePropsMixin.Builder.create(CfnInstanceMixinProps.builder()
.additionalInfo("additionalInfo")
.affinity("affinity")
.availabilityZone("availabilityZone")
.blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
.ebs(EbsProperty.builder()
.deleteOnTermination(false)
.encrypted(false)
.iops(123)
.kmsKeyId("kmsKeyId")
.snapshotId("snapshotId")
.volumeSize(123)
.volumeType("volumeType")
.build())
.noDevice(NoDeviceProperty.builder().build())
.virtualName("virtualName")
.build()))
.cpuOptions(CpuOptionsProperty.builder()
.coreCount(123)
.threadsPerCore(123)
.build())
.creditSpecification(CreditSpecificationProperty.builder()
.cpuCredits("cpuCredits")
.build())
.disableApiTermination(false)
.ebsOptimized(false)
.elasticGpuSpecifications(List.of(ElasticGpuSpecificationProperty.builder()
.type("type")
.build()))
.elasticInferenceAccelerators(List.of(ElasticInferenceAcceleratorProperty.builder()
.count(123)
.type("type")
.build()))
.enclaveOptions(EnclaveOptionsProperty.builder()
.enabled(false)
.build())
.hibernationOptions(HibernationOptionsProperty.builder()
.configured(false)
.build())
.hostId("hostId")
.hostResourceGroupArn("hostResourceGroupArn")
.iamInstanceProfile("iamInstanceProfile")
.imageId("imageId")
.instanceInitiatedShutdownBehavior("instanceInitiatedShutdownBehavior")
.instanceType("instanceType")
.ipv6AddressCount(123)
.ipv6Addresses(List.of(InstanceIpv6AddressProperty.builder()
.ipv6Address("ipv6Address")
.build()))
.kernelId("kernelId")
.keyName("keyName")
.launchTemplate(LaunchTemplateSpecificationProperty.builder()
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.version("version")
.build())
.licenseSpecifications(List.of(LicenseSpecificationProperty.builder()
.licenseConfigurationArn("licenseConfigurationArn")
.build()))
.metadataOptions(MetadataOptionsProperty.builder()
.httpEndpoint("httpEndpoint")
.httpProtocolIpv6("httpProtocolIpv6")
.httpPutResponseHopLimit(123)
.httpTokens("httpTokens")
.instanceMetadataTags("instanceMetadataTags")
.build())
.monitoring(false)
.networkInterfaces(List.of(NetworkInterfaceProperty.builder()
.associateCarrierIpAddress(false)
.associatePublicIpAddress(false)
.deleteOnTermination(false)
.description("description")
.deviceIndex("deviceIndex")
.enaSrdSpecification(EnaSrdSpecificationProperty.builder()
.enaSrdEnabled(false)
.enaSrdUdpSpecification(EnaSrdUdpSpecificationProperty.builder()
.enaSrdUdpEnabled(false)
.build())
.build())
.groupSet(List.of("groupSet"))
.ipv6AddressCount(123)
.ipv6Addresses(List.of(InstanceIpv6AddressProperty.builder()
.ipv6Address("ipv6Address")
.build()))
.networkInterfaceId("networkInterfaceId")
.privateIpAddress("privateIpAddress")
.privateIpAddresses(List.of(PrivateIpAddressSpecificationProperty.builder()
.primary(false)
.privateIpAddress("privateIpAddress")
.build()))
.secondaryPrivateIpAddressCount(123)
.subnetId("subnetId")
.build()))
.placementGroupName("placementGroupName")
.privateDnsNameOptions(PrivateDnsNameOptionsProperty.builder()
.enableResourceNameDnsAaaaRecord(false)
.enableResourceNameDnsARecord(false)
.hostnameType("hostnameType")
.build())
.privateIpAddress("privateIpAddress")
.propagateTagsToVolumeOnCreation(false)
.ramdiskId("ramdiskId")
.securityGroupIds(List.of("securityGroupIds"))
.securityGroups(List.of("securityGroups"))
.sourceDestCheck(false)
.ssmAssociations(List.of(SsmAssociationProperty.builder()
.associationParameters(List.of(AssociationParameterProperty.builder()
.key("key")
.value(List.of("value"))
.build()))
.documentName("documentName")
.build()))
.subnetId("subnetId")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.tenancy("tenancy")
.userData("userData")
.volumes(List.of(VolumeProperty.builder()
.device("device")
.volumeId("volumeId")
.build()))
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSpecifies input parameter values for an SSM document in AWS Systems Manager .static interfaceSpecifies a block device mapping for an instance.static final classA fluent builder forCfnInstancePropsMixin.static interfaceSpecifies the CPU options for the instance.static interfaceSpecifies the credit option for CPU usage of a T instance.static interfaceSpecifies a block device for an EBS volume.static interfacestatic interfacestatic interfaceENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances.static interfaceENA Express is compatible with both TCP and UDP transport protocols.static interfaceIndicates whether the instance is enabled for AWS Nitro Enclaves.static interfaceSpecifies the hibernation options for the instance.static interfaceSpecifies the IPv6 address for the instance.static interfaceSpecifies a launch template to use when launching an Amazon EC2 instance.static interfaceSpecifies the license configuration to use.static interfaceSpecifies the metadata options for the instance.static interfaceSpecifies a network interface that is to be attached to an instance.static interfaceExample:static interfaceThe type of hostnames to assign to instances in the subnet at launch.static interfaceSpecifies a secondary private IPv4 address for a network interface.static interfaceSpecifies the SSM document and parameter values in AWS Systems Manager to associate with an instance.static interfaceDescribes the current state of an instance.static interfaceSpecifies a volume to attach to an instance.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::EC2::Instance.CfnInstancePropsMixin(CfnInstanceMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::EC2::Instance.protectedCfnInstancePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnInstancePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnInstanceMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods 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, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnInstancePropsMixin
protected CfnInstancePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnInstancePropsMixin
protected CfnInstancePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnInstancePropsMixin
@Stability(Stable) public CfnInstancePropsMixin(@NotNull CfnInstanceMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::EC2::Instance.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnInstancePropsMixin
Create a mixin to apply properties toAWS::EC2::Instance.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-