Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.ec2.kotlin
import com.pulumi.aws.ec2.AmiArgs.builder
import com.pulumi.aws.ec2.kotlin.inputs.AmiEbsBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.AmiEbsBlockDeviceArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.AmiEphemeralBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.AmiEphemeralBlockDeviceArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* The AMI resource allows the creation and management of a completely-custom
* *Amazon Machine Image* (AMI).
* If you just want to duplicate an existing AMI, possibly copying it to another
* region, it's better to use `aws.ec2.AmiCopy` instead.
* If you just want to share an existing AMI with another AWS account,
* it's better to use `aws.ec2.AmiLaunchPermission` instead.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* // Create an AMI that will start a machine whose root device is backed by
* // an EBS volume populated from a snapshot. We assume that such a snapshot
* // already exists with the id "snap-xxxxxxxx".
* const example = new aws.ec2.Ami("example", {
* name: "example",
* virtualizationType: "hvm",
* rootDeviceName: "/dev/xvda",
* imdsSupport: "v2.0",
* ebsBlockDevices: [{
* deviceName: "/dev/xvda",
* snapshotId: "snap-xxxxxxxx",
* volumeSize: 8,
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* # Create an AMI that will start a machine whose root device is backed by
* # an EBS volume populated from a snapshot. We assume that such a snapshot
* # already exists with the id "snap-xxxxxxxx".
* example = aws.ec2.Ami("example",
* name="example",
* virtualization_type="hvm",
* root_device_name="/dev/xvda",
* imds_support="v2.0",
* ebs_block_devices=[{
* "device_name": "/dev/xvda",
* "snapshot_id": "snap-xxxxxxxx",
* "volume_size": 8,
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* // Create an AMI that will start a machine whose root device is backed by
* // an EBS volume populated from a snapshot. We assume that such a snapshot
* // already exists with the id "snap-xxxxxxxx".
* var example = new Aws.Ec2.Ami("example", new()
* {
* Name = "example",
* VirtualizationType = "hvm",
* RootDeviceName = "/dev/xvda",
* ImdsSupport = "v2.0",
* EbsBlockDevices = new[]
* {
* new Aws.Ec2.Inputs.AmiEbsBlockDeviceArgs
* {
* DeviceName = "/dev/xvda",
* SnapshotId = "snap-xxxxxxxx",
* VolumeSize = 8,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // Create an AMI that will start a machine whose root device is backed by
* // an EBS volume populated from a snapshot. We assume that such a snapshot
* // already exists with the id "snap-xxxxxxxx".
* _, err := ec2.NewAmi(ctx, "example", &ec2.AmiArgs{
* Name: pulumi.String("example"),
* VirtualizationType: pulumi.String("hvm"),
* RootDeviceName: pulumi.String("/dev/xvda"),
* ImdsSupport: pulumi.String("v2.0"),
* EbsBlockDevices: ec2.AmiEbsBlockDeviceArray{
* &ec2.AmiEbsBlockDeviceArgs{
* DeviceName: pulumi.String("/dev/xvda"),
* SnapshotId: pulumi.String("snap-xxxxxxxx"),
* VolumeSize: pulumi.Int(8),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.ec2.Ami;
* import com.pulumi.aws.ec2.AmiArgs;
* import com.pulumi.aws.ec2.inputs.AmiEbsBlockDeviceArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* // Create an AMI that will start a machine whose root device is backed by
* // an EBS volume populated from a snapshot. We assume that such a snapshot
* // already exists with the id "snap-xxxxxxxx".
* var example = new Ami("example", AmiArgs.builder()
* .name("example")
* .virtualizationType("hvm")
* .rootDeviceName("/dev/xvda")
* .imdsSupport("v2.0")
* .ebsBlockDevices(AmiEbsBlockDeviceArgs.builder()
* .deviceName("/dev/xvda")
* .snapshotId("snap-xxxxxxxx")
* .volumeSize(8)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Create an AMI that will start a machine whose root device is backed by
* # an EBS volume populated from a snapshot. We assume that such a snapshot
* # already exists with the id "snap-xxxxxxxx".
* example:
* type: aws:ec2:Ami
* properties:
* name: example
* virtualizationType: hvm
* rootDeviceName: /dev/xvda
* imdsSupport: v2.0
* ebsBlockDevices:
* - deviceName: /dev/xvda
* snapshotId: snap-xxxxxxxx
* volumeSize: 8
* ```
*
* ## Import
* Using `pulumi import`, import `aws_ami` using the ID of the AMI. For example:
* ```sh
* $ pulumi import aws:ec2/ami:Ami example ami-12345678
* ```
* @property architecture Machine architecture for created instances. Defaults to "x86_64".
* @property bootMode Boot mode of the AMI. For more information, see [Boot modes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-boot.html) in the Amazon Elastic Compute Cloud User Guide.
* @property deprecationTime Date and time to deprecate the AMI. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute. Valid values: [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`)
* @property description Longer, human-readable description for the AMI.
* @property ebsBlockDevices Nested block describing an EBS block device that should be
* attached to created instances. The structure of this block is described below.
* @property enaSupport Whether enhanced networking with ENA is enabled. Defaults to `false`.
* @property ephemeralBlockDevices Nested block describing an ephemeral block device that
* should be attached to created instances. The structure of this block is described below.
* @property imageLocation
* @property imdsSupport If EC2 instances started from this image should require the use of the Instance Metadata Service V2 (IMDSv2), set this argument to `v2.0`. For more information, see [Configure instance metadata options for new instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration).
* @property kernelId
* @property name Region-unique name for the AMI.
* @property ramdiskId
* @property rootDeviceName Name of the root device (for example, `/dev/sda1`, or `/dev/xvda`).
* @property sriovNetSupport
* @property tags Map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
* @property tpmSupport If the image is configured for NitroTPM support, the value is `v2.0`. For more information, see [NitroTPM](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitrotpm.html) in the Amazon Elastic Compute Cloud User Guide.
* @property virtualizationType Keyword to choose what virtualization mode created instances
* will use. Can be either "paravirtual" (the default) or "hvm". The choice of virtualization type
* changes the set of further arguments that are required, as described below.
*/
public data class AmiArgs(
public val architecture: Output? = null,
public val bootMode: Output? = null,
public val deprecationTime: Output? = null,
public val description: Output? = null,
public val ebsBlockDevices: Output>? = null,
public val enaSupport: Output? = null,
public val ephemeralBlockDevices: Output>? = null,
public val imageLocation: Output? = null,
public val imdsSupport: Output? = null,
public val kernelId: Output? = null,
public val name: Output? = null,
public val ramdiskId: Output? = null,
public val rootDeviceName: Output? = null,
public val sriovNetSupport: Output? = null,
public val tags: Output