1. Packages
  2. Rancher2
  3. API Docs
  4. Packages
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

rancher2.Registry

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

    Provides a Rancher v2 Registry resource. This resource creates Kubernetes secrets with the type kubernetes.io/dockerconfigjson for authenticating against Docker registries for Rancher v2 environments and retrieving their information.

    Depending on the availability, there are 2 types of Rancher v2 Docker registry resources:

    • Project registry resource: Available to all namespaces in the project_id.
    • Namespaced registry resource: Available to namespace_id in the project_id.

    Example Usage

    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",
        }],
    });
    
    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",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new rancher2 Project Registry
    		_, 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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rancher2 = Pulumi.Rancher2;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new rancher2 Project Registry
        var foo = new Rancher2.Registry("foo", new()
        {
            Description = "Terraform registry foo",
            ProjectId = "<project_id>",
            Registries = new[]
            {
                new Rancher2.Inputs.RegistryRegistryArgs
                {
                    Address = "test.io",
                    Password = "pass",
                    Username = "user",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.Registry;
    import com.pulumi.rancher2.RegistryArgs;
    import com.pulumi.rancher2.inputs.RegistryRegistryArgs;
    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 foo = new Registry("foo", RegistryArgs.builder()        
                .description("Terraform registry foo")
                .projectId("<project_id>")
                .registries(RegistryRegistryArgs.builder()
                    .address("test.io")
                    .password("pass")
                    .username("user")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create a new rancher2 Project Registry
      foo:
        type: rancher2:Registry
        properties:
          description: Terraform registry foo
          projectId: <project_id>
          registries:
            - address: test.io
              password: pass
              username: user
    
    import * as pulumi from "@pulumi/pulumi";
    import * as rancher2 from "@pulumi/rancher2";
    
    // Create a new rancher2 Namespaced Registry
    const foo = new rancher2.Registry("foo", {
        description: "Terraform registry foo",
        namespaceId: "<namespace_id>",
        projectId: "<project_id>",
        registries: [{
            address: "test.io",
            password: "pass",
            username: "user2",
        }],
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    # Create a new rancher2 Namespaced Registry
    foo = rancher2.Registry("foo",
        description="Terraform registry foo",
        namespace_id="<namespace_id>",
        project_id="<project_id>",
        registries=[rancher2.RegistryRegistryArgs(
            address="test.io",
            password="pass",
            username="user2",
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a new rancher2 Namespaced Registry
    		_, err := rancher2.NewRegistry(ctx, "foo", &rancher2.RegistryArgs{
    			Description: pulumi.String("Terraform registry foo"),
    			NamespaceId: pulumi.String("<namespace_id>"),
    			ProjectId:   pulumi.String("<project_id>"),
    			Registries: rancher2.RegistryRegistryArray{
    				&rancher2.RegistryRegistryArgs{
    					Address:  pulumi.String("test.io"),
    					Password: pulumi.String("pass"),
    					Username: pulumi.String("user2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rancher2 = Pulumi.Rancher2;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new rancher2 Namespaced Registry
        var foo = new Rancher2.Registry("foo", new()
        {
            Description = "Terraform registry foo",
            NamespaceId = "<namespace_id>",
            ProjectId = "<project_id>",
            Registries = new[]
            {
                new Rancher2.Inputs.RegistryRegistryArgs
                {
                    Address = "test.io",
                    Password = "pass",
                    Username = "user2",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.Registry;
    import com.pulumi.rancher2.RegistryArgs;
    import com.pulumi.rancher2.inputs.RegistryRegistryArgs;
    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 foo = new Registry("foo", RegistryArgs.builder()        
                .description("Terraform registry foo")
                .namespaceId("<namespace_id>")
                .projectId("<project_id>")
                .registries(RegistryRegistryArgs.builder()
                    .address("test.io")
                    .password("pass")
                    .username("user2")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create a new rancher2 Namespaced Registry
      foo:
        type: rancher2:Registry
        properties:
          description: Terraform registry foo
          namespaceId: <namespace_id>
          projectId: <project_id>
          registries:
            - address: test.io
              password: pass
              username: user2
    

    Create Registry Resource

    new Registry(name: string, args: RegistryArgs, opts?: CustomResourceOptions);
    @overload
    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)
    @overload
    def Registry(resource_name: str,
                 args: RegistryArgs,
                 opts: Optional[ResourceOptions] = None)
    func NewRegistry(ctx *Context, name string, args RegistryArgs, opts ...ResourceOption) (*Registry, error)
    public Registry(string name, RegistryArgs args, CustomResourceOptions? opts = null)
    public Registry(String name, RegistryArgs args)
    public Registry(String name, RegistryArgs args, CustomResourceOptions options)
    
    type: rancher2:Registry
    properties: # The arguments to resource properties.
    options: # 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.
    resource_name str
    The unique name of the resource.
    args RegistryArgs
    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 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.
    name String
    The unique name of the resource.
    args RegistryArgs
    The arguments to resource properties.
    options 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 Architecture and Concepts docs.

    Inputs

    The Registry resource accepts the following input properties:

    ProjectId string
    The project id where to assign the registry (string)
    Registries List<RegistryRegistry>
    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 []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 List<RegistryRegistry>
    Registries data for registry (list)
    annotations Map<String,Object>
    Annotations for Registry object (map)
    description String
    A registry description (string)
    labels Map<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 {[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)
    projectId String
    The project id where to assign the registry (string)
    registries List<Property Map>
    Registries data for registry (list)
    annotations Map<Any>
    Annotations for Registry object (map)
    description String
    A registry description (string)
    labels Map<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)

    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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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)
    public static Registry get(String name, Output<String> id, RegistryState 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:
    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<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 []RegistryRegistryArgs
    Registries data for registry (list)
    annotations Map<String,Object>
    Annotations for Registry object (map)
    description String
    A registry description (string)
    labels Map<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<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)
    annotations Map<Any>
    Annotations for Registry object (map)
    description String
    A registry description (string)
    labels Map<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 List<Property Map>
    Registries data for registry (list)

    Supporting Types

    RegistryRegistry, RegistryRegistryArgs

    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 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)
    address String
    Address for registry.
    password String
    Password for the registry (string)
    username String
    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
    Rancher2 pulumi/pulumi-rancher2
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rancher2 Terraform Provider.
    rancher2 logo
    Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi