ContainerRecipeArgs

data class ContainerRecipeArgs(val components: Output<List<ContainerRecipeComponentArgs>>? = null, val containerType: Output<String>? = null, val description: Output<String>? = null, val dockerfileTemplateData: Output<String>? = null, val dockerfileTemplateUri: Output<String>? = null, val instanceConfiguration: Output<ContainerRecipeInstanceConfigurationArgs>? = null, val kmsKeyId: Output<String>? = null, val name: Output<String>? = null, val parentImage: Output<String>? = null, val platformOverride: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val targetRepository: Output<ContainerRecipeTargetRepositoryArgs>? = null, val version: Output<String>? = null, val workingDirectory: Output<String>? = null) : ConvertibleToJava<ContainerRecipeArgs>

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", {
name: "example",
version: "1.0.0",
containerType: "DOCKER",
parentImage: "arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x",
targetRepository: {
repositoryName: exampleAwsEcrRepository.name,
service: "ECR",
},
components: [{
componentArn: exampleAwsImagebuilderComponent.arn,
parameters: [
{
name: "Parameter1",
value: "Value1",
},
{
name: "Parameter2",
value: "Value2",
},
],
}],
dockerfileTemplateData: `FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
`,
});
import pulumi
import pulumi_aws as aws
example = aws.imagebuilder.ContainerRecipe("example",
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",
target_repository={
"repository_name": example_aws_ecr_repository["name"],
"service": "ECR",
},
components=[{
"component_arn": example_aws_imagebuilder_component["arn"],
"parameters": [
{
"name": "Parameter1",
"value": "Value1",
},
{
"name": "Parameter2",
"value": "Value2",
},
],
}],
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()
{
Name = "example",
Version = "1.0.0",
ContainerType = "DOCKER",
ParentImage = "arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x",
TargetRepository = new Aws.ImageBuilder.Inputs.ContainerRecipeTargetRepositoryArgs
{
RepositoryName = exampleAwsEcrRepository.Name,
Service = "ECR",
},
Components = new[]
{
new Aws.ImageBuilder.Inputs.ContainerRecipeComponentArgs
{
ComponentArn = exampleAwsImagebuilderComponent.Arn,
Parameters = new[]
{
new Aws.ImageBuilder.Inputs.ContainerRecipeComponentParameterArgs
{
Name = "Parameter1",
Value = "Value1",
},
new Aws.ImageBuilder.Inputs.ContainerRecipeComponentParameterArgs
{
Name = "Parameter2",
Value = "Value2",
},
},
},
},
DockerfileTemplateData = @"FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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{
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"),
TargetRepository: &imagebuilder.ContainerRecipeTargetRepositoryArgs{
RepositoryName: pulumi.Any(exampleAwsEcrRepository.Name),
Service: pulumi.String("ECR"),
},
Components: imagebuilder.ContainerRecipeComponentArray{
&imagebuilder.ContainerRecipeComponentArgs{
ComponentArn: pulumi.Any(exampleAwsImagebuilderComponent.Arn),
Parameters: imagebuilder.ContainerRecipeComponentParameterArray{
&imagebuilder.ContainerRecipeComponentParameterArgs{
Name: pulumi.String("Parameter1"),
Value: pulumi.String("Value1"),
},
&imagebuilder.ContainerRecipeComponentParameterArgs{
Name: pulumi.String("Parameter2"),
Value: pulumi.String("Value2"),
},
},
},
},
DockerfileTemplateData: pulumi.String("FROM {{{ imagebuilder:parentImage }}}\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\n"),
})
if err != nil {
return err
}
return nil
})
}
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 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) {
var example = new ContainerRecipe("example", ContainerRecipeArgs.builder()
.name("example")
.version("1.0.0")
.containerType("DOCKER")
.parentImage("arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x")
.targetRepository(ContainerRecipeTargetRepositoryArgs.builder()
.repositoryName(exampleAwsEcrRepository.name())
.service("ECR")
.build())
.components(ContainerRecipeComponentArgs.builder()
.componentArn(exampleAwsImagebuilderComponent.arn())
.parameters(
ContainerRecipeComponentParameterArgs.builder()
.name("Parameter1")
.value("Value1")
.build(),
ContainerRecipeComponentParameterArgs.builder()
.name("Parameter2")
.value("Value2")
.build())
.build())
.dockerfileTemplateData("""
FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}
""")
.build());
}
}
resources:
example:
type: aws:imagebuilder:ContainerRecipe
properties:
name: example
version: 1.0.0
containerType: DOCKER
parentImage: arn:aws:imagebuilder:eu-central-1:aws:image/amazon-linux-x86-latest/x.x.x
targetRepository:
repositoryName: ${exampleAwsEcrRepository.name}
service: ECR
components:
- componentArn: ${exampleAwsImagebuilderComponent.arn}
parameters:
- name: Parameter1
value: Value1
- name: Parameter2
value: Value2
dockerfileTemplateData: |
FROM {{{ imagebuilder:parentImage }}}
{{{ imagebuilder:environments }}}
{{{ imagebuilder:components }}}

Import

Using pulumi import, import aws_imagebuilder_container_recipe resources using the Amazon Resource Name (ARN). For example:

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

Constructors

Link copied to clipboard
constructor(components: Output<List<ContainerRecipeComponentArgs>>? = null, containerType: Output<String>? = null, description: Output<String>? = null, dockerfileTemplateData: Output<String>? = null, dockerfileTemplateUri: Output<String>? = null, instanceConfiguration: Output<ContainerRecipeInstanceConfigurationArgs>? = null, kmsKeyId: Output<String>? = null, name: Output<String>? = null, parentImage: Output<String>? = null, platformOverride: Output<String>? = null, tags: Output<Map<String, String>>? = null, targetRepository: Output<ContainerRecipeTargetRepositoryArgs>? = null, version: Output<String>? = null, workingDirectory: Output<String>? = null)

Properties

Link copied to clipboard

Ordered configuration block(s) with components for the container recipe. Detailed below.

Link copied to clipboard
val containerType: Output<String>? = null

The type of the container to create. Valid values: DOCKER.

Link copied to clipboard
val description: Output<String>? = null

The description of the container recipe.

Link copied to clipboard
val dockerfileTemplateData: Output<String>? = null

The Dockerfile template used to build the image as an inline data blob.

Link copied to clipboard
val dockerfileTemplateUri: Output<String>? = null

The Amazon S3 URI for the Dockerfile that will be used to build the container image.

Link copied to clipboard

Configuration block used to configure an instance for building and testing container images. Detailed below.

Link copied to clipboard
val kmsKeyId: Output<String>? = null

The KMS key used to encrypt the container image.

Link copied to clipboard
val name: Output<String>? = null

The name of the container recipe.

Link copied to clipboard
val parentImage: Output<String>? = null

The base image for the container recipe.

Link copied to clipboard
val platformOverride: Output<String>? = null

Specifies the operating system platform when you use a custom base image.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags for the container recipe. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard

The destination repository for the container image. Detailed below.

Link copied to clipboard
val version: Output<String>? = null

Version of the container recipe. The following attributes are optional:

Link copied to clipboard
val workingDirectory: Output<String>? = null

The working directory to be used during build and test workflows.

Functions

Link copied to clipboard
open override fun toJava(): ContainerRecipeArgs