ImageRecipe class

Manages an Image Builder Image Recipe.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.imagebuilder.ImageRecipe("example", {
    blockDeviceMappings: [{
        ebs: {
            deleteOnTermination: "true",
            volumeSize: 100,
            volumeType: "gp2",
        },
        deviceName: "/dev/xvdb",
    }],
    components: [{
        parameters: [
            {
                name: "Parameter1",
                value: "Value1",
            },
            {
                name: "Parameter2",
                value: "Value2",
            },
        ],
        componentArn: exampleAwsImagebuilderComponent.arn,
    }],
    name: "example",
    parentImage: `arn:${current.partition}:imagebuilder:${currentAwsRegion.region}:aws:image/amazon-linux-2-x86/x.x.x`,
    version: "1.0.0",
});
import pulumi
import pulumi_aws as aws

example = aws.imagebuilder.ImageRecipe("example",
    block_device_mappings=[{
        "ebs": {
            "delete_on_termination": "true",
            "volume_size": 100,
            "volume_type": "gp2",
        },
        "device_name": "/dev/xvdb",
    }],
    components=[{
        "parameters": [
            {
                "name": "Parameter1",
                "value": "Value1",
            },
            {
                "name": "Parameter2",
                "value": "Value2",
            },
        ],
        "component_arn": example_aws_imagebuilder_component["arn"],
    }],
    name="example",
    parent_image=f"arn:{current['partition']}:imagebuilder:{current_aws_region['region']}:aws:image/amazon-linux-2-x86/x.x.x",
    version="1.0.0")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.ImageBuilder.ImageRecipe("example", new()
    {
        BlockDeviceMappings = new[]
        {
            new Aws.ImageBuilder.Inputs.ImageRecipeBlockDeviceMappingArgs
            {
                Ebs = new Aws.ImageBuilder.Inputs.ImageRecipeBlockDeviceMappingEbsArgs
                {
                    DeleteOnTermination = "true",
                    VolumeSize = 100,
                    VolumeType = "gp2",
                },
                DeviceName = "/dev/xvdb",
            },
        },
        Components = new[]
        {
            new Aws.ImageBuilder.Inputs.ImageRecipeComponentArgs
            {
                Parameters = new[]
                {
                    new Aws.ImageBuilder.Inputs.ImageRecipeComponentParameterArgs
                    {
                        Name = "Parameter1",
                        Value = "Value1",
                    },
                    new Aws.ImageBuilder.Inputs.ImageRecipeComponentParameterArgs
                    {
                        Name = "Parameter2",
                        Value = "Value2",
                    },
                },
                ComponentArn = exampleAwsImagebuilderComponent.Arn,
            },
        },
        Name = "example",
        ParentImage = $"arn:{current.Partition}:imagebuilder:{currentAwsRegion.Region}:aws:image/amazon-linux-2-x86/x.x.x",
        Version = "1.0.0",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/imagebuilder"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := imagebuilder.NewImageRecipe(ctx, "example", &imagebuilder.ImageRecipeArgs{
			BlockDeviceMappings: imagebuilder.ImageRecipeBlockDeviceMappingArray{
				&imagebuilder.ImageRecipeBlockDeviceMappingArgs{
					Ebs: &imagebuilder.ImageRecipeBlockDeviceMappingEbsArgs{
						DeleteOnTermination: pulumi.String("true"),
						VolumeSize:          pulumi.Int(100),
						VolumeType:          pulumi.String("gp2"),
					},
					DeviceName: pulumi.String("/dev/xvdb"),
				},
			},
			Components: imagebuilder.ImageRecipeComponentArray{
				&imagebuilder.ImageRecipeComponentArgs{
					Parameters: imagebuilder.ImageRecipeComponentParameterArray{
						&imagebuilder.ImageRecipeComponentParameterArgs{
							Name:  pulumi.String("Parameter1"),
							Value: pulumi.String("Value1"),
						},
						&imagebuilder.ImageRecipeComponentParameterArgs{
							Name:  pulumi.String("Parameter2"),
							Value: pulumi.String("Value2"),
						},
					},
					ComponentArn: pulumi.Any(exampleAwsImagebuilderComponent.Arn),
				},
			},
			Name:        pulumi.String("example"),
			ParentImage: pulumi.Sprintf("arn:%v:imagebuilder:%v:aws:image/amazon-linux-2-x86/x.x.x", current.Partition, currentAwsRegion.Region),
			Version:     pulumi.String("1.0.0"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_imagebuilder_imagerecipe" "example" {
  block_device_mappings {
    ebs = {
      delete_on_termination = true
      volume_size           = 100
      volume_type           = "gp2"
    }
    device_name = "/dev/xvdb"
  }
  components {
    parameters {
      name  = "Parameter1"
      value = "Value1"
    }
    parameters {
      name  = "Parameter2"
      value = "Value2"
    }
    component_arn = exampleAwsImagebuilderComponent.arn
  }
  name         = "example"
  parent_image ="arn:${current.partition}:imagebuilder:${currentAwsRegion.region}:aws:image/amazon-linux-2-x86/x.x.x"
  version      = "1.0.0"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.imagebuilder.ImageRecipe;
import com.pulumi.aws.imagebuilder.ImageRecipeArgs;
import com.pulumi.aws.imagebuilder.inputs.ImageRecipeBlockDeviceMappingArgs;
import com.pulumi.aws.imagebuilder.inputs.ImageRecipeBlockDeviceMappingEbsArgs;
import com.pulumi.aws.imagebuilder.inputs.ImageRecipeComponentArgs;
import com.pulumi.aws.imagebuilder.inputs.ImageRecipeComponentParameterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var example = new ImageRecipe("example", ImageRecipeArgs.builder()
            .blockDeviceMappings(ImageRecipeBlockDeviceMappingArgs.builder()
                .ebs(ImageRecipeBlockDeviceMappingEbsArgs.builder()
                    .deleteOnTermination("true")
                    .volumeSize(100)
                    .volumeType("gp2")
                    .build())
                .deviceName("/dev/xvdb")
                .build())
            .components(ImageRecipeComponentArgs.builder()
                .parameters(
                    ImageRecipeComponentParameterArgs.builder()
                        .name("Parameter1")
                        .value("Value1")
                        .build(),
                    ImageRecipeComponentParameterArgs.builder()
                        .name("Parameter2")
                        .value("Value2")
                        .build())
                .componentArn(exampleAwsImagebuilderComponent.arn())
                .build())
            .name("example")
            .parentImage(String.format("arn:%s:imagebuilder:%s:aws:image/amazon-linux-2-x86/x.x.x", current.partition(),currentAwsRegion.region()))
            .version("1.0.0")
            .build());

    }
}
resources:
  example:
    type: aws:imagebuilder:ImageRecipe
    properties:
      blockDeviceMappings:
        - ebs:
            deleteOnTermination: true
            volumeSize: 100
            volumeType: gp2
          deviceName: /dev/xvdb
      components:
        - parameters:
            - name: Parameter1
              value: Value1
            - name: Parameter2
              value: Value2
          componentArn: ${exampleAwsImagebuilderComponent.arn}
      name: example
      parentImage: arn:${current.partition}:imagebuilder:${currentAwsRegion.region}:aws:image/amazon-linux-2-x86/x.x.x
      version: 1.0.0

Import

Identity Schema

Required

  • arn (String) ARN of the Image Builder image recipe.

Using pulumi import, import aws.imagebuilder.ImageRecipe resources using the ARN. For example:

$ pulumi import aws:imagebuilder/imageRecipe:ImageRecipe example arn:aws:imagebuilder:us-east-1:123456789012:image-recipe/example/1.0.0

Constructors

ImageRecipe(String name, {ImageRecipeArgs? args, CustomResourceOptions? options})
Creates a new ImageRecipe. name The Pulumi resource name. args Arguments used to configure this ImageRecipe. The set of arguments for ImageRecipe. options Resource options controlling this resource's behavior.
ImageRecipe.reference(String urn)
Creates a typed reference to an existing ImageRecipe resource.

Properties

amiTags ↔ Output<Map<String, String>?>
Tags that are applied to the AMI that Image Builder creates during the Build phase prior to image distribution. Maximum of 50 tags.
latefinal
arn ↔ Output<String>
ARN of the image recipe.
latefinal
blockDeviceMappings ↔ Output<List<ImageRecipeBlockDeviceMapping>?>
Configuration block(s) with block device mappings for the image recipe. Detailed below.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
components ↔ Output<List<ImageRecipeComponent>>
Ordered configuration block(s) with components for the image recipe. Detailed below.
latefinal
dateCreated ↔ Output<String>
Date the image recipe was created.
latefinal
description ↔ Output<String?>
Description of the image recipe.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
Name of the image recipe.
latefinal
owner ↔ Output<String>
Owner of the image recipe.
latefinal
parentImage ↔ Output<String>
The image recipe uses this image as a base from which to build your customized image. The value can be the base image ARN, an AMI ID, or an SSM Parameter referencing the AMI. For an SSM Parameter, enter the prefix ssm:, followed by the parameter name or ARN.
latefinal
platform ↔ Output<String>
Platform of the image recipe.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
systemsManagerAgent ↔ Output<ImageRecipeSystemsManagerAgent>
Configuration block for the Systems Manager Agent installed by default by Image Builder. Detailed below.
latefinal
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags for the image recipe. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
userDataBase64 ↔ Output<String>
Base64 encoded user data. Use this to provide commands or a command script to run when you launch your build instance.
latefinal
version ↔ Output<String>
The semantic version of the image recipe, which specifies the version in the following format, with numeric values in each position to indicate a specific version: major.minor.patch. For example: 1.0.0.
latefinal
workingDirectory ↔ Output<String?>
The working directory to be used during build and test workflows.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ImageRecipeState? state, CustomResourceOptions? options}) → ImageRecipe
Gets an existing ImageRecipe resource's state with the given name and id.