rancher2.Registry
Explore with Pulumi AI
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 theproject_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", {
name: "foo",
description: "Terraform registry foo",
projectId: "<project_id>",
registries: [{
address: "test.io",
username: "user",
password: "pass",
}],
});
import pulumi
import pulumi_rancher2 as rancher2
# Create a new rancher2 Project Registry
foo = rancher2.Registry("foo",
name="foo",
description="Terraform registry foo",
project_id="<project_id>",
registries=[{
"address": "test.io",
"username": "user",
"password": "pass",
}])
package main
import (
"github.com/pulumi/pulumi-rancher2/sdk/v8/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{
Name: pulumi.String("foo"),
Description: pulumi.String("Terraform registry foo"),
ProjectId: pulumi.String("<project_id>"),
Registries: rancher2.RegistryRegistryArray{
&rancher2.RegistryRegistryArgs{
Address: pulumi.String("test.io"),
Username: pulumi.String("user"),
Password: pulumi.String("pass"),
},
},
})
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()
{
Name = "foo",
Description = "Terraform registry foo",
ProjectId = "<project_id>",
Registries = new[]
{
new Rancher2.Inputs.RegistryRegistryArgs
{
Address = "test.io",
Username = "user",
Password = "pass",
},
},
});
});
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) {
// Create a new rancher2 Project Registry
var foo = new Registry("foo", RegistryArgs.builder()
.name("foo")
.description("Terraform registry foo")
.projectId("<project_id>")
.registries(RegistryRegistryArgs.builder()
.address("test.io")
.username("user")
.password("pass")
.build())
.build());
}
}
resources:
# Create a new rancher2 Project Registry
foo:
type: rancher2:Registry
properties:
name: foo
description: Terraform registry foo
projectId: <project_id>
registries:
- address: test.io
username: user
password: pass
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";
// Create a new rancher2 Namespaced Registry
const foo = new rancher2.Registry("foo", {
name: "foo",
description: "Terraform registry foo",
projectId: "<project_id>",
namespaceId: "<namespace_id>",
registries: [{
address: "test.io",
username: "user2",
password: "pass",
}],
});
import pulumi
import pulumi_rancher2 as rancher2
# Create a new rancher2 Namespaced Registry
foo = rancher2.Registry("foo",
name="foo",
description="Terraform registry foo",
project_id="<project_id>",
namespace_id="<namespace_id>",
registries=[{
"address": "test.io",
"username": "user2",
"password": "pass",
}])
package main
import (
"github.com/pulumi/pulumi-rancher2/sdk/v8/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{
Name: pulumi.String("foo"),
Description: pulumi.String("Terraform registry foo"),
ProjectId: pulumi.String("<project_id>"),
NamespaceId: pulumi.String("<namespace_id>"),
Registries: rancher2.RegistryRegistryArray{
&rancher2.RegistryRegistryArgs{
Address: pulumi.String("test.io"),
Username: pulumi.String("user2"),
Password: pulumi.String("pass"),
},
},
})
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()
{
Name = "foo",
Description = "Terraform registry foo",
ProjectId = "<project_id>",
NamespaceId = "<namespace_id>",
Registries = new[]
{
new Rancher2.Inputs.RegistryRegistryArgs
{
Address = "test.io",
Username = "user2",
Password = "pass",
},
},
});
});
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) {
// Create a new rancher2 Namespaced Registry
var foo = new Registry("foo", RegistryArgs.builder()
.name("foo")
.description("Terraform registry foo")
.projectId("<project_id>")
.namespaceId("<namespace_id>")
.registries(RegistryRegistryArgs.builder()
.address("test.io")
.username("user2")
.password("pass")
.build())
.build());
}
}
resources:
# Create a new rancher2 Namespaced Registry
foo:
type: rancher2:Registry
properties:
name: foo
description: Terraform registry foo
projectId: <project_id>
namespaceId: <namespace_id>
registries:
- address: test.io
username: user2
password: pass
Create Registry Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Registry(name: string, args: RegistryArgs, opts?: CustomResourceOptions);
@overload
def Registry(resource_name: str,
args: RegistryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Registry(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
registries: Optional[Sequence[RegistryRegistryArgs]] = None,
annotations: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
namespace_id: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var registryResource = new Rancher2.Registry("registryResource", new()
{
ProjectId = "string",
Registries = new[]
{
new Rancher2.Inputs.RegistryRegistryArgs
{
Address = "string",
Password = "string",
Username = "string",
},
},
Annotations =
{
{ "string", "string" },
},
Description = "string",
Labels =
{
{ "string", "string" },
},
Name = "string",
NamespaceId = "string",
});
example, err := rancher2.NewRegistry(ctx, "registryResource", &rancher2.RegistryArgs{
ProjectId: pulumi.String("string"),
Registries: rancher2.RegistryRegistryArray{
&rancher2.RegistryRegistryArgs{
Address: pulumi.String("string"),
Password: pulumi.String("string"),
Username: pulumi.String("string"),
},
},
Annotations: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
NamespaceId: pulumi.String("string"),
})
var registryResource = new Registry("registryResource", RegistryArgs.builder()
.projectId("string")
.registries(RegistryRegistryArgs.builder()
.address("string")
.password("string")
.username("string")
.build())
.annotations(Map.of("string", "string"))
.description("string")
.labels(Map.of("string", "string"))
.name("string")
.namespaceId("string")
.build());
registry_resource = rancher2.Registry("registryResource",
project_id="string",
registries=[{
"address": "string",
"password": "string",
"username": "string",
}],
annotations={
"string": "string",
},
description="string",
labels={
"string": "string",
},
name="string",
namespace_id="string")
const registryResource = new rancher2.Registry("registryResource", {
projectId: "string",
registries: [{
address: "string",
password: "string",
username: "string",
}],
annotations: {
string: "string",
},
description: "string",
labels: {
string: "string",
},
name: "string",
namespaceId: "string",
});
type: rancher2:Registry
properties:
annotations:
string: string
description: string
labels:
string: string
name: string
namespaceId: string
projectId: string
registries:
- address: string
password: string
username: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Registry resource accepts the following input properties:
- Project
Id string - The project id where to assign the registry (string)
- Registries
List<Registry
Registry> - Registries data for registry (list)
- Annotations Dictionary<string, string>
- Annotations for Registry object (map)
- Description string
- A registry description (string)
- Labels Dictionary<string, string>
- Labels for Registry object (map)
- Name string
- The name of the registry (string)
- Namespace
Id string - The namespace id where to assign the namespaced registry (string)
- Project
Id string - The project id where to assign the registry (string)
- Registries
[]Registry
Registry Args - Registries data for registry (list)
- Annotations map[string]string
- Annotations for Registry object (map)
- Description string
- A registry description (string)
- Labels map[string]string
- Labels for Registry object (map)
- Name string
- The name of the registry (string)
- Namespace
Id string - The namespace id where to assign the namespaced registry (string)
- project
Id String - The project id where to assign the registry (string)
- registries
List<Registry
Registry> - Registries data for registry (list)
- annotations Map<String,String>
- Annotations for Registry object (map)
- description String
- A registry description (string)
- labels Map<String,String>
- Labels for Registry object (map)
- name String
- The name of the registry (string)
- namespace
Id String - The namespace id where to assign the namespaced registry (string)
- project
Id string - The project id where to assign the registry (string)
- registries
Registry
Registry[] - Registries data for registry (list)
- annotations {[key: string]: string}
- Annotations for Registry object (map)
- description string
- A registry description (string)
- labels {[key: string]: string}
- Labels for Registry object (map)
- name string
- The name of the registry (string)
- namespace
Id 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[Registry
Registry Args] - Registries data for registry (list)
- annotations Mapping[str, str]
- Annotations for Registry object (map)
- description str
- A registry description (string)
- labels Mapping[str, str]
- 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 String - The project id where to assign the registry (string)
- registries List<Property Map>
- Registries data for registry (list)
- annotations Map<String>
- Annotations for Registry object (map)
- description String
- A registry description (string)
- labels Map<String>
- Labels for Registry object (map)
- name String
- The name of the registry (string)
- namespace
Id 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, str]] = None,
description: Optional[str] = None,
labels: Optional[Mapping[str, str]] = 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)
resources: _: type: rancher2:Registry get: id: ${id}
- 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.
- Annotations Dictionary<string, string>
- Annotations for Registry object (map)
- Description string
- A registry description (string)
- Labels Dictionary<string, string>
- Labels for Registry object (map)
- Name string
- The name of the registry (string)
- Namespace
Id string - The namespace id where to assign the namespaced registry (string)
- Project
Id string - The project id where to assign the registry (string)
- Registries
List<Registry
Registry> - Registries data for registry (list)
- Annotations map[string]string
- Annotations for Registry object (map)
- Description string
- A registry description (string)
- Labels map[string]string
- Labels for Registry object (map)
- Name string
- The name of the registry (string)
- Namespace
Id string - The namespace id where to assign the namespaced registry (string)
- Project
Id string - The project id where to assign the registry (string)
- Registries
[]Registry
Registry Args - Registries data for registry (list)
- annotations Map<String,String>
- Annotations for Registry object (map)
- description String
- A registry description (string)
- labels Map<String,String>
- Labels for Registry object (map)
- name String
- The name of the registry (string)
- namespace
Id String - The namespace id where to assign the namespaced registry (string)
- project
Id String - The project id where to assign the registry (string)
- registries
List<Registry
Registry> - Registries data for registry (list)
- annotations {[key: string]: string}
- Annotations for Registry object (map)
- description string
- A registry description (string)
- labels {[key: string]: string}
- Labels for Registry object (map)
- name string
- The name of the registry (string)
- namespace
Id string - The namespace id where to assign the namespaced registry (string)
- project
Id string - The project id where to assign the registry (string)
- registries
Registry
Registry[] - Registries data for registry (list)
- annotations Mapping[str, str]
- Annotations for Registry object (map)
- description str
- A registry description (string)
- labels Mapping[str, str]
- 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[Registry
Registry Args] - Registries data for registry (list)
- annotations Map<String>
- Annotations for Registry object (map)
- description String
- A registry description (string)
- labels Map<String>
- Labels for Registry object (map)
- name String
- The name of the registry (string)
- namespace
Id String - The namespace id where to assign the namespaced registry (string)
- project
Id String - The project id where to assign the registry (string)
- registries List<Property Map>
- Registries data for registry (list)
Supporting Types
RegistryRegistry, RegistryRegistryArgs
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 <namespace_id>.<project_id>.<registry_id>
<namespace_id>
is optional, just needed for namespaced registry.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Rancher2 pulumi/pulumi-rancher2
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
rancher2
Terraform Provider.