1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cs
  5. RegistryEnterpriseRepo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cs.RegistryEnterpriseRepo

Explore with Pulumi AI

Provides a Container Registry Enterprise Edition Repository resource.

For information about Container Registry Enterprise Edition Repository and how to use it, see What is Repository

NOTE: Available since v1.86.0.

NOTE: You need to set your registry password in Container Registry Enterprise Edition console before use this resource.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";

const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new random.index.Integer("default", {
    min: 10000000,
    max: 99999999,
});
const defaultRegistryEnterpriseInstance = new alicloud.cr.RegistryEnterpriseInstance("default", {
    paymentType: "Subscription",
    period: 1,
    renewPeriod: 0,
    renewalStatus: "ManualRenewal",
    instanceType: "Advanced",
    instanceName: `${name}-${_default.result}`,
});
const defaultRegistryEnterpriseNamespace = new alicloud.cs.RegistryEnterpriseNamespace("default", {
    instanceId: defaultRegistryEnterpriseInstance.id,
    name: `${name}-${_default.result}`,
    autoCreate: false,
    defaultVisibility: "PUBLIC",
});
const example = new alicloud.cs.RegistryEnterpriseRepo("example", {
    instanceId: defaultRegistryEnterpriseInstance.id,
    namespace: defaultRegistryEnterpriseNamespace.name,
    name: `${name}-${_default.result}`,
    repoType: "PUBLIC",
    summary: "this is summary of my new repo",
    detail: "this is a public repo",
});
Copy
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
default = random.index.Integer("default",
    min=10000000,
    max=99999999)
default_registry_enterprise_instance = alicloud.cr.RegistryEnterpriseInstance("default",
    payment_type="Subscription",
    period=1,
    renew_period=0,
    renewal_status="ManualRenewal",
    instance_type="Advanced",
    instance_name=f"{name}-{default['result']}")
default_registry_enterprise_namespace = alicloud.cs.RegistryEnterpriseNamespace("default",
    instance_id=default_registry_enterprise_instance.id,
    name=f"{name}-{default['result']}",
    auto_create=False,
    default_visibility="PUBLIC")
