ibm.CrNamespace
Explore with Pulumi AI
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:
- Cr
Namespace stringId - (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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- Resource
Group stringId - 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.
- 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.
- Cr
Namespace stringId - (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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- Resource
Group stringId - 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.
- []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 StringId - (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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource
Group StringId - 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.
- 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.
- cr
Namespace stringId - (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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource
Group stringId - 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.
- 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_ strid - (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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource_
group_ strid - 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.
- 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.
- cr
Namespace StringId - (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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource
Group StringId - 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.
- 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.
- Created
Date string - (Timestamp) The creation date of the namespace.
- Created
On string - When the namespace was created.
- 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.
- Resource
Created stringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- Updated
Date string - (Timestamp) The date that the namespace was last updated.
- Updated
On string - When the namespace was last updated.
- Account string
- (String) The IBM Cloud account that owns the namespace.
- Created
Date string - (Timestamp) The creation date of the namespace.
- Created
On string - When the namespace was created.
- 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.
- Resource
Created stringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- Updated
Date string - (Timestamp) The date that the namespace was last updated.
- Updated
On string - When the namespace was last updated.
- account String
- (String) The IBM Cloud account that owns the namespace.
- created
Date String - (Timestamp) The creation date of the namespace.
- created
On String - When the namespace was created.
- 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.
- resource
Created StringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- updated
Date String - (Timestamp) The date that the namespace was last updated.
- updated
On String - When the namespace was last updated.
- account string
- (String) The IBM Cloud account that owns the namespace.
- created
Date string - (Timestamp) The creation date of the namespace.
- created
On string - When the namespace was created.
- 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.
- resource
Created stringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- updated
Date string - (Timestamp) The date that the namespace was last updated.
- updated
On string - When the namespace was last updated.
- 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.
- 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_ strdate - (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.
- account String
- (String) The IBM Cloud account that owns the namespace.
- created
Date String - (Timestamp) The creation date of the namespace.
- created
On String - When the namespace was created.
- 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.
- resource
Created StringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- updated
Date String - (Timestamp) The date that the namespace was last updated.
- updated
On String - When the namespace was last updated.
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.
- Account string
- (String) The IBM Cloud account that owns the namespace.
- Cr
Namespace stringId - (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
- Created
Date string - (Timestamp) The creation date of the namespace.
- Created
On string - When the namespace was created.
- 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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- Resource
Created stringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- Resource
Group stringId - 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.
- 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. - Updated
Date string - (Timestamp) The date that the namespace was last updated.
- Updated
On string - When the namespace was last updated.
- Account string
- (String) The IBM Cloud account that owns the namespace.
- Cr
Namespace stringId - (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
- Created
Date string - (Timestamp) The creation date of the namespace.
- Created
On string - When the namespace was created.
- 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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- Resource
Created stringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- Resource
Group stringId - 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.
- []string
- 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 string - (Timestamp) The date that the namespace was last updated.
- Updated
On string - When the namespace was last updated.
- account String
- (String) The IBM Cloud account that owns the namespace.
- cr
Namespace StringId - (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
- created
Date String - (Timestamp) The creation date of the namespace.
- created
On String - When the namespace was created.
- 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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource
Created StringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- resource
Group StringId - 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.
- 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. - updated
Date String - (Timestamp) The date that the namespace was last updated.
- updated
On String - When the namespace was last updated.
- account string
- (String) The IBM Cloud account that owns the namespace.
- cr
Namespace stringId - (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
- created
Date string - (Timestamp) The creation date of the namespace.
- created
On string - When the namespace was created.
- 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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource
Created stringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- resource
Group stringId - 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.
- string[]
- 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 string - (Timestamp) The date that the namespace was last updated.
- updated
On string - When the namespace was last updated.
- account str
- (String) The IBM Cloud account that owns the namespace.
- cr_
namespace_ strid - (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.
- 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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource_
created_ strdate - (Timestamp) The date that the namespace was assigned to a resource group.
- resource_
group_ strid - 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.
- 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.
- account String
- (String) The IBM Cloud account that owns the namespace.
- cr
Namespace StringId - (String) The unique identifier of the namespace. This identifier is the same as the name of namespace.
- created
Date String - (Timestamp) The creation date of the namespace.
- created
On String - When the namespace was created.
- 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 is4
characters. The value must match regular expression/^[a-z0-9]+[a-z0-9_-]+[a-z0-9]+$/
- Constraints: The maximum length is
- resource
Created StringDate - (Timestamp) The date that the namespace was assigned to a resource group.
- resource
Group StringId - 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.
- 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. - updated
Date String - (Timestamp) The date that the namespace was last updated.
- updated
On String - When the namespace was last updated.
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.