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

alicloud.cr.ChartNamespace

Explore with Pulumi AI

Provides a CR Chart Namespace resource.

For information about CR Chart Namespace and how to use it, see What is Chart Namespace.

NOTE: Available since v1.149.0.

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 example = new alicloud.cr.RegistryEnterpriseInstance("example", {
    paymentType: "Subscription",
    period: 1,
    renewPeriod: 0,
    renewalStatus: "ManualRenewal",
    instanceType: "Advanced",
    instanceName: `${name}-${_default.result}`,
});
const exampleChartNamespace = new alicloud.cr.ChartNamespace("example", {
    instanceId: example.id,
    namespaceName: `${name}-${_default.result}`,
});
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)
example = alicloud.cr.RegistryEnterpriseInstance("example",
    payment_type="Subscription",
    period=1,
    renew_period=0,
    renewal_status="ManualRenewal",
    instance_type="Advanced",
    instance_name=f"{name}-{default['result']}")
example_chart_namespace = alicloud.cr.ChartNamespace("example",
    instance_id=example.id,
    namespace_name=f"{name}-{default['result']}")
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
	"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
		}
		example, err := cr.NewRegistryEnterpriseInstance(ctx, "example", &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
		}
		_, err = cr.NewChartNamespace(ctx, "example", &cr.ChartNamespaceArgs{
			InstanceId:    example.ID(),
			NamespaceName: pulumi.Sprintf("%v-%v", name, _default.Result),
		})
		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 example = new AliCloud.CR.RegistryEnterpriseInstance("example", new()
    {
        PaymentType = "Subscription",
        Period = 1,
        RenewPeriod = 0,
        RenewalStatus = "ManualRenewal",
        InstanceType = "Advanced",
        InstanceName = $"{name}-{@default.Result}",
    });

    var exampleChartNamespace = new AliCloud.CR.ChartNamespace("example", new()
    {
        InstanceId = example.Id,
        NamespaceName = $"{name}-{@default.Result}",
    });

});
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.cr.ChartNamespace;
import com.pulumi.alicloud.cr.ChartNamespaceArgs;
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 example = new RegistryEnterpriseInstance("example", RegistryEnterpriseInstanceArgs.builder()
            .paymentType("Subscription")
            .period(1)
            .renewPeriod(0)
            .renewalStatus("ManualRenewal")
            .instanceType("Advanced")
            .instanceName(String.format("%s-%s", name,default_.result()))
            .build());

        var exampleChartNamespace = new ChartNamespace("exampleChartNamespace", ChartNamespaceArgs.builder()
            .instanceId(example.id())
            .namespaceName(String.format("%s-%s", name,default_.result()))
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  default:
    type: random:integer
    properties:
      min: 1e+07
      max: 9.9999999e+07
  example:
    type: alicloud:cr:RegistryEnterpriseInstance
    properties:
      paymentType: Subscription
      period: 1
      renewPeriod: 0
      renewalStatus: ManualRenewal
      instanceType: Advanced
      instanceName: ${name}-${default.result}
  exampleChartNamespace:
    type: alicloud:cr:ChartNamespace
    name: example
    properties:
      instanceId: ${example.id}
      namespaceName: ${name}-${default.result}
Copy

Create ChartNamespace Resource

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

Constructor syntax

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

@overload
def ChartNamespace(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   instance_id: Optional[str] = None,
                   namespace_name: Optional[str] = None,
                   auto_create_repo: Optional[bool] = None,
                   default_repo_type: Optional[str] = None)
func NewChartNamespace(ctx *Context, name string, args ChartNamespaceArgs, opts ...ResourceOption) (*ChartNamespace, error)
public ChartNamespace(string name, ChartNamespaceArgs args, CustomResourceOptions? opts = null)
public ChartNamespace(String name, ChartNamespaceArgs args)
public ChartNamespace(String name, ChartNamespaceArgs args, CustomResourceOptions options)
type: alicloud:cr:ChartNamespace
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. ChartNamespaceArgs
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. ChartNamespaceArgs
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. ChartNamespaceArgs
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. ChartNamespaceArgs
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. ChartNamespaceArgs
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 chartNamespaceResource = new AliCloud.CR.ChartNamespace("chartNamespaceResource", new()
{
    InstanceId = "string",
    NamespaceName = "string",
    AutoCreateRepo = false,
    DefaultRepoType = "string",
});
Copy
example, err := cr.NewChartNamespace(ctx, "chartNamespaceResource", &cr.ChartNamespaceArgs{
	InstanceId:      pulumi.String("string"),
	NamespaceName:   pulumi.String("string"),
	AutoCreateRepo:  pulumi.Bool(false),
	DefaultRepoType: pulumi.String("string"),
})
Copy
var chartNamespaceResource = new ChartNamespace("chartNamespaceResource", ChartNamespaceArgs.builder()
    .instanceId("string")
    .namespaceName("string")
    .autoCreateRepo(false)
    .defaultRepoType("string")
    .build());
Copy
chart_namespace_resource = alicloud.cr.ChartNamespace("chartNamespaceResource",
    instance_id="string",
    namespace_name="string",
    auto_create_repo=False,
    default_repo_type="string")
Copy
const chartNamespaceResource = new alicloud.cr.ChartNamespace("chartNamespaceResource", {
    instanceId: "string",
    namespaceName: "string",
    autoCreateRepo: false,
    defaultRepoType: "string",
});
Copy
type: alicloud:cr:ChartNamespace
properties:
    autoCreateRepo: false
    defaultRepoType: string
    instanceId: string
    namespaceName: string
Copy

ChartNamespace 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 ChartNamespace 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 instance.
NamespaceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the namespace that you want to create.
AutoCreateRepo bool
Specifies whether to automatically create repositories in the namespace. Valid values:
DefaultRepoType string
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Container Registry instance.
NamespaceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the namespace that you want to create.
AutoCreateRepo bool
Specifies whether to automatically create repositories in the namespace. Valid values:
DefaultRepoType string
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Container Registry instance.
namespaceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the namespace that you want to create.
autoCreateRepo Boolean
Specifies whether to automatically create repositories in the namespace. Valid values:
defaultRepoType String
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Container Registry instance.
namespaceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the namespace that you want to create.
autoCreateRepo boolean
Specifies whether to automatically create repositories in the namespace. Valid values:
defaultRepoType string
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Container Registry instance.
namespace_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the namespace that you want to create.
auto_create_repo bool
Specifies whether to automatically create repositories in the namespace. Valid values:
default_repo_type str
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Container Registry instance.
namespaceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the namespace that you want to create.
autoCreateRepo Boolean
Specifies whether to automatically create repositories in the namespace. Valid values:
defaultRepoType String
DefaultRepoType. Valid values: PRIVATE, PUBLIC.

Outputs

All input properties are implicitly available as output properties. Additionally, the ChartNamespace 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 ChartNamespace Resource

Get an existing ChartNamespace 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?: ChartNamespaceState, opts?: CustomResourceOptions): ChartNamespace
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auto_create_repo: Optional[bool] = None,
        default_repo_type: Optional[str] = None,
        instance_id: Optional[str] = None,
        namespace_name: Optional[str] = None) -> ChartNamespace