example = alicloud.cs.RegistryEnterpriseRepo("example",
    instance_id=default_registry_enterprise_instance.id,
    namespace=default_registry_enterprise_namespace.name,
    name=f"{name}-{default['result']}",
    repo_type="PUBLIC",
    summary="this is summary of my new repo",
    detail="this is a public repo")
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "terraform-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
			Min: 10000000,
			Max: 99999999,
		})
		if err != nil {
			return err
		}
		defaultRegistryEnterpriseInstance, err := cr.NewRegistryEnterpriseInstance(ctx, "default", &cr.RegistryEnterpriseInstanceArgs{
			PaymentType:   pulumi.String("Subscription"),
			Period:        pulumi.Int(1),
			RenewPeriod:   pulumi.Int(0),
			RenewalStatus: pulumi.String("ManualRenewal"),
			InstanceType:  pulumi.String("Advanced"),
			InstanceName:  pulumi.Sprintf("%v-%v", name, _default.Result),
		})
		if err != nil {
			return err
		}
		defaultRegistryEnterpriseNamespace, err := cs.NewRegistryEnterpriseNamespace(ctx, "default", &cs.RegistryEnterpriseNamespaceArgs{
			InstanceId:        defaultRegistryEnterpriseInstance.ID(),
			Name:              pulumi.Sprintf("%v-%v", name, _default.Result),
			AutoCreate:        pulumi.Bool(false),
			DefaultVisibility: pulumi.String("PUBLIC"),
		})
		if err != nil {
			return err
		}
		_, err = cs.NewRegistryEnterpriseRepo(ctx, "example", &cs.RegistryEnterpriseRepoArgs{
			InstanceId: defaultRegistryEnterpriseInstance.ID(),
			Namespace:  defaultRegistryEnterpriseNamespace.Name,
			Name:       pulumi.Sprintf("%v-%v", name, _default.Result),
			RepoType:   pulumi.String("PUBLIC"),
			Summary:    pulumi.String("this is summary of my new repo"),
			Detail:     pulumi.String("this is a public repo"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "terraform-example";
    var @default = new Random.Index.Integer("default", new()
    {
        Min = 10000000,
        Max = 99999999,
    });

    var defaultRegistryEnterpriseInstance = new AliCloud.CR.RegistryEnterpriseInstance("default", new()
    {
        PaymentType = "Subscription",
        Period = 1,
        RenewPeriod = 0,
        RenewalStatus = "ManualRenewal",
        InstanceType = "Advanced",
        InstanceName = $"{name}-{@default.Result}",
    });

    var defaultRegistryEnterpriseNamespace = new AliCloud.CS.RegistryEnterpriseNamespace("default", new()
    {
        InstanceId = defaultRegistryEnterpriseInstance.Id,
        Name = $"{name}-{@default.Result}",
        AutoCreate = false,
        DefaultVisibility = "PUBLIC",
    });

    var example = new AliCloud.CS.RegistryEnterpriseRepo("example", new()
    {
        InstanceId = defaultRegistryEnterpriseInstance.Id,
        Namespace = defaultRegistryEnterpriseNamespace.Name,
        Name = $"{name}-{@default.Result}",
        RepoType = "PUBLIC",
        Summary = "this is summary of my new repo",
        Detail = "this is a public repo",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.cr.RegistryEnterpriseInstance;
import com.pulumi.alicloud.cr.RegistryEnterpriseInstanceArgs;
import com.pulumi.alicloud.cs.RegistryEnterpriseNamespace;
import com.pulumi.alicloud.cs.RegistryEnterpriseNamespaceArgs;
import com.pulumi.alicloud.cs.RegistryEnterpriseRepo;
import com.pulumi.alicloud.cs.RegistryEnterpriseRepoArgs;
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("terraform-example");
        var default_ = new Integer("default", IntegerArgs.builder()
            .min(10000000)
            .max(99999999)
            .build());

        var defaultRegistryEnterpriseInstance = new RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", RegistryEnterpriseInstanceArgs.builder()
            .paymentType("Subscription")
            .period(1)
            .renewPeriod(0)
            .renewalStatus("ManualRenewal")
            .instanceType("Advanced")
            .instanceName(String.format("%s-%s", name,default_.result()))
            .build());

        var defaultRegistryEnterpriseNamespace = new RegistryEnterpriseNamespace("defaultRegistryEnterpriseNamespace", RegistryEnterpriseNamespaceArgs.builder()
            .instanceId(defaultRegistryEnterpriseInstance.id())
            .name(String.format("%s-%s", name,default_.result()))
            .autoCreate(false)
            .defaultVisibility("PUBLIC")
            .build());

        var example = new RegistryEnterpriseRepo("example", RegistryEnterpriseRepoArgs.builder()
            .instanceId(defaultRegistryEnterpriseInstance.id())
            .namespace(defaultRegistryEnterpriseNamespace.name())
            .name(String.format("%s-%s", name,default_.result()))
            .repoType("PUBLIC")
            .summary("this is summary of my new repo")
            .detail("this is a public repo")
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  default:
    type: random:integer
    properties:
      min: 1e+07
      max: 9.9999999e+07
  defaultRegistryEnterpriseInstance:
    type: alicloud:cr:RegistryEnterpriseInstance
    name: default
    properties:
      paymentType: Subscription
      period: 1
      renewPeriod: 0
      renewalStatus: ManualRenewal
      instanceType: Advanced
      instanceName: ${name}-${default.result}
  defaultRegistryEnterpriseNamespace:
    type: alicloud:cs:RegistryEnterpriseNamespace
    name: default
    properties:
      instanceId: ${defaultRegistryEnterpriseInstance.id}
      name: ${name}-${default.result}
      autoCreate: false
      defaultVisibility: PUBLIC
  example:
    type: alicloud:cs:RegistryEnterpriseRepo
    properties:
      instanceId: ${defaultRegistryEnterpriseInstance.id}
      namespace: ${defaultRegistryEnterpriseNamespace.name}
      name: ${name}-${default.result}
      repoType: PUBLIC
      summary: this is summary of my new repo
      detail: this is a public repo
Copy

Create RegistryEnterpriseRepo Resource

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

Constructor syntax

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

@overload
def RegistryEnterpriseRepo(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           instance_id: Optional[str] = None,
                           namespace: Optional[str] = None,
                           repo_type: Optional[str] = None,
                           summary: Optional[str] = None,
                           detail: Optional[str] = None,
                           name: Optional[str] = None)
func NewRegistryEnterpriseRepo(ctx *Context, name string, args RegistryEnterpriseRepoArgs, opts ...ResourceOption) (*RegistryEnterpriseRepo, error)
public RegistryEnterpriseRepo(string name, RegistryEnterpriseRepoArgs args, CustomResourceOptions? opts = null)
public RegistryEnterpriseRepo(String name, RegistryEnterpriseRepoArgs args)
public RegistryEnterpriseRepo(String name, RegistryEnterpriseRepoArgs args, CustomResourceOptions options)
type: alicloud:cs:RegistryEnterpriseRepo
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. RegistryEnterpriseRepoArgs
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. RegistryEnterpriseRepoArgs
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. RegistryEnterpriseRepoArgs
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. RegistryEnterpriseRepoArgs
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. RegistryEnterpriseRepoArgs
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 registryEnterpriseRepoResource = new AliCloud.CS.RegistryEnterpriseRepo("registryEnterpriseRepoResource", new()
{
    InstanceId = "string",
    Namespace = "string",
    RepoType = "string",
    Summary = "string",
    Detail = "string",
    Name = "string",
});
Copy
example, err := cs.NewRegistryEnterpriseRepo(ctx, "registryEnterpriseRepoResource", &cs.RegistryEnterpriseRepoArgs{
	InstanceId: pulumi.String("string"),
	Namespace:  pulumi.String("string"),
	RepoType:   pulumi.String("string"),
	Summary:    pulumi.String("string"),
	Detail:     pulumi.String("string"),
	Name:       pulumi.String("string"),
})
Copy
var registryEnterpriseRepoResource = new RegistryEnterpriseRepo("registryEnterpriseRepoResource", RegistryEnterpriseRepoArgs.builder()
    .instanceId("string")
    .namespace("string")
    .repoType("string")
    .summary("string")
    .detail("string")
    .name("string")
    .build());
Copy
registry_enterprise_repo_resource = alicloud.cs.RegistryEnterpriseRepo("registryEnterpriseRepoResource",
    instance_id="string",
    namespace="string",
    repo_type="string",
    summary="string",
    detail="string",
    name="string")
Copy
const registryEnterpriseRepoResource = new alicloud.cs.RegistryEnterpriseRepo("registryEnterpriseRepoResource", {
    instanceId: "string",
    namespace: "string",
    repoType: "string",
    summary: "string",
    detail: "string",
    name: "string",
});
Copy
type: alicloud:cs:RegistryEnterpriseRepo
properties:
    detail: string
    instanceId: string
    name: string
    namespace: string
    repoType: string
    summary: string
Copy

RegistryEnterpriseRepo 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 RegistryEnterpriseRepo resource accepts the following input properties:

InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Container Registry Enterprise Edition instance.
Namespace
This property is required.
Changes to this property will trigger replacement.
string
The name of the namespace to which the image repository belongs.
RepoType This property is required. string
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
Summary This property is required. string
The summary about the repository.
Detail string
The description of the repository.
Name Changes to this property will trigger replacement. string
The name of the image repository.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Container Registry Enterprise Edition instance.
Namespace
This property is required.
Changes to this property will trigger replacement.
string
The name of the namespace to which the image repository belongs.
RepoType This property is required. string
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
Summary This property is required. string
The summary about the repository.
Detail string
The description of the repository.
Name Changes to this property will trigger replacement. string
The name of the image repository.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Container Registry Enterprise Edition instance.
namespace
This property is required.
Changes to this property will trigger replacement.
String
The name of the namespace to which the image repository belongs.
repoType This property is required. String
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary This property is required. String
The summary about the repository.
detail String
The description of the repository.
name Changes to this property will trigger replacement. String
The name of the image repository.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Container Registry Enterprise Edition instance.
namespace
This property is required.
Changes to this property will trigger replacement.
string
The name of the namespace to which the image repository belongs.
repoType This property is required. string
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary This property is required. string
The summary about the repository.
detail string
The description of the repository.
name Changes to this property will trigger replacement. string
The name of the image repository.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Container Registry Enterprise Edition instance.
namespace
This property is required.
Changes to this property will trigger replacement.
str
The name of the namespace to which the image repository belongs.
repo_type This property is required. str
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary This property is required. str
The summary about the repository.
detail str
The description of the repository.
name Changes to this property will trigger replacement. str
The name of the image repository.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Container Registry Enterprise Edition instance.
namespace
This property is required.
Changes to this property will trigger replacement.
String
The name of the namespace to which the image repository belongs.
repoType This property is required. String
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary This property is required. String
The summary about the repository.
detail String
The description of the repository.
name Changes to this property will trigger replacement. String
The name of the image repository.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RepoId string
The ID of the repository.
Id string
The provider-assigned unique ID for this managed resource.
RepoId string
The ID of the repository.
id String
The provider-assigned unique ID for this managed resource.
repoId String
The ID of the repository.
id string
The provider-assigned unique ID for this managed resource.
repoId string
The ID of the repository.
id str
The provider-assigned unique ID for this managed resource.
repo_id str
The ID of the repository.
id String
The provider-assigned unique ID for this managed resource.
repoId String
The ID of the repository.

Look up Existing RegistryEnterpriseRepo Resource

Get an existing RegistryEnterpriseRepo 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?: RegistryEnterpriseRepoState, opts?: CustomResourceOptions): RegistryEnterpriseRepo
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        detail: Optional[str] = None,
        instance_id: Optional[str] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None,
        repo_id: Optional[str] = None,
        repo_type: Optional[str] = None,
        summary: Optional[str] = None) -> RegistryEnterpriseRepo
func GetRegistryEnterpriseRepo(ctx *Context, name string, id IDInput, state *RegistryEnterpriseRepoState, opts ...ResourceOption) (*RegistryEnterpriseRepo, error)
public static RegistryEnterpriseRepo Get(string name, Input<string> id, RegistryEnterpriseRepoState? state, CustomResourceOptions? opts = null)
public static RegistryEnterpriseRepo get(String name, Output<String> id, RegistryEnterpriseRepoState state, CustomResourceOptions options)
resources:  _:    type: alicloud:cs:RegistryEnterpriseRepo    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:
Detail string
The description of the repository.
InstanceId Changes to this property will trigger replacement. string
The ID of the Container Registry Enterprise Edition instance.
Name Changes to this property will trigger replacement. string
The name of the image repository.
Namespace Changes to this property will trigger replacement. string
The name of the namespace to which the image repository belongs.
RepoId string
The ID of the repository.
RepoType string
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
Summary string
The summary about the repository.
Detail string
The description of the repository.
InstanceId Changes to this property will trigger replacement. string
The ID of the Container Registry Enterprise Edition instance.
Name Changes to this property will trigger replacement. string
The name of the image repository.
Namespace Changes to this property will trigger replacement. string
The name of the namespace to which the image repository belongs.
RepoId string
The ID of the repository.
RepoType string
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
Summary string
The summary about the repository.
detail String
The description of the repository.
instanceId Changes to this property will trigger replacement. String
The ID of the Container Registry Enterprise Edition instance.
name Changes to this property will trigger replacement. String
The name of the image repository.
namespace Changes to this property will trigger replacement. String
The name of the namespace to which the image repository belongs.
repoId String
The ID of the repository.
repoType String
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary String
The summary about the repository.
detail string
The description of the repository.
instanceId Changes to this property will trigger replacement. string
The ID of the Container Registry Enterprise Edition instance.
name Changes to this property will trigger replacement. string
The name of the image repository.
namespace Changes to this property will trigger replacement. string
The name of the namespace to which the image repository belongs.
repoId string
The ID of the repository.
repoType string
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary string
The summary about the repository.
detail str
The description of the repository.
instance_id Changes to this property will trigger replacement. str
The ID of the Container Registry Enterprise Edition instance.
name Changes to this property will trigger replacement. str
The name of the image repository.
namespace Changes to this property will trigger replacement. str
The name of the namespace to which the image repository belongs.
repo_id str
The ID of the repository.
repo_type str
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary str
The summary about the repository.
detail String
The description of the repository.
instanceId Changes to this property will trigger replacement. String
The ID of the Container Registry Enterprise Edition instance.
name Changes to this property will trigger replacement. String
The name of the image repository.
namespace Changes to this property will trigger replacement. String
The name of the namespace to which the image repository belongs.
repoId String
The ID of the repository.
repoType String
The type of the repository. Valid values:

  • PUBLIC: The repository is a public repository.
  • PRIVATE: The repository is a private repository.
summary String
The summary about the repository.

Import

Container Registry Enterprise Edition Repository can be imported using the id, e.g.

$ pulumi import alicloud:cs/registryEnterpriseRepo:RegistryEnterpriseRepo example <instance_id>:<namespace>:<name>
Copy

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

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.