import type * as ec2 from "@distilled.cloud/aws/ec2"; import type * as Effect from "effect/Effect"; import * as Binding from "../../Binding.ts"; import type { FindImageOptions } from "./Image.ts"; /** * The `DescribeImages`-backed AMI lookup (IAM action `ec2:DescribeImages`; * `Describe*` actions do not support resource-level permissions, so the * runtime grant is on `*`). Returns the newest available image matching the * filters, or `undefined` when nothing matches. * * As a **data source**, invoke it at plan time via {@link getAmi} — the * result is an `Output` resolved during plan/deploy and inert inside * deployed bundles. As a **runtime binding**, bind it inside a Function to * look images up at runtime with the IAM grant attached automatically. * Provide the implementation with * `Effect.provide(AWS.EC2.GetAmiHttp)` (already registered by * `AWS.providers()` for plan-time use). * ### Looking Up Images * **Example:** Plan-time lookup (data source) * ```typescript * const instance = yield* AWS.EC2.Instance("web", { * imageId: AWS.EC2.getAmi({ * owners: ["amazon"], * name: ["al2023-ami-2023.*"], * }).ImageId.as(), * instanceType: "t3.micro", * subnetId: subnet.subnetId, * }); * ``` * **Example:** Runtime lookup inside a Function * ```typescript * // init — bind the operation * const getAmi = yield* AWS.EC2.GetAmi({ * owners: ["amazon"], * name: ["al2023-ami-2023.*"], * }); * * // runtime — read the newest matching image * const latest = yield* getAmi(); * console.log(latest?.ImageId, latest?.CreationDate); * ``` * * @binding */ export interface GetAmi extends Binding.Service Effect.Effect<() => Effect.Effect>> { } export declare const GetAmi: GetAmi; /** * Plan-time AMI lookup — the data-source form of {@link GetAmi} (what * Terraform calls a data source and Pulumi an invoke). Returns an * `Output` resolved during plan/deploy; safe to call * from composition code that is re-executed inside a deployed runtime * bundle. Prefer {@link image} (or the distro presets) when you only need * the AMI ID and want a missing image to fail the plan. */ export declare const getAmi: (args_0: Effect.Effect | import("../../Input.ts").Input) => import("../../Output.ts").ObjectExpr<{ PlatformDetails?: string; UsageOperation?: string; BlockDeviceMappings?: ec2.BlockDeviceMapping[]; Description?: string; EnaSupport?: boolean; Hypervisor?: ec2.HypervisorType; ImageOwnerAlias?: string; Name?: string; RootDeviceName?: string; RootDeviceType?: ec2.DeviceType; SriovNetSupport?: string; StateReason?: ec2.StateReason; Tags?: ec2.Tag[]; VirtualizationType?: ec2.VirtualizationType; BootMode?: ec2.BootModeValues; TpmSupport?: ec2.TpmSupportValues; DeprecationTime?: string; ImdsSupport?: ec2.ImdsSupportValues; SourceInstanceId?: string; DeregistrationProtection?: string; LastLaunchedTime?: string; ImageAllowed?: boolean; SourceImageId?: string; SourceImageRegion?: string; FreeTierEligible?: boolean; ImageWatermarks?: ec2.ImageWatermark[]; ImageId?: string; ImageLocation?: string; State?: ec2.ImageState; OwnerId?: string; CreationDate?: string; Public?: boolean; ProductCodes?: ec2.ProductCode[]; Architecture?: ec2.ArchitectureValues; ImageType?: ec2.ImageTypeValues; KernelId?: string; RamdiskId?: string; Platform?: ec2.PlatformValues; } | undefined, Req | GetAmi>; //# sourceMappingURL=GetAmi.d.ts.map