Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Registry

Provides a Rancher v2 Registry resource. This can be used to create docker registries for Rancher v2 environments and retrieve their information.

Depending of the availability, there are 2 types of Rancher v2 docker registries: - Project registry: Available to all namespaces in the project_id - Namespaced registry: Available to just namespace_id in the project_id

Example Usage

using Pulumi;
using Rancher2 = Pulumi.Rancher2;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new rancher2 Project Registry
        var foo = new Rancher2.Registry("foo", new Rancher2.RegistryArgs
        {
            Description = "Terraform registry foo",
            ProjectId = "<project_id>",
            Registries = 
            {
                new Rancher2.Inputs.RegistryRegistryArgs
                {
                    Address = "test.io",
                    Password = "pass",
                    Username = "user",
                },
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-rancher2/sdk/v2/go/rancher2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := rancher2.NewRegistry(ctx, "foo", &rancher2.RegistryArgs{
            Description: pulumi.String("Terraform registry foo"),
            ProjectId:   pulumi.String("<project_id>"),
            Registries: rancher2.RegistryRegistryArray{
                &rancher2.RegistryRegistryArgs{
                    Address:  pulumi.String("test.io"),
                    Password: pulumi.String("pass"),
                    Username: pulumi.String("user"),
                },
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_rancher2 as rancher2

# Create a new rancher2 Project Registry
foo = rancher2.Registry("foo",
    description="Terraform registry foo",
    project_id="<project_id>",
    registries=[rancher2.RegistryRegistryArgs(
        address="test.io",
        password="pass",
        username="user",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

// Create a new rancher2 Project Registry
const foo = new rancher2.Registry("foo", {
    description: "Terraform registry foo",
    projectId: "<project_id>",
    registries: [{
        address: "test.io",
        password: "pass",
        username: "user",
    }],
});

Create a Registry Resource

new Registry(name: string, args: RegistryArgs, opts?: CustomResourceOptions);
def Registry(resource_name: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, description: Optional[str] = None, labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, namespace_id: Optional[str] = None, project_id: Optional[str] = None, registries: Optional[Sequence[RegistryRegistryArgs]] = None)
func NewRegistry(ctx *Context, name string, args RegistryArgs, opts ...ResourceOption) (*Registry, error)
public Registry(string name, RegistryArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RegistryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RegistryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RegistryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Registry Resource Properties

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

Inputs

The Registry resource accepts the following input properties:

ProjectId string

The project id where to assign the registry (string)

Registries List<RegistryRegistryArgs>

Registries data for registry (list)

Annotations Dictionary<string, object>

Annotations for Registry object (map)

Description string

A registry description (string)

Labels Dictionary<string, object>

Labels for Registry object (map)

Name string

The name of the registry (string)

NamespaceId string

The namespace id where to assign the namespaced registry (string)

ProjectId string

The project id where to assign the registry (string)

Registries []RegistryRegistry

Registries data for registry (list)

Annotations map[string]interface{}

Annotations for Registry object (map)

Description string

A registry description (string)

Labels map[string]interface{}

Labels for Registry object (map)

Name string

The name of the registry (string)

NamespaceId string

The namespace id where to assign the namespaced registry (string)

projectId string

The project id where to assign the registry (string)

registries RegistryRegistry[]

Registries data for registry (list)

annotations {[key: string]: any}

Annotations for Registry object (map)

description string

A registry description (string)

labels {[key: string]: any}

Labels for Registry object (map)

name string

The name of the registry (string)

namespaceId string

The namespace id where to assign the namespaced registry (string)

project_id str

The project id where to assign the registry (string)

registries Sequence[RegistryRegistryArgs]

Registries data for registry (list)

annotations Mapping[str, Any]

Annotations for Registry object (map)

description str

A registry description (string)

labels Mapping[str, Any]

Labels for Registry object (map)

name str

The name of the registry (string)

namespace_id str

The namespace id where to assign the namespaced registry (string)

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Registry Resource

Get an existing Registry 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?: RegistryState, opts?: CustomResourceOptions): Registry
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, annotations: Optional[Mapping[str, Any]] = None, description: Optional[str] = None, labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, namespace_id: Optional[str] = None, project_id: Optional[str] = None, registries: Optional[Sequence[RegistryRegistryArgs]] = None) -> Registry
func GetRegistry(ctx *Context, name string, id IDInput, state *RegistryState, opts ...ResourceOption) (*Registry, error)
public static Registry Get(string name, Input<string> id, RegistryState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Annotations Dictionary<string, object>

Annotations for Registry object (map)

Description string

A registry description (string)

Labels Dictionary<string, object>

Labels for Registry object (map)

Name string

The name of the registry (string)

NamespaceId string

The namespace id where to assign the namespaced registry (string)

ProjectId string

The project id where to assign the registry (string)

Registries List<RegistryRegistryArgs>

Registries data for registry (list)

Annotations map[string]interface{}

Annotations for Registry object (map)

Description string

A registry description (string)

Labels map[string]interface{}

Labels for Registry object (map)

Name string

The name of the registry (string)

NamespaceId string

The namespace id where to assign the namespaced registry (string)

ProjectId string

The project id where to assign the registry (string)

Registries []RegistryRegistry

Registries data for registry (list)

annotations {[key: string]: any}

Annotations for Registry object (map)

description string

A registry description (string)

labels {[key: string]: any}

Labels for Registry object (map)

name string

The name of the registry (string)

namespaceId string

The namespace id where to assign the namespaced registry (string)

projectId string

The project id where to assign the registry (string)

registries RegistryRegistry[]

Registries data for registry (list)

annotations Mapping[str, Any]

Annotations for Registry object (map)

description str

A registry description (string)

labels Mapping[str, Any]

Labels for Registry object (map)

name str

The name of the registry (string)

namespace_id str

The namespace id where to assign the namespaced registry (string)

project_id str

The project id where to assign the registry (string)

registries Sequence[RegistryRegistryArgs]

Registries data for registry (list)

Supporting Types

RegistryRegistry

Address string

Address for registry.

Password string

Password for the registry (string)

Username string

Username for the registry (string)

Address string

Address for registry.

Password string

Password for the registry (string)

Username string

Username for the registry (string)

address string

Address for registry.

password string

Password for the registry (string)

username string

Username for the registry (string)

address str

Address for registry.

password str

Password for the registry (string)

username str

Username for the registry (string)

Import

Registries can be imported using the registry ID in the format <namespace_id>.<project_id>.<registry_id>

 $ pulumi import rancher2:index/registry:Registry foo &lt;namespace_id&gt;.&lt;project_id&gt;.&lt;registry_id&gt;

<namespace_id> is optional, just needed for namespaced registry.

Package Details

Repository
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.