1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. ContainerRegistry
DigitalOcean v4.42.0 published on Thursday, Apr 17, 2025 by Pulumi

digitalocean.ContainerRegistry

Explore with Pulumi AI

Provides a DigitalOcean Container Registry resource. A Container Registry is a secure, private location to store your containers for rapid deployment.

Example Usage

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

// Create a new container registry
const foobar = new digitalocean.ContainerRegistry("foobar", {
    name: "foobar",
    subscriptionTierSlug: "starter",
});
Copy
import pulumi
import pulumi_digitalocean as digitalocean

# Create a new container registry
foobar = digitalocean.ContainerRegistry("foobar",
    name="foobar",
    subscription_tier_slug="starter")
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new container registry
		_, err := digitalocean.NewContainerRegistry(ctx, "foobar", &digitalocean.ContainerRegistryArgs{
			Name:                 pulumi.String("foobar"),
			SubscriptionTierSlug: pulumi.String("starter"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    // Create a new container registry
    var foobar = new DigitalOcean.ContainerRegistry("foobar", new()
    {
        Name = "foobar",
        SubscriptionTierSlug = "starter",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.ContainerRegistry;
import com.pulumi.digitalocean.ContainerRegistryArgs;
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 a new container registry
        var foobar = new ContainerRegistry("foobar", ContainerRegistryArgs.builder()
            .name("foobar")
            .subscriptionTierSlug("starter")
            .build());

    }
}
Copy
resources:
  # Create a new container registry
  foobar:
    type: digitalocean:ContainerRegistry
    properties:
      name: foobar
      subscriptionTierSlug: starter
Copy

Create ContainerRegistry Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ContainerRegistry(name: string, args: ContainerRegistryArgs, opts?: CustomResourceOptions);
@overload
def ContainerRegistry(resource_name: str,
                      args: ContainerRegistryArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def ContainerRegistry(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      subscription_tier_slug: Optional[str] = None,
                      name: Optional[str] = None,
                      region: Optional[str] = None)
func NewContainerRegistry(ctx *Context, name string, args ContainerRegistryArgs, opts ...ResourceOption) (*ContainerRegistry, error)
public ContainerRegistry(string name, ContainerRegistryArgs args, CustomResourceOptions? opts = null)
public ContainerRegistry(String name, ContainerRegistryArgs args)
public ContainerRegistry(String name, ContainerRegistryArgs args, CustomResourceOptions options)
type: digitalocean:ContainerRegistry
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var containerRegistryResource = new DigitalOcean.ContainerRegistry("containerRegistryResource", new()
{
    SubscriptionTierSlug = "string",
    Name = "string",
    Region = "string",
});
Copy
example, err := digitalocean.NewContainerRegistry(ctx, "containerRegistryResource", &digitalocean.ContainerRegistryArgs{
	SubscriptionTierSlug: pulumi.String("string"),
	Name:                 pulumi.String("string"),
	Region:               pulumi.String("string"),
})
Copy
var containerRegistryResource = new ContainerRegistry("containerRegistryResource", ContainerRegistryArgs.builder()
    .subscriptionTierSlug("string")
    .name("string")
    .region("string")
    .build());
Copy
container_registry_resource = digitalocean.ContainerRegistry("containerRegistryResource",
    subscription_tier_slug="string",
    name="string",
    region="string")
Copy
const containerRegistryResource = new digitalocean.ContainerRegistry("containerRegistryResource", {
    subscriptionTierSlug: "string",
    name: "string",
    region: "string",
});
Copy
type: digitalocean:ContainerRegistry
properties:
    name: string
    region: string
    subscriptionTierSlug: string
Copy

ContainerRegistry Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ContainerRegistry resource accepts the following input properties:

SubscriptionTierSlug This property is required. string
The slug identifier for the subscription tier to use (starter, basic, or professional)
Name Changes to this property will trigger replacement. string
The name of the container_registry
Region Changes to this property will trigger replacement. string
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
SubscriptionTierSlug This property is required. string
The slug identifier for the subscription tier to use (starter, basic, or professional)
Name Changes to this property will trigger replacement. string
The name of the container_registry
Region Changes to this property will trigger replacement. string
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
subscriptionTierSlug This property is required. String
The slug identifier for the subscription tier to use (starter, basic, or professional)
name Changes to this property will trigger replacement. String
The name of the container_registry
region Changes to this property will trigger replacement. String
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
subscriptionTierSlug This property is required. string
The slug identifier for the subscription tier to use (starter, basic, or professional)
name Changes to this property will trigger replacement. string
The name of the container_registry
region Changes to this property will trigger replacement. string
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
subscription_tier_slug This property is required. str
The slug identifier for the subscription tier to use (starter, basic, or professional)
name Changes to this property will trigger replacement. str
The name of the container_registry
region Changes to this property will trigger replacement. str
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
subscriptionTierSlug This property is required. String
The slug identifier for the subscription tier to use (starter, basic, or professional)
name Changes to this property will trigger replacement. String
The name of the container_registry
region Changes to this property will trigger replacement. String
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.

Outputs

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

CreatedAt string
The date and time when the registry was created
Endpoint string
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
Id string
The provider-assigned unique ID for this managed resource.
ServerUrl string
The domain of the container registry. Ex: registry.digitalocean.com
StorageUsageBytes int
The amount of storage used in the registry in bytes.
CreatedAt string
The date and time when the registry was created
Endpoint string
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
Id string
The provider-assigned unique ID for this managed resource.
ServerUrl string
The domain of the container registry. Ex: registry.digitalocean.com
StorageUsageBytes int
The amount of storage used in the registry in bytes.
createdAt String
The date and time when the registry was created
endpoint String
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
id String
The provider-assigned unique ID for this managed resource.
serverUrl String
The domain of the container registry. Ex: registry.digitalocean.com
storageUsageBytes Integer
The amount of storage used in the registry in bytes.
createdAt string
The date and time when the registry was created
endpoint string
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
id string
The provider-assigned unique ID for this managed resource.
serverUrl string
The domain of the container registry. Ex: registry.digitalocean.com
storageUsageBytes number
The amount of storage used in the registry in bytes.
created_at str
The date and time when the registry was created
endpoint str
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
id str
The provider-assigned unique ID for this managed resource.
server_url str
The domain of the container registry. Ex: registry.digitalocean.com
storage_usage_bytes int
The amount of storage used in the registry in bytes.
createdAt String
The date and time when the registry was created
endpoint String
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
id String
The provider-assigned unique ID for this managed resource.
serverUrl String
The domain of the container registry. Ex: registry.digitalocean.com
storageUsageBytes Number
The amount of storage used in the registry in bytes.

Look up Existing ContainerRegistry Resource

Get an existing ContainerRegistry 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?: ContainerRegistryState, opts?: CustomResourceOptions): ContainerRegistry
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        endpoint: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        server_url: Optional[str] = None,
        storage_usage_bytes: Optional[int] = None,
        subscription_tier_slug: Optional[str] = None) -> ContainerRegistry
func GetContainerRegistry(ctx *Context, name string, id IDInput, state *ContainerRegistryState, opts ...ResourceOption) (*ContainerRegistry, error)
public static ContainerRegistry Get(string name, Input<string> id, ContainerRegistryState? state, CustomResourceOptions? opts = null)
public static ContainerRegistry get(String name, Output<String> id, ContainerRegistryState state, CustomResourceOptions options)
resources:  _:    type: digitalocean:ContainerRegistry    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreatedAt string
The date and time when the registry was created
Endpoint string
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
Name Changes to this property will trigger replacement. string
The name of the container_registry
Region Changes to this property will trigger replacement. string
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
ServerUrl string
The domain of the container registry. Ex: registry.digitalocean.com
StorageUsageBytes int
The amount of storage used in the registry in bytes.
SubscriptionTierSlug string
The slug identifier for the subscription tier to use (starter, basic, or professional)
CreatedAt string
The date and time when the registry was created
Endpoint string
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
Name Changes to this property will trigger replacement. string
The name of the container_registry
Region Changes to this property will trigger replacement. string
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
ServerUrl string
The domain of the container registry. Ex: registry.digitalocean.com
StorageUsageBytes int
The amount of storage used in the registry in bytes.
SubscriptionTierSlug string
The slug identifier for the subscription tier to use (starter, basic, or professional)
createdAt String
The date and time when the registry was created
endpoint String
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
name Changes to this property will trigger replacement. String
The name of the container_registry
region Changes to this property will trigger replacement. String
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
serverUrl String
The domain of the container registry. Ex: registry.digitalocean.com
storageUsageBytes Integer
The amount of storage used in the registry in bytes.
subscriptionTierSlug String
The slug identifier for the subscription tier to use (starter, basic, or professional)
createdAt string
The date and time when the registry was created
endpoint string
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
name Changes to this property will trigger replacement. string
The name of the container_registry
region Changes to this property will trigger replacement. string
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
serverUrl string
The domain of the container registry. Ex: registry.digitalocean.com
storageUsageBytes number
The amount of storage used in the registry in bytes.
subscriptionTierSlug string
The slug identifier for the subscription tier to use (starter, basic, or professional)
created_at str
The date and time when the registry was created
endpoint str
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
name Changes to this property will trigger replacement. str
The name of the container_registry
region Changes to this property will trigger replacement. str
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
server_url str
The domain of the container registry. Ex: registry.digitalocean.com
storage_usage_bytes int
The amount of storage used in the registry in bytes.
subscription_tier_slug str
The slug identifier for the subscription tier to use (starter, basic, or professional)
createdAt String
The date and time when the registry was created
endpoint String
The URL endpoint of the container registry. Ex: registry.digitalocean.com/my_registry
name Changes to this property will trigger replacement. String
The name of the container_registry
region Changes to this property will trigger replacement. String
The slug identifier of for region where registry data will be stored. When not provided, a region will be selected automatically.
serverUrl String
The domain of the container registry. Ex: registry.digitalocean.com
storageUsageBytes Number
The amount of storage used in the registry in bytes.
subscriptionTierSlug String
The slug identifier for the subscription tier to use (starter, basic, or professional)

Import

Container Registries can be imported using the name, e.g.

$ pulumi import digitalocean:index/containerRegistry:ContainerRegistry myregistry registryname
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
DigitalOcean pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.