Class LookupMachineImage
A machine image whose AMI ID will be searched using DescribeImages.
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class LookupMachineImage : DeputyBase, IMachineImage
Syntax (vb)
Public Class LookupMachineImage
Inherits DeputyBase
Implements IMachineImage
Remarks
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.
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.EC2;
UserData userData;
var lookupMachineImage = new LookupMachineImage(new LookupMachineImageProps {
Name = "name",
// the properties below are optional
Filters = new Dictionary<string, string[]> {
{ "filtersKey", new [] { "filters" } }
},
Owners = new [] { "owners" },
UserData = userData,
Windows = false
});
Synopsis
Constructors
Lookup |
|
Lookup |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Lookup |
Used by jsii to construct an instance of this class from DeputyProps |
Methods
Get |
Return the image to use in the given context. |
Constructors
LookupMachineImage(ILookupMachineImageProps)
LookupMachineImage(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LookupMachineImage(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
LookupMachineImage(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LookupMachineImage(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
Methods
GetImage(Construct)
Return the image to use in the given context.
public virtual IMachineImageConfig GetImage(Construct scope)
Parameters
- scope Construct
Returns