func GetChartNamespace(ctx *Context, name string, id IDInput, state *ChartNamespaceState, opts ...ResourceOption) (*ChartNamespace, error)
public static ChartNamespace Get(string name, Input<string> id, ChartNamespaceState? state, CustomResourceOptions? opts = null)
public static ChartNamespace get(String name, Output<String> id, ChartNamespaceState state, CustomResourceOptions options)
resources:  _:    type: alicloud:cr:ChartNamespace    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:
AutoCreateRepo bool
Specifies whether to automatically create repositories in the namespace. Valid values:
DefaultRepoType string
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
InstanceId Changes to this property will trigger replacement. string
The ID of the Container Registry instance.
NamespaceName Changes to this property will trigger replacement. string
The name of the namespace that you want to create.
AutoCreateRepo bool
Specifies whether to automatically create repositories in the namespace. Valid values:
DefaultRepoType string
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
InstanceId Changes to this property will trigger replacement. string
The ID of the Container Registry instance.
NamespaceName Changes to this property will trigger replacement. string
The name of the namespace that you want to create.
autoCreateRepo Boolean
Specifies whether to automatically create repositories in the namespace. Valid values:
defaultRepoType String
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instanceId Changes to this property will trigger replacement. String
The ID of the Container Registry instance.
namespaceName Changes to this property will trigger replacement. String
The name of the namespace that you want to create.
autoCreateRepo boolean
Specifies whether to automatically create repositories in the namespace. Valid values:
defaultRepoType string
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instanceId Changes to this property will trigger replacement. string
The ID of the Container Registry instance.
namespaceName Changes to this property will trigger replacement. string
The name of the namespace that you want to create.
auto_create_repo bool
Specifies whether to automatically create repositories in the namespace. Valid values:
default_repo_type str
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instance_id Changes to this property will trigger replacement. str
The ID of the Container Registry instance.
namespace_name Changes to this property will trigger replacement. str
The name of the namespace that you want to create.
autoCreateRepo Boolean
Specifies whether to automatically create repositories in the namespace. Valid values:
defaultRepoType String
DefaultRepoType. Valid values: PRIVATE, PUBLIC.
instanceId Changes to this property will trigger replacement. String
The ID of the Container Registry instance.
namespaceName Changes to this property will trigger replacement. String
The name of the namespace that you want to create.

Import

CR Chart Namespace can be imported using the id, e.g.

$ pulumi import alicloud:cr/chartNamespace:ChartNamespace 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.