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

ibm.CloudantDatabase

Explore with Pulumi AI

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

    Provides a resource for cloudant_database. This allows cloudant_database to be created, updated and deleted.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const cloudantDatabase = new ibm.CloudantDatabase("cloudantDatabase", {
        instanceCrn: _var.instance_crn,
        db: _var.db_name,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    cloudant_database = ibm.CloudantDatabase("cloudantDatabase",
        instance_crn=var["instance_crn"],
        db=var["db_name"])
    
    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.NewCloudantDatabase(ctx, "cloudantDatabase", &ibm.CloudantDatabaseArgs{
    			InstanceCrn: pulumi.Any(_var.Instance_crn),
    			Db:          pulumi.Any(_var.Db_name),
    		})
    		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 cloudantDatabase = new Ibm.CloudantDatabase("cloudantDatabase", new()
        {
            InstanceCrn = @var.Instance_crn,
            Db = @var.Db_name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.CloudantDatabase;
    import com.pulumi.ibm.CloudantDatabaseArgs;
    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 cloudantDatabase = new CloudantDatabase("cloudantDatabase", CloudantDatabaseArgs.builder()
                .instanceCrn(var_.instance_crn())
                .db(var_.db_name())
                .build());
    
        }
    }
    
    resources:
      cloudantDatabase:
        type: ibm:CloudantDatabase
        properties:
          instanceCrn: ${var.instance_crn}
          db: ${var.db_name}
    

    Create CloudantDatabase Resource

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

    Constructor syntax

    new CloudantDatabase(name: string, args: CloudantDatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def CloudantDatabase(resource_name: str,
                         args: CloudantDatabaseArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def CloudantDatabase(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         db: Optional[str] = None,
                         instance_crn: Optional[str] = None,
                         cloudant_database_id: Optional[str] = None,
                         partitioned: Optional[bool] = None,
                         shards: Optional[float] = None)
    func NewCloudantDatabase(ctx *Context, name string, args CloudantDatabaseArgs, opts ...ResourceOption) (*CloudantDatabase, error)
    public CloudantDatabase(string name, CloudantDatabaseArgs args, CustomResourceOptions? opts = null)
    public CloudantDatabase(String name, CloudantDatabaseArgs args)
    public CloudantDatabase(String name, CloudantDatabaseArgs args, CustomResourceOptions options)
    
    type: ibm:CloudantDatabase
    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 CloudantDatabaseArgs
    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 CloudantDatabaseArgs
    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 CloudantDatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CloudantDatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CloudantDatabaseArgs
    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 cloudantDatabaseResource = new Ibm.CloudantDatabase("cloudantDatabaseResource", new()
    {
        Db = "string",
        InstanceCrn = "string",
        CloudantDatabaseId = "string",
        Partitioned = false,
        Shards = 0,
    });
    
    example, err := ibm.NewCloudantDatabase(ctx, "cloudantDatabaseResource", &ibm.CloudantDatabaseArgs{
    	Db:                 pulumi.String("string"),
    	InstanceCrn:        pulumi.String("string"),
    	CloudantDatabaseId: pulumi.String("string"),
    	Partitioned:        pulumi.Bool(false),
    	Shards:             pulumi.Float64(0),
    })
    
    var cloudantDatabaseResource = new CloudantDatabase("cloudantDatabaseResource", CloudantDatabaseArgs.builder()
        .db("string")
        .instanceCrn("string")
        .cloudantDatabaseId("string")
        .partitioned(false)
        .shards(0)
        .build());
    
    cloudant_database_resource = ibm.CloudantDatabase("cloudantDatabaseResource",
        db="string",
        instance_crn="string",
        cloudant_database_id="string",
        partitioned=False,
        shards=0)
    
    const cloudantDatabaseResource = new ibm.CloudantDatabase("cloudantDatabaseResource", {
        db: "string",
        instanceCrn: "string",
        cloudantDatabaseId: "string",
        partitioned: false,
        shards: 0,
    });
    
    type: ibm:CloudantDatabase
    properties:
        cloudantDatabaseId: string
        db: string
        instanceCrn: string
        partitioned: false
        shards: 0
    

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

    Db string
    Path parameter to specify the database name.
    InstanceCrn string
    Path parameter to specify the cloudant instance CRN.
    CloudantDatabaseId string
    The unique identifier of the cloudant_database.
    Partitioned bool
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    Shards double
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    Db string
    Path parameter to specify the database name.
    InstanceCrn string
    Path parameter to specify the cloudant instance CRN.
    CloudantDatabaseId string
    The unique identifier of the cloudant_database.
    Partitioned bool
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    Shards float64
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    db String
    Path parameter to specify the database name.
    instanceCrn String
    Path parameter to specify the cloudant instance CRN.
    cloudantDatabaseId String
    The unique identifier of the cloudant_database.
    partitioned Boolean
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards Double
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    db string
    Path parameter to specify the database name.
    instanceCrn string
    Path parameter to specify the cloudant instance CRN.
    cloudantDatabaseId string
    The unique identifier of the cloudant_database.
    partitioned boolean
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards number
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    db str
    Path parameter to specify the database name.
    instance_crn str
    Path parameter to specify the cloudant instance CRN.
    cloudant_database_id str
    The unique identifier of the cloudant_database.
    partitioned bool
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards float
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    db String
    Path parameter to specify the database name.
    instanceCrn String
    Path parameter to specify the cloudant instance CRN.
    cloudantDatabaseId String
    The unique identifier of the cloudant_database.
    partitioned Boolean
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards Number
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.

    Outputs

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

    Get an existing CloudantDatabase 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?: CloudantDatabaseState, opts?: CustomResourceOptions): CloudantDatabase
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cloudant_database_id: Optional[str] = None,
            db: Optional[str] = None,
            instance_crn: Optional[str] = None,
            partitioned: Optional[bool] = None,
            shards: Optional[float] = None) -> CloudantDatabase
    func GetCloudantDatabase(ctx *Context, name string, id IDInput, state *CloudantDatabaseState, opts ...ResourceOption) (*CloudantDatabase, error)
    public static CloudantDatabase Get(string name, Input<string> id, CloudantDatabaseState? state, CustomResourceOptions? opts = null)
    public static CloudantDatabase get(String name, Output<String> id, CloudantDatabaseState state, CustomResourceOptions options)
    resources:  _:    type: ibm:CloudantDatabase    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:
    CloudantDatabaseId string
    The unique identifier of the cloudant_database.
    Db string
    Path parameter to specify the database name.
    InstanceCrn string
    Path parameter to specify the cloudant instance CRN.
    Partitioned bool
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    Shards double
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    CloudantDatabaseId string
    The unique identifier of the cloudant_database.
    Db string
    Path parameter to specify the database name.
    InstanceCrn string
    Path parameter to specify the cloudant instance CRN.
    Partitioned bool
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    Shards float64
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    cloudantDatabaseId String
    The unique identifier of the cloudant_database.
    db String
    Path parameter to specify the database name.
    instanceCrn String
    Path parameter to specify the cloudant instance CRN.
    partitioned Boolean
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards Double
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    cloudantDatabaseId string
    The unique identifier of the cloudant_database.
    db string
    Path parameter to specify the database name.
    instanceCrn string
    Path parameter to specify the cloudant instance CRN.
    partitioned boolean
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards number
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    cloudant_database_id str
    The unique identifier of the cloudant_database.
    db str
    Path parameter to specify the database name.
    instance_crn str
    Path parameter to specify the cloudant instance CRN.
    partitioned bool
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards float
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.
    cloudantDatabaseId String
    The unique identifier of the cloudant_database.
    db String
    Path parameter to specify the database name.
    instanceCrn String
    Path parameter to specify the cloudant instance CRN.
    partitioned Boolean
    Query parameter to specify whether to enable database partitions when creating a database.

    • Constraints: The default value is false.
    shards Number
    The number of shards in the database. Each shard is a partition of the hash value range. Default set by server.

    • Constraints: The minimum value is 1.

    Import

    You can import the cloudant_database resource by using ID.

    The ID property can be formed from instance_crn, and db in the following format:

    <instance_crn>/

    • db: A string. Path parameter to specify the database name.

    • instance_crn: A string. Path parameter to specify the cloudant instance CRN.

    $ pulumi import ibm:index/cloudantDatabase:CloudantDatabase cloudant_database <instance_crn>/<db>
    

    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