alicloud.cs.RegistryEnterpriseNamespace
Explore with Pulumi AI
Provides a Container Registry Enterprise Edition Namespace resource.
For information about Container Registry Enterprise Edition Namespace and how to use it, see What is 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";
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: 10000,
max: 99999,
});
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",
});
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=10000,
max=99999)
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")
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
}
_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
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
}
_, 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
}
return nil
})
}
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 = 10000,
Max = 99999,
});
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",
});
});
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 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(10000)
.max(99999)
.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());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
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
Create RegistryEnterpriseNamespace Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RegistryEnterpriseNamespace(name: string, args: RegistryEnterpriseNamespaceArgs, opts?: CustomResourceOptions);
@overload
def RegistryEnterpriseNamespace(resource_name: str,
args: RegistryEnterpriseNamespaceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RegistryEnterpriseNamespace(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
auto_create: Optional[bool] = None,
default_visibility: Optional[str] = None,
name: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var registryEnterpriseNamespaceResource = new AliCloud.CS.RegistryEnterpriseNamespace("registryEnterpriseNamespaceResource", new()
{
InstanceId = "string",
AutoCreate = false,
DefaultVisibility = "string",
Name = "string",
});
example, err := cs.NewRegistryEnterpriseNamespace(ctx, "registryEnterpriseNamespaceResource", &cs.RegistryEnterpriseNamespaceArgs{
InstanceId: pulumi.String("string"),
AutoCreate: pulumi.Bool(false),
DefaultVisibility: pulumi.String("string"),
Name: pulumi.String("string"),
})
var registryEnterpriseNamespaceResource = new RegistryEnterpriseNamespace("registryEnterpriseNamespaceResource", RegistryEnterpriseNamespaceArgs.builder()
.instanceId("string")
.autoCreate(false)
.defaultVisibility("string")
.name("string")
.build());
registry_enterprise_namespace_resource = alicloud.cs.RegistryEnterpriseNamespace("registryEnterpriseNamespaceResource",
instance_id="string",
auto_create=False,
default_visibility="string",
name="string")
const registryEnterpriseNamespaceResource = new alicloud.cs.RegistryEnterpriseNamespace("registryEnterpriseNamespaceResource", {
instanceId: "string",
autoCreate: false,
defaultVisibility: "string",
name: "string",
});
type: alicloud:cs:RegistryEnterpriseNamespace
properties:
autoCreate: false
defaultVisibility: string
instanceId: string
name: string
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:
- Instance
Id string - The ID of the Container Registry Enterprise Edition instance.
- Auto
Create bool - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - Default
Visibility string - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- Name string
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- Instance
Id string - The ID of the Container Registry Enterprise Edition instance.
- Auto
Create bool - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - Default
Visibility string - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- Name string
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- instance
Id String - The ID of the Container Registry Enterprise Edition instance.
- auto
Create Boolean - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default
Visibility String - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- name String
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- instance
Id string - The ID of the Container Registry Enterprise Edition instance.
- auto
Create boolean - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default
Visibility string - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- name string
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- instance_
id str - The ID of the Container Registry Enterprise Edition instance.
- auto_
create bool - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default_
visibility str - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- name str
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- instance
Id String - The ID of the Container Registry Enterprise Edition instance.
- auto
Create Boolean - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default
Visibility String - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- name String
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
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.
- Auto
Create bool - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - Default
Visibility string - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- Instance
Id string - The ID of the Container Registry Enterprise Edition instance.
- Name string
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- Auto
Create bool - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - Default
Visibility string - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- Instance
Id string - The ID of the Container Registry Enterprise Edition instance.
- Name string
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- auto
Create Boolean - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default
Visibility String - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- instance
Id String - The ID of the Container Registry Enterprise Edition instance.
- name String
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- auto
Create boolean - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default
Visibility string - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- instance
Id string - The ID of the Container Registry Enterprise Edition instance.
- name string
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- auto_
create bool - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default_
visibility str - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- instance_
id str - The ID of the Container Registry Enterprise Edition instance.
- name str
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
- auto
Create Boolean - Specifies whether to automatically create an image repository in the namespace. Default value:
false
. Valid values:true
,false
. - default
Visibility String - The default type of the repository that is automatically created. Valid values:
PUBLIC
: A public repository.PRIVATE
: A private repository.
- instance
Id String - The ID of the Container Registry Enterprise Edition instance.
- name String
- The name of the Container Registry Enterprise Edition Name. It must be
2
to120
characters in length, and can contain lowercase letters, digits, underscores (_), hyphens (-), and periods (.). It cannot start or end with a delimiter.
Import
Container Registry Enterprise Edition Namespace can be imported using the id, e.g.
$ pulumi import alicloud:cs/registryEnterpriseNamespace:RegistryEnterpriseNamespace example <instance_id>:<name>
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.