AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

Repository

Provides a Public Elastic Container Registry Repository.

NOTE: This resource can only be used with us-east-1 region.

Example Usage

using System;
using System.Collections.Generic;
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

	private static string ReadFileBase64(string path) {
		return Convert.ToBase64String(Encoding.UTF8.GetBytes(File.ReadAllText(path)))
	}

return await Deployment.RunAsync(() => 
{
    var usEast1 = new Aws.Provider("usEast1", new()
    {
        Region = "us-east-1",
    });

    var foo = new Aws.EcrPublic.Repository("foo", new()
    {
        RepositoryName = "bar",
        CatalogData = new Aws.EcrPublic.Inputs.RepositoryCatalogDataArgs
        {
            AboutText = "About Text",
            Architectures = new[]
            {
                "ARM",
            },
            Description = "Description",
            LogoImageBlob = ReadFileBase64(image.Png),
            OperatingSystems = new[]
            {
                "Linux",
            },
            UsageText = "Usage Text",
        },
        Tags = 
        {
            { "env", "production" },
        },
    }, new CustomResourceOptions
    {
        Provider = aws.Us_east_1,
    });

});
package main

import (
	"encoding/base64"
	"io/ioutil"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecrpublic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func filebase64OrPanic(path string) pulumi.StringPtrInput {
	if fileData, err := ioutil.ReadFile(path); err == nil {
		return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
	} else {
		panic(err.Error())
	}
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aws.NewProvider(ctx, "usEast1", &aws.ProviderArgs{
			Region: pulumi.String("us-east-1"),
		})
		if err != nil {
			return err
		}
		_, err = ecrpublic.NewRepository(ctx, "foo", &ecrpublic.RepositoryArgs{
			RepositoryName: pulumi.String("bar"),
			CatalogData: &ecrpublic.RepositoryCatalogDataArgs{
				AboutText: pulumi.String("About Text"),
				Architectures: pulumi.StringArray{
					pulumi.String("ARM"),
				},
				Description:   pulumi.String("Description"),
				LogoImageBlob: filebase64OrPanic(image.Png),
				OperatingSystems: pulumi.StringArray{
					pulumi.String("Linux"),
				},
				UsageText: pulumi.String("Usage Text"),
			},
			Tags: pulumi.StringMap{
				"env": pulumi.String("production"),
			},
		}, pulumi.Provider(aws.Us_east_1))
		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.Provider;
import com.pulumi.aws.ProviderArgs;
import com.pulumi.aws.ecrpublic.Repository;
import com.pulumi.aws.ecrpublic.RepositoryArgs;
import com.pulumi.aws.ecrpublic.inputs.RepositoryCatalogDataArgs;
import com.pulumi.resources.CustomResourceOptions;
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 usEast1 = new Provider("usEast1", ProviderArgs.builder()        
            .region("us-east-1")
            .build());

        var foo = new Repository("foo", RepositoryArgs.builder()        
            .repositoryName("bar")
            .catalogData(RepositoryCatalogDataArgs.builder()
                .aboutText("About Text")
                .architectures("ARM")
                .description("Description")
                .logoImageBlob(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get(image.png()))))
                .operatingSystems("Linux")
                .usageText("Usage Text")
                .build())
            .tags(Map.of("env", "production"))
            .build(), CustomResourceOptions.builder()
                .provider(aws.us_east_1())
                .build());

    }
}
import pulumi
import base64
import pulumi_aws as aws

us_east1 = aws.Provider("usEast1", region="us-east-1")
foo = aws.ecrpublic.Repository("foo",
    repository_name="bar",
    catalog_data=aws.ecrpublic.RepositoryCatalogDataArgs(
        about_text="About Text",
        architectures=["ARM"],
        description="Description",
        logo_image_blob=(lambda path: base64.b64encode(open(path).read().encode()).decode())(image["png"]),
        operating_systems=["Linux"],
        usage_text="Usage Text",
    ),
    tags={
        "env": "production",
    },
    opts=pulumi.ResourceOptions(provider=aws["us_east_1"]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";

const usEast1 = new aws.Provider("usEast1", {region: "us-east-1"});
const foo = new aws.ecrpublic.Repository("foo", {
    repositoryName: "bar",
    catalogData: {
        aboutText: "About Text",
        architectures: ["ARM"],
        description: "Description",
        logoImageBlob: Buffer.from(fs.readFileSync(image.png), 'binary').toString('base64'),
        operatingSystems: ["Linux"],
        usageText: "Usage Text",
    },
    tags: {
        env: "production",
    },
}, {
    provider: aws.us_east_1,
});

Coming soon!

Create a Repository Resource

new Repository(name: string, args: RepositoryArgs, opts?: CustomResourceOptions);
@overload
def Repository(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               catalog_data: Optional[RepositoryCatalogDataArgs] = None,
               force_destroy: Optional[bool] = None,
               repository_name: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
@overload
def Repository(resource_name: str,
               args: RepositoryArgs,
               opts: Optional[ResourceOptions] = None)
func NewRepository(ctx *Context, name string, args RepositoryArgs, opts ...ResourceOption) (*Repository, error)
public Repository(string name, RepositoryArgs args, CustomResourceOptions? opts = null)
public Repository(String name, RepositoryArgs args)
public Repository(String name, RepositoryArgs args, CustomResourceOptions options)
type: aws:ecrpublic:Repository
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args RepositoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RepositoryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RepositoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RepositoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args RepositoryArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Repository Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Repository resource accepts the following input properties:

RepositoryName string

Name of the repository.

CatalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

ForceDestroy bool
Tags Dictionary<string, string>
RepositoryName string

Name of the repository.

CatalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

ForceDestroy bool
Tags map[string]string
repositoryName String

Name of the repository.

catalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

forceDestroy Boolean
tags Map<String,String>
repositoryName string

Name of the repository.

catalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

forceDestroy boolean
tags {[key: string]: string}
repository_name str

Name of the repository.

catalog_data RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

force_destroy bool
tags Mapping[str, str]
repositoryName String

Name of the repository.

catalogData Property Map

Catalog data configuration for the repository. See below for schema.

forceDestroy Boolean
tags Map<String>

Outputs

All input properties are implicitly available as output properties. Additionally, the Repository resource produces the following output properties:

Arn string

Full ARN of the repository.

Id string

The provider-assigned unique ID for this managed resource.

RegistryId string

The registry ID where the repository was created.

RepositoryUri string

The URI of the repository.

TagsAll Dictionary<string, string>
Arn string

Full ARN of the repository.

Id string

The provider-assigned unique ID for this managed resource.

RegistryId string

The registry ID where the repository was created.

RepositoryUri string

The URI of the repository.

TagsAll map[string]string
arn String

Full ARN of the repository.

id String

The provider-assigned unique ID for this managed resource.

registryId String

The registry ID where the repository was created.

repositoryUri String

The URI of the repository.

tagsAll Map<String,String>
arn string

Full ARN of the repository.

id string

The provider-assigned unique ID for this managed resource.

registryId string

The registry ID where the repository was created.

repositoryUri string

The URI of the repository.

tagsAll {[key: string]: string}
arn str

Full ARN of the repository.

id str

The provider-assigned unique ID for this managed resource.

registry_id str

The registry ID where the repository was created.

repository_uri str

The URI of the repository.

tags_all Mapping[str, str]
arn String

Full ARN of the repository.

id String

The provider-assigned unique ID for this managed resource.

registryId String

The registry ID where the repository was created.

repositoryUri String

The URI of the repository.

tagsAll Map<String>

Look up an Existing Repository Resource

Get an existing Repository resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RepositoryState, opts?: CustomResourceOptions): Repository
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        catalog_data: Optional[RepositoryCatalogDataArgs] = None,
        force_destroy: Optional[bool] = None,
        registry_id: Optional[str] = None,
        repository_name: Optional[str] = None,
        repository_uri: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> Repository
func GetRepository(ctx *Context, name string, id IDInput, state *RepositoryState, opts ...ResourceOption) (*Repository, error)
public static Repository Get(string name, Input<string> id, RepositoryState? state, CustomResourceOptions? opts = null)
public static Repository get(String name, Output<String> id, RepositoryState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

Full ARN of the repository.

CatalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

ForceDestroy bool
RegistryId string

The registry ID where the repository was created.

RepositoryName string

Name of the repository.

RepositoryUri string

The URI of the repository.

Tags Dictionary<string, string>
TagsAll Dictionary<string, string>
Arn string

Full ARN of the repository.

CatalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

ForceDestroy bool
RegistryId string

The registry ID where the repository was created.

RepositoryName string

Name of the repository.

RepositoryUri string

The URI of the repository.

Tags map[string]string
TagsAll map[string]string
arn String

Full ARN of the repository.

catalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

forceDestroy Boolean
registryId String

The registry ID where the repository was created.

repositoryName String

Name of the repository.

repositoryUri String

The URI of the repository.

tags Map<String,String>
tagsAll Map<String,String>
arn string

Full ARN of the repository.

catalogData RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

forceDestroy boolean
registryId string

The registry ID where the repository was created.

repositoryName string

Name of the repository.

repositoryUri string

The URI of the repository.

tags {[key: string]: string}
tagsAll {[key: string]: string}
arn str

Full ARN of the repository.

catalog_data RepositoryCatalogDataArgs

Catalog data configuration for the repository. See below for schema.

force_destroy bool
registry_id str

The registry ID where the repository was created.

repository_name str

Name of the repository.

repository_uri str

The URI of the repository.

tags Mapping[str, str]
tags_all Mapping[str, str]
arn String

Full ARN of the repository.

catalogData Property Map

Catalog data configuration for the repository. See below for schema.

forceDestroy Boolean
registryId String

The registry ID where the repository was created.

repositoryName String

Name of the repository.

repositoryUri String

The URI of the repository.

tags Map<String>
tagsAll Map<String>

Supporting Types

RepositoryCatalogData

AboutText string

A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.

Architectures List<string>

The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters: ARM, ARM 64, x86, x86-64

Description string

A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.

LogoImageBlob string

The base64-encoded repository logo payload. (Only visible for verified accounts) Note that drift detection is disabled for this attribute.

OperatingSystems List<string>

The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters: Linux, Windows

UsageText string

Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.

AboutText string

A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.

Architectures []string

The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters: ARM, ARM 64, x86, x86-64

Description string

A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.

LogoImageBlob string

The base64-encoded repository logo payload. (Only visible for verified accounts) Note that drift detection is disabled for this attribute.

OperatingSystems []string

The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters: Linux, Windows

UsageText string

Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.

aboutText String

A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.

architectures List<String>

The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters: ARM, ARM 64, x86, x86-64

description String

A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.

logoImageBlob String

The base64-encoded repository logo payload. (Only visible for verified accounts) Note that drift detection is disabled for this attribute.

operatingSystems List<String>

The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters: Linux, Windows

usageText String

Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.

aboutText string

A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.

architectures string[]

The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters: ARM, ARM 64, x86, x86-64

description string

A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.

logoImageBlob string

The base64-encoded repository logo payload. (Only visible for verified accounts) Note that drift detection is disabled for this attribute.

operatingSystems string[]

The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters: Linux, Windows

usageText string

Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.

about_text str

A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.

architectures Sequence[str]

The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters: ARM, ARM 64, x86, x86-64

description str

A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.

logo_image_blob str

The base64-encoded repository logo payload. (Only visible for verified accounts) Note that drift detection is disabled for this attribute.

operating_systems Sequence[str]

The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters: Linux, Windows

usage_text str

Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.

aboutText String

A detailed description of the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The text must be in markdown format.

architectures List<String>

The system architecture that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported architectures will appear as badges on the repository and are used as search filters: ARM, ARM 64, x86, x86-64

description String

A short description of the contents of the repository. This text appears in both the image details and also when searching for repositories on the Amazon ECR Public Gallery.

logoImageBlob String

The base64-encoded repository logo payload. (Only visible for verified accounts) Note that drift detection is disabled for this attribute.

operatingSystems List<String>

The operating systems that the images in the repository are compatible with. On the Amazon ECR Public Gallery, the following supported operating systems will appear as badges on the repository and are used as search filters: Linux, Windows

usageText String

Detailed information on how to use the contents of the repository. It is publicly visible in the Amazon ECR Public Gallery. The usage text provides context, support information, and additional usage details for users of the repository. The text must be in markdown format.

Import

ECR Public Repositories can be imported using the repository_name, e.g.,

 $ pulumi import aws:ecrpublic/repository:Repository example example

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.