1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cs
  5. RegistryEnterpriseNamespace
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.cs.RegistryEnterpriseNamespace

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    This resource will help you to manager Container Registry Enterprise Edition namespaces.

    For information about Container Registry Enterprise Edition namespaces and how to use it, see Create a Namespace

    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";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example-name";
    const exampleRegistryEnterpriseInstance = new alicloud.cr.RegistryEnterpriseInstance("exampleRegistryEnterpriseInstance", {
        paymentType: "Subscription",
        period: 1,
        renewPeriod: 0,
        renewalStatus: "ManualRenewal",
        instanceType: "Advanced",
        instanceName: name,
    });
    const exampleRegistryEnterpriseNamespace = new alicloud.cs.RegistryEnterpriseNamespace("exampleRegistryEnterpriseNamespace", {
        instanceId: exampleRegistryEnterpriseInstance.id,
        autoCreate: false,
        defaultVisibility: "PUBLIC",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example-name"
    example_registry_enterprise_instance = alicloud.cr.RegistryEnterpriseInstance("exampleRegistryEnterpriseInstance",
        payment_type="Subscription",
        period=1,
        renew_period=0,
        renewal_status="ManualRenewal",
        instance_type="Advanced",
        instance_name=name)
    example_registry_enterprise_namespace = alicloud.cs.RegistryEnterpriseNamespace("exampleRegistryEnterpriseNamespace",
        instance_id=example_registry_enterprise_instance.id,
        auto_create=False,
        default_visibility="PUBLIC")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
    	"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-name"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		exampleRegistryEnterpriseInstance, err := cr.NewRegistryEnterpriseInstance(ctx, "exampleRegistryEnterpriseInstance", &cr.RegistryEnterpriseInstanceArgs{
    			PaymentType:   pulumi.String("Subscription"),
    			Period:        pulumi.Int(1),
    			RenewPeriod:   pulumi.Int(0),
    			RenewalStatus: pulumi.String("ManualRenewal"),
    			InstanceType:  pulumi.String("Advanced"),
    			InstanceName:  pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cs.NewRegistryEnterpriseNamespace(ctx, "exampleRegistryEnterpriseNamespace", &cs.RegistryEnterpriseNamespaceArgs{
    			InstanceId:        exampleRegistryEnterpriseInstance.ID(),
    			AutoCreate:        pulumi.Bool(false),
    			DefaultVisibility: pulumi.String("PUBLIC"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example-name";
        var exampleRegistryEnterpriseInstance = new AliCloud.CR.RegistryEnterpriseInstance("exampleRegistryEnterpriseInstance", new()
        {
            PaymentType = "Subscription",
            Period = 1,
            RenewPeriod = 0,
            RenewalStatus = "ManualRenewal",
            InstanceType = "Advanced",
            InstanceName = name,
        });
    
        var exampleRegistryEnterpriseNamespace = new AliCloud.CS.RegistryEnterpriseNamespace("exampleRegistryEnterpriseNamespace", new()
        {
            InstanceId = exampleRegistryEnterpriseInstance.Id,
            AutoCreate = false,
            DefaultVisibility = "PUBLIC",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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 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-name");
            var exampleRegistryEnterpriseInstance = new RegistryEnterpriseInstance("exampleRegistryEnterpriseInstance", RegistryEnterpriseInstanceArgs.builder()        
                .paymentType("Subscription")
                .period(1)
                .renewPeriod(0)
                .renewalStatus("ManualRenewal")
                .instanceType("Advanced")
                .instanceName(name)
                .build());
    
            var exampleRegistryEnterpriseNamespace = new RegistryEnterpriseNamespace("exampleRegistryEnterpriseNamespace", RegistryEnterpriseNamespaceArgs.builder()        
                .instanceId(exampleRegistryEnterpriseInstance.id())
                .autoCreate(false)
                .defaultVisibility("PUBLIC")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example-name
    resources:
      exampleRegistryEnterpriseInstance:
        type: alicloud:cr:RegistryEnterpriseInstance
        properties:
          paymentType: Subscription
          period: 1
          renewPeriod: 0
          renewalStatus: ManualRenewal
          instanceType: Advanced
          instanceName: ${name}
      exampleRegistryEnterpriseNamespace:
        type: alicloud:cs:RegistryEnterpriseNamespace
        properties:
          instanceId: ${exampleRegistryEnterpriseInstance.id}
          autoCreate: false
          defaultVisibility: PUBLIC
    

    Create RegistryEnterpriseNamespace Resource

    new RegistryEnterpriseNamespace(name: string, args: RegistryEnterpriseNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def RegistryEnterpriseNamespace(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    auto_create: Optional[bool] = None,
                                    default_visibility: Optional[str] = None,
                                    instance_id: Optional[str] = None,
                                    name: Optional[str] = None)
    @overload
    def RegistryEnterpriseNamespace(resource_name: str,
                                    args: RegistryEnterpriseNamespaceArgs,
                                    opts: Optional[ResourceOptions] = None)
    func NewRegistryEnterpriseNamespace(ctx *Context, name string, args RegistryEnterpriseNamespaceArgs, opts ...ResourceOption) (*RegistryEnterpriseNamespace, error)
    public RegistryEnterpriseNamespace(string name, RegistryEnterpriseNamespaceArgs args, CustomResourceOptions? opts = null)
    public RegistryEnterpriseNamespace(String name, RegistryEnterpriseNamespaceArgs args)
    public RegistryEnterpriseNamespace(String name, RegistryEnterpriseNamespaceArgs args, CustomResourceOptions options)
    
    type: alicloud:cs:RegistryEnterpriseNamespace
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RegistryEnterpriseNamespaceArgs
    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 RegistryEnterpriseNamespaceArgs
    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 RegistryEnterpriseNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegistryEnterpriseNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegistryEnterpriseNamespaceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    AutoCreate bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    DefaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    InstanceId string
    ID of Container Registry Enterprise Edition instance.
    Name string
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    AutoCreate bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    DefaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    InstanceId string
    ID of Container Registry Enterprise Edition instance.
    Name string
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    autoCreate Boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility String
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instanceId String
    ID of Container Registry Enterprise Edition instance.
    name String
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    autoCreate boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instanceId string
    ID of Container Registry Enterprise Edition instance.
    name string
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    auto_create bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    default_visibility str
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instance_id str
    ID of Container Registry Enterprise Edition instance.
    name str
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    autoCreate Boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility String
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instanceId String
    ID of Container Registry Enterprise Edition instance.
    name String
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.

    Outputs

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

    Get an existing RegistryEnterpriseNamespace 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?: RegistryEnterpriseNamespaceState, opts?: CustomResourceOptions): RegistryEnterpriseNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_create: Optional[bool] = None,
            default_visibility: Optional[str] = None,
            instance_id: Optional[str] = None,
            name: Optional[str] = None) -> RegistryEnterpriseNamespace
    func GetRegistryEnterpriseNamespace(ctx *Context, name string, id IDInput, state *RegistryEnterpriseNamespaceState, opts ...ResourceOption) (*RegistryEnterpriseNamespace, error)
    public static RegistryEnterpriseNamespace Get(string name, Input<string> id, RegistryEnterpriseNamespaceState? state, CustomResourceOptions? opts = null)
    public static RegistryEnterpriseNamespace get(String name, Output<String> id, RegistryEnterpriseNamespaceState 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:
    AutoCreate bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    DefaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    InstanceId string
    ID of Container Registry Enterprise Edition instance.
    Name string
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    AutoCreate bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    DefaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    InstanceId string
    ID of Container Registry Enterprise Edition instance.
    Name string
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    autoCreate Boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility String
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instanceId String
    ID of Container Registry Enterprise Edition instance.
    name String
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    autoCreate boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility string
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instanceId string
    ID of Container Registry Enterprise Edition instance.
    name string
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    auto_create bool
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    default_visibility str
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instance_id str
    ID of Container Registry Enterprise Edition instance.
    name str
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.
    autoCreate Boolean
    Boolean, when it set to true, repositories are automatically created when pushing new images. If it set to false, you create repository for images before pushing.
    defaultVisibility String
    PUBLIC or PRIVATE, default repository visibility in this namespace.
    instanceId String
    ID of Container Registry Enterprise Edition instance.
    name String
    Name of Container Registry Enterprise Edition namespace. It can contain 2 to 30 characters.

    Import

    Container Registry Enterprise Edition namespace can be imported using the {instance_id}:{namespace}, e.g.

    $ pulumi import alicloud:cs/registryEnterpriseNamespace:RegistryEnterpriseNamespace default cri-xxx:my-namespace
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi