1. Packages
  2. Ibm Provider
  3. API Docs
  4. CrNamespace
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.CrNamespace

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create or delete a Container Registry namespace. For more information about Container Registry, see About IBM Cloud Container Registry.

    Example Usage

    The following example shows how you can configure a namespace.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const crNamespace = new ibm.CrNamespace("crNamespace", {});
    const rg = ibm.getResourceGroup({
        name: "default",
    });
    const rgNamespace = new ibm.CrNamespace("rgNamespace", {resourceGroupId: rg.then(rg => rg.id)});
    
    import pulumi
    import pulumi_ibm as ibm
    
    cr_namespace = ibm.CrNamespace("crNamespace")
    rg = ibm.get_resource_group(name="default")
    rg_namespace = ibm.CrNamespace("rgNamespace", resource_group_id=rg.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewCrNamespace(ctx, "crNamespace", nil)
    		if err != nil {
    			return err
    		}
    		rg, err := ibm.LookupResourceGroup(ctx, &ibm.LookupResourceGroupArgs{
    			Name: pulumi.StringRef("default"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.NewCrNamespace(ctx, "rgNamespace", &ibm.CrNamespaceArgs{
    			ResourceGroupId: pulumi.String(rg.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var crNamespace = new Ibm.CrNamespace("crNamespace");
    
        var rg = Ibm.GetResourceGroup.Invoke(new()
        {
            Name = "default",
        });
    
        var rgNamespace = new Ibm.CrNamespace("rgNamespace", new()
        {
            ResourceGroupId = rg.Apply(getResourceGroupResult => getResourceGroupResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.CrNamespace;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetResourceGroupArgs;
    import com.pulumi.ibm.CrNamespaceArgs;
    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) {
            var crNamespace = new CrNamespace("crNamespace");
    
            final var rg = IbmFunctions.getResourceGroup(GetResourceGroupArgs.builder()
                .name("default")
                .build());
    
            var rgNamespace = new CrNamespace("rgNamespace", CrNamespaceArgs.builder()
                .resourceGroupId(rg.applyValue(getResourceGroupResult -> getResourceGroupResult.id()))
                .build());
    
        }
    }
    
    resources:
      crNamespace:
        type: ibm:CrNamespace
      rgNamespace:
        type: ibm:CrNamespace
        properties:
          resourceGroupId: ${rg.id}
    variables:
      rg:
        fn::invoke:
          function: ibm:getResourceGroup
          arguments:
            name: default
    

    Create CrNamespace Resource

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

    Constructor syntax

    new CrNamespace(name: string, args?: CrNamespaceArgs, opts?: CustomResourceOptions);
    @overload
    def CrNamespace(resource_name: str,
                    args: Optional[CrNamespaceArgs] = None,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def CrNamespace(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    cr_namespace_id: Optional[str] = None,
                    name: Optional[str] = None,
                    resource_group_id: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None)
    func NewCrNamespace(ctx *Context, name string, args *CrNamespaceArgs, opts ...ResourceOption) (*CrNamespace, error)
    public CrNamespace(string name, CrNamespaceArgs? args = null, CustomResourceOptions? opts = null)
    public CrNamespace(String name, CrNamespaceArgs args)
    public CrNamespace(String name, CrNamespaceArgs args, CustomResourceOptions options)
    
    type: ibm:CrNamespace
    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 CrNamespaceArgs
    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 CrNamespaceArgs
    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 CrNamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CrNamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CrNamespaceArgs
    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 crNamespaceResource = new Ibm.CrNamespace("crNamespaceResource", new()
    {
        CrNamespaceId = "string",
        Name = "string",
        ResourceGroupId = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := ibm.NewCrNamespace(ctx, "crNamespaceResource", &ibm.CrNamespaceArgs{
    	CrNamespaceId:   pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	ResourceGroupId: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var crNamespaceResource = new CrNamespace("crNamespaceResource", CrNamespaceArgs.builder()
        .crNamespaceId("string")
        .name("string")
        .resourceGroupId("string")
        .tags("string")
        .build());
    
    cr_namespace_resource = ibm.CrNamespace("crNamespaceResource",
        cr_namespace_id="string",
        name="string",
        resource_group_id="string",
        tags=["string"])
    
    const crNamespaceResource = new ibm.CrNamespace("crNamespaceResource", {
        crNamespaceId: "string",
        name: "string",
        resourceGroupId: "string",
        tags: ["string"],
    });
    
    type: ibm:CrNamespace
    properties:
        crNamespaceId: string
        name: string
        resourceGroupId: string
        tags:
            - string
    

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

    CrNamespaceId string
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    Name string
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    ResourceGroupId string
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    Tags List<string>
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    CrNamespaceId string
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    Name string
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    ResourceGroupId string
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    Tags []string
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    crNamespaceId String
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    name String
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resourceGroupId String
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags List<String>
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    crNamespaceId string
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    name string
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resourceGroupId string
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags string[]
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    cr_namespace_id str
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    name str
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resource_group_id str
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags Sequence[str]
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    crNamespaceId String
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    name String
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resourceGroupId String
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags List<String>
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.

    Outputs

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

    Account string
    (String) The IBM Cloud account that owns the namespace.
    CreatedDate string
    (Timestamp) The creation date of the namespace.
    CreatedOn string
    When the namespace was created.

    Deprecated: Deprecated

    Crn string
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceCreatedDate string
    (Timestamp) The date that the namespace was assigned to a resource group.
    UpdatedDate string
    (Timestamp) The date that the namespace was last updated.
    UpdatedOn string
    When the namespace was last updated.

    Deprecated: Deprecated

    Account string
    (String) The IBM Cloud account that owns the namespace.
    CreatedDate string
    (Timestamp) The creation date of the namespace.
    CreatedOn string
    When the namespace was created.

    Deprecated: Deprecated

    Crn string
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    Id string
    The provider-assigned unique ID for this managed resource.
    ResourceCreatedDate string
    (Timestamp) The date that the namespace was assigned to a resource group.
    UpdatedDate string
    (Timestamp) The date that the namespace was last updated.
    UpdatedOn string
    When the namespace was last updated.

    Deprecated: Deprecated

    account String
    (String) The IBM Cloud account that owns the namespace.
    createdDate String
    (Timestamp) The creation date of the namespace.
    createdOn String
    When the namespace was created.

    Deprecated: Deprecated

    crn String
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceCreatedDate String
    (Timestamp) The date that the namespace was assigned to a resource group.
    updatedDate String
    (Timestamp) The date that the namespace was last updated.
    updatedOn String
    When the namespace was last updated.

    Deprecated: Deprecated

    account string
    (String) The IBM Cloud account that owns the namespace.
    createdDate string
    (Timestamp) The creation date of the namespace.
    createdOn string
    When the namespace was created.

    Deprecated: Deprecated

    crn string
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    id string
    The provider-assigned unique ID for this managed resource.
    resourceCreatedDate string
    (Timestamp) The date that the namespace was assigned to a resource group.
    updatedDate string
    (Timestamp) The date that the namespace was last updated.
    updatedOn string
    When the namespace was last updated.

    Deprecated: Deprecated

    account str
    (String) The IBM Cloud account that owns the namespace.
    created_date str
    (Timestamp) The creation date of the namespace.
    created_on str
    When the namespace was created.

    Deprecated: Deprecated

    crn str
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    id str
    The provider-assigned unique ID for this managed resource.
    resource_created_date str
    (Timestamp) The date that the namespace was assigned to a resource group.
    updated_date str
    (Timestamp) The date that the namespace was last updated.
    updated_on str
    When the namespace was last updated.

    Deprecated: Deprecated

    account String
    (String) The IBM Cloud account that owns the namespace.
    createdDate String
    (Timestamp) The creation date of the namespace.
    createdOn String
    When the namespace was created.

    Deprecated: Deprecated

    crn String
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    id String
    The provider-assigned unique ID for this managed resource.
    resourceCreatedDate String
    (Timestamp) The date that the namespace was assigned to a resource group.
    updatedDate String
    (Timestamp) The date that the namespace was last updated.
    updatedOn String
    When the namespace was last updated.

    Deprecated: Deprecated

    Look up Existing CrNamespace Resource

    Get an existing CrNamespace 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?: CrNamespaceState, opts?: CustomResourceOptions): CrNamespace
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account: Optional[str] = None,
            cr_namespace_id: Optional[str] = None,
            created_date: Optional[str] = None,
            created_on: Optional[str] = None,
            crn: Optional[str] = None,
            name: Optional[str] = None,
            resource_created_date: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            updated_date: Optional[str] = None,
            updated_on: Optional[str] = None) -> CrNamespace
    func GetCrNamespace(ctx *Context, name string, id IDInput, state *CrNamespaceState, opts ...ResourceOption) (*CrNamespace, error)
    public static CrNamespace Get(string name, Input<string> id, CrNamespaceState? state, CustomResourceOptions? opts = null)
    public static CrNamespace get(String name, Output<String> id, CrNamespaceState state, CustomResourceOptions options)
    resources:  _:    type: ibm:CrNamespace    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.
    The following state arguments are supported:
    Account string
    (String) The IBM Cloud account that owns the namespace.
    CrNamespaceId string
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    CreatedDate string
    (Timestamp) The creation date of the namespace.
    CreatedOn string
    When the namespace was created.

    Deprecated: Deprecated

    Crn string
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    Name string
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    ResourceCreatedDate string
    (Timestamp) The date that the namespace was assigned to a resource group.
    ResourceGroupId string
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    Tags List<string>
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    UpdatedDate string
    (Timestamp) The date that the namespace was last updated.
    UpdatedOn string
    When the namespace was last updated.

    Deprecated: Deprecated

    Account string
    (String) The IBM Cloud account that owns the namespace.
    CrNamespaceId string
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    CreatedDate string
    (Timestamp) The creation date of the namespace.
    CreatedOn string
    When the namespace was created.

    Deprecated: Deprecated

    Crn string
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    Name string
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    ResourceCreatedDate string
    (Timestamp) The date that the namespace was assigned to a resource group.
    ResourceGroupId string
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    Tags []string
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    UpdatedDate string
    (Timestamp) The date that the namespace was last updated.
    UpdatedOn string
    When the namespace was last updated.

    Deprecated: Deprecated

    account String
    (String) The IBM Cloud account that owns the namespace.
    crNamespaceId String
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    createdDate String
    (Timestamp) The creation date of the namespace.
    createdOn String
    When the namespace was created.

    Deprecated: Deprecated

    crn String
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    name String
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resourceCreatedDate String
    (Timestamp) The date that the namespace was assigned to a resource group.
    resourceGroupId String
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags List<String>
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    updatedDate String
    (Timestamp) The date that the namespace was last updated.
    updatedOn String
    When the namespace was last updated.

    Deprecated: Deprecated

    account string
    (String) The IBM Cloud account that owns the namespace.
    crNamespaceId string
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    createdDate string
    (Timestamp) The creation date of the namespace.
    createdOn string
    When the namespace was created.

    Deprecated: Deprecated

    crn string
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    name string
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resourceCreatedDate string
    (Timestamp) The date that the namespace was assigned to a resource group.
    resourceGroupId string
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags string[]
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    updatedDate string
    (Timestamp) The date that the namespace was last updated.
    updatedOn string
    When the namespace was last updated.

    Deprecated: Deprecated

    account str
    (String) The IBM Cloud account that owns the namespace.
    cr_namespace_id str
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    created_date str
    (Timestamp) The creation date of the namespace.
    created_on str
    When the namespace was created.

    Deprecated: Deprecated

    crn str
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    name str
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resource_created_date str
    (Timestamp) The date that the namespace was assigned to a resource group.
    resource_group_id str
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags Sequence[str]
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    updated_date str
    (Timestamp) The date that the namespace was last updated.
    updated_on str
    When the namespace was last updated.

    Deprecated: Deprecated

    account String
    (String) The IBM Cloud account that owns the namespace.
    crNamespaceId String
    (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
    createdDate String
    (Timestamp) The creation date of the namespace.
    createdOn String
    When the namespace was created.

    Deprecated: Deprecated

    crn String
    (String) If the namespace is assigned to a resource group, the IBM Cloud CRN representing the namespace.
    name String
    The name of the namespace that you want to create.

    • Constraints: The maximum length is 30 characters. The minimum length is 4 characters. The value must match regular expression /^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
    resourceCreatedDate String
    (Timestamp) The date that the namespace was assigned to a resource group.
    resourceGroupId String
    The ID of the resource group to which you want to add the namespace. If you don't set this option, the default resource group for the account is used.
    tags List<String>
    The tags that are associated with the ibm.CrNamespace. *Note- Tags are managed locally and not stored on the IBM Cloud service endpoint.
    updatedDate String
    (Timestamp) The date that the namespace was last updated.
    updatedOn String
    When the namespace was last updated.

    Deprecated: Deprecated

    Import

    You can import the ibm_cr_namespace resource by using the name of the namespace.

    Syntax

    $ pulumi import ibm:index/crNamespace:CrNamespace test <name of the namespace>
    

    Example

    $ pulumi import ibm:index/crNamespace:CrNamespace test namespace-name
    

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

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud