ContainerRecipe class

Manages an Image Builder Container Recipe.

Example Usage

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

const example = new aws.imagebuilder.ContainerRecipe("example", {
    targetRepository: {
        repositoryName: exampleAwsEcrRepository.name,
        service: "ECR",
    },
    components: [{
        parameters: [
            {
                name: "Parameter1",
                value: "Value1",
            },
            {
                name: "Parameter2",
                value: "Value2",
            },
        ],
        componentArn: exampleAwsImagebuilderComponent.arn,
    }],
    name: "example",
    version: "1.0.0",
    containerType: "DOCKER",
    parentImage: "arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x",
    dockerfileTemplateData: `FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
`,
});
import pulumi
import pulumi_aws as aws

example = aws.imagebuilder.ContainerRecipe("example",
    target_repository={
        "repository_name": example_aws_ecr_repository["name"],
        "service": "ECR",
    },
    components=[{
        "parameters": [
            {
                "name": "Parameter1",
                "value": "Value1",
            },
            {
                "name": "Parameter2",
                "value": "Value2",
            },
        ],
        "component_arn": example_aws_imagebuilder_component["arn"],
    }],
    name="example",
    version="1.0.0",
    container_type="DOCKER",
    parent_image="arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x",
    dockerfile_template_data="""FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
""")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.ImageBuilder.ContainerRecipe("example", new()
    {
        TargetRepository = new Aws.ImageBuilder.Inputs.ContainerRecipeTargetRepositoryArgs
        {
            RepositoryName = exampleAwsEcrRepository.Name,
            Service = "ECR",
        },
        Components = new[]
        {
            new Aws.ImageBuilder.Inputs.ContainerRecipeComponentArgs
            {
                Parameters = new[]
                {
                    new Aws.ImageBuilder.Inputs.ContainerRecipeComponentParameterArgs
                    {
                        Name = "Parameter1",
                        Value = "Value1",
                    },
                    new Aws.ImageBuilder.Inputs.ContainerRecipeComponentParameterArgs
                    {
                        Name = "Parameter2",
                        Value = "Value2",
                    },
                },
                ComponentArn = exampleAwsImagebuilderComponent.Arn,
            },
        },
        Name = "example",
        Version = "1.0.0",
        ContainerType = "DOCKER",
        ParentImage = "arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x",
        DockerfileTemplateData = @"FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
",
    });

});
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.NewContainerRecipe(ctx, "example", &imagebuilder.ContainerRecipeArgs{
			TargetRepository: &imagebuilder.ContainerRecipeTargetRepositoryArgs{
				RepositoryName: pulumi.Any(exampleAwsEcrRepository.Name),
				Service:        pulumi.String("ECR"),
			},
			Components: imagebuilder.ContainerRecipeComponentArray{
				&imagebuilder.ContainerRecipeComponentArgs{
					Parameters: imagebuilder.ContainerRecipeComponentParameterArray{
						&imagebuilder.ContainerRecipeComponentParameterArgs{
							Name:  pulumi.String("Parameter1"),
							Value: pulumi.String("Value1"),
						},
						&imagebuilder.ContainerRecipeComponentParameterArgs{
							Name:  pulumi.String("Parameter2"),
							Value: pulumi.String("Value2"),
						},
					},
					ComponentArn: pulumi.Any(exampleAwsImagebuilderComponent.Arn),
				},
			},
			Name:                   pulumi.String("example"),
			Version:                pulumi.String("1.0.0"),
			ContainerType:          pulumi.String("DOCKER"),
			ParentImage:            pulumi.String("arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x"),
			DockerfileTemplateData: pulumi.String("FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\n"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_imagebuilder_containerrecipe" "example" {
  target_repository = {
    repository_name = exampleAwsEcrRepository.name
    service         = "ECR"
  }
  components {
    parameters {
      name  = "Parameter1"
      value = "Value1"
    }
    parameters {
      name  = "Parameter2"
      value = "Value2"
    }
    component_arn = exampleAwsImagebuilderComponent.arn
  }
  name                     = "example"
  version                  = "1.0.0"
  container_type           = "DOCKER"
  parent_image             = "arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x"
  dockerfile_template_data = "FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\n"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.imagebuilder.ContainerRecipe;
import com.pulumi.aws.imagebuilder.ContainerRecipeArgs;
import com.pulumi.aws.imagebuilder.inputs.ContainerRecipeTargetRepositoryArgs;
import com.pulumi.aws.imagebuilder.inputs.ContainerRecipeComponentArgs;
import com.pulumi.aws.imagebuilder.inputs.ContainerRecipeComponentParameterArgs;
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 ContainerRecipe("example", ContainerRecipeArgs.builder()
            .targetRepository(ContainerRecipeTargetRepositoryArgs.builder()
                .repositoryName(exampleAwsEcrRepository.name())
                .service("ECR")
                .build())
            .components(ContainerRecipeComponentArgs.builder()
                .parameters(
                    ContainerRecipeComponentParameterArgs.builder()
                        .name("Parameter1")
                        .value("Value1")
                        .build(),
                    ContainerRecipeComponentParameterArgs.builder()
                        .name("Parameter2")
                        .value("Value2")
                        .build())
                .componentArn(exampleAwsImagebuilderComponent.arn())
                .build())
            .name("example")
            .version("1.0.0")
            .containerType("DOCKER")
            .parentImage("arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x")
            .dockerfileTemplateData("""
FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
            """)
            .build());

    }
}
resources:
  example:
    type: aws:imagebuilder:ContainerRecipe
    properties:
      targetRepository:
        repositoryName: ${exampleAwsEcrRepository.name}
        service: ECR
      components:
        - parameters:
            - name: Parameter1
              value: Value1
            - name: Parameter2
              value: Value2
          componentArn: ${exampleAwsImagebuilderComponent.arn}
      name: example
      version: 1.0.0
      containerType: DOCKER
      parentImage: arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x
      dockerfileTemplateData: |
        FROM {{{ imagebuilder:parentImage }}}
        {{{ imagebuilder:environments }}}
        {{{ imagebuilder:components }}}

Import

Identity Schema

Required

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

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

$ pulumi import aws:imagebuilder/containerRecipe:ContainerRecipe example arn:aws:imagebuilder:us-east-1:123456789012:container-recipe/example/1.0.0

Constructors

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

Properties

arn ↔ Output<String>
(Required) ARN of the container recipe.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
components ↔ Output<List<ContainerRecipeComponent>>
Ordered configuration block(s) with components for the container recipe. Detailed below.
latefinal
containerType ↔ Output<String>
The type of the container to create. Valid values: DOCKER.
latefinal
dateCreated ↔ Output<String>
Date the container recipe was created.
latefinal
description ↔ Output<String?>
The description of the container recipe.
latefinal
dockerfileTemplateData ↔ Output<String>
The Dockerfile template used to build the image as an inline data blob.
latefinal
dockerfileTemplateUri ↔ Output<String?>
The Amazon S3 URI for the Dockerfile that will be used to build the container image.
latefinal
encrypted ↔ Output<bool>
A flag that indicates if the target container is encrypted.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
instanceConfiguration ↔ Output<ContainerRecipeInstanceConfiguration?>
Configuration block used to configure an instance for building and testing container images. Detailed below.
latefinal
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
kmsKeyId ↔ Output<String?>
The KMS key used to encrypt the container image.
latefinal
name ↔ Output<String>
The name of the container recipe.
latefinal
owner ↔ Output<String>
Owner of the container recipe.
latefinal
parentImage ↔ Output<String>
The base image for the container recipe.
latefinal
platform ↔ Output<String>
Platform of the container recipe.
latefinal
platformOverride ↔ Output<String?>
Specifies the operating system platform when you use a custom base image.
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
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags for the container 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
targetRepository ↔ Output<ContainerRecipeTargetRepository>
The destination repository for the container image. Detailed below.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
version ↔ Output<String>
Version of the container recipe.
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, {ContainerRecipeState? state, CustomResourceOptions? options}) → ContainerRecipe
Gets an existing ContainerRecipe resource's state with the given name and id.