Class LookupMachineImage
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.LookupMachineImage
- All Implemented Interfaces:
IMachineImage
,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
NatInstanceImage
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:39.453Z")
@Stability(Stable)
public class LookupMachineImage
extends software.amazon.jsii.JsiiObject
implements IMachineImage
A machine image whose AMI ID will be searched using DescribeImages.
The most recent, available, launchable image matching the given filter criteria will be used. Looking up AMIs may take a long time; specify as many filter criteria as possible to narrow down the search.
The AMI selected will be cached in cdk.context.json
and the same value
will be used on future runs. To refresh the AMI lookup, you will have to
evict the value from the cache using the cdk context
command. See
https://docs.aws.amazon.com/cdk/latest/guide/context.html for more information.
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.ec2.*; UserData userData; LookupMachineImage lookupMachineImage = LookupMachineImage.Builder.create() .name("name") // the properties below are optional .filters(Map.of( "filtersKey", List.of("filters"))) .owners(List.of("owners")) .userData(userData) .windows(false) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IMachineImage
IMachineImage.Jsii$Default, IMachineImage.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
LookupMachineImage
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
LookupMachineImage
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionReturn the image to use in the given context.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
LookupMachineImage
protected LookupMachineImage(software.amazon.jsii.JsiiObjectRef objRef) -
LookupMachineImage
protected LookupMachineImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
LookupMachineImage
- Parameters:
props
- This parameter is required.
-
-
Method Details
-
getImage
Return the image to use in the given context.- Specified by:
getImage
in interfaceIMachineImage
- Parameters:
scope
- This parameter is required.
-