1. Packages
  2. Civo
  3. API Docs
  4. ObjectStore
Civo v2.3.18 published on Tuesday, Jun 11, 2024 by Pulumi

civo.ObjectStore

Explore with Pulumi AI

civo logo
Civo v2.3.18 published on Tuesday, Jun 11, 2024 by Pulumi

    Provides an Object Store resource. This can be used to create, modify, and delete object stores.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as civo from "@pulumi/civo";
    
    const backupObjectStore = new civo.ObjectStore("backup", {
        name: "backup-server",
        maxSizeGb: 500,
        region: "LON1",
    });
    // If you create the bucket without credentials, you can read the credentials in this way
    const backup = civo.getObjectStoreCredentialOutput({
        id: backupObjectStore.accessKeyId,
    });
    
    import pulumi
    import pulumi_civo as civo
    
    backup_object_store = civo.ObjectStore("backup",
        name="backup-server",
        max_size_gb=500,
        region="LON1")
    # If you create the bucket without credentials, you can read the credentials in this way
    backup = civo.get_object_store_credential_output(id=backup_object_store.access_key_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-civo/sdk/v2/go/civo"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		backupObjectStore, err := civo.NewObjectStore(ctx, "backup", &civo.ObjectStoreArgs{
    			Name:      pulumi.String("backup-server"),
    			MaxSizeGb: pulumi.Int(500),
    			Region:    pulumi.String("LON1"),
    		})
    		if err != nil {
    			return err
    		}
    		// If you create the bucket without credentials, you can read the credentials in this way
    		_ = civo.LookupObjectStoreCredentialOutput(ctx, civo.GetObjectStoreCredentialOutputArgs{
    			Id: backupObjectStore.AccessKeyId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Civo = Pulumi.Civo;
    
    return await Deployment.RunAsync(() => 
    {
        var backupObjectStore = new Civo.ObjectStore("backup", new()
        {
            Name = "backup-server",
            MaxSizeGb = 500,
            Region = "LON1",
        });
    
        // If you create the bucket without credentials, you can read the credentials in this way
        var backup = Civo.GetObjectStoreCredential.Invoke(new()
        {
            Id = backupObjectStore.AccessKeyId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.civo.ObjectStore;
    import com.pulumi.civo.ObjectStoreArgs;
    import com.pulumi.civo.CivoFunctions;
    import com.pulumi.civo.inputs.GetObjectStoreCredentialArgs;
    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 backupObjectStore = new ObjectStore("backupObjectStore", ObjectStoreArgs.builder()
                .name("backup-server")
                .maxSizeGb(500)
                .region("LON1")
                .build());
    
            // If you create the bucket without credentials, you can read the credentials in this way
            final var backup = CivoFunctions.getObjectStoreCredential(GetObjectStoreCredentialArgs.builder()
                .id(backupObjectStore.accessKeyId())
                .build());
    
        }
    }
    
    resources:
      backupObjectStore:
        type: civo:ObjectStore
        name: backup
        properties:
          name: backup-server
          maxSizeGb: 500
          region: LON1
    variables:
      # If you create the bucket without credentials, you can read the credentials in this way
      backup:
        fn::invoke:
          Function: civo:getObjectStoreCredential
          Arguments:
            id: ${backupObjectStore.accessKeyId}
    

    Create ObjectStore Resource

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

    Constructor syntax

    new ObjectStore(name: string, args?: ObjectStoreArgs, opts?: CustomResourceOptions);
    @overload
    def ObjectStore(resource_name: str,
                    args: Optional[ObjectStoreArgs] = None,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def ObjectStore(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    access_key_id: Optional[str] = None,
                    max_size_gb: Optional[int] = None,
                    name: Optional[str] = None,
                    region: Optional[str] = None)
    func NewObjectStore(ctx *Context, name string, args *ObjectStoreArgs, opts ...ResourceOption) (*ObjectStore, error)
    public ObjectStore(string name, ObjectStoreArgs? args = null, CustomResourceOptions? opts = null)
    public ObjectStore(String name, ObjectStoreArgs args)
    public ObjectStore(String name, ObjectStoreArgs args, CustomResourceOptions options)
    
    type: civo:ObjectStore
    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 ObjectStoreArgs
    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 ObjectStoreArgs
    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 ObjectStoreArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ObjectStoreArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ObjectStoreArgs
    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 objectStoreResource = new Civo.ObjectStore("objectStoreResource", new()
    {
        AccessKeyId = "string",
        MaxSizeGb = 0,
        Name = "string",
        Region = "string",
    });
    
    example, err := civo.NewObjectStore(ctx, "objectStoreResource", &civo.ObjectStoreArgs{
    	AccessKeyId: pulumi.String("string"),
    	MaxSizeGb:   pulumi.Int(0),
    	Name:        pulumi.String("string"),
    	Region:      pulumi.String("string"),
    })
    
    var objectStoreResource = new ObjectStore("objectStoreResource", ObjectStoreArgs.builder()
        .accessKeyId("string")
        .maxSizeGb(0)
        .name("string")
        .region("string")
        .build());
    
    object_store_resource = civo.ObjectStore("objectStoreResource",
        access_key_id="string",
        max_size_gb=0,
        name="string",
        region="string")
    
    const objectStoreResource = new civo.ObjectStore("objectStoreResource", {
        accessKeyId: "string",
        maxSizeGb: 0,
        name: "string",
        region: "string",
    });
    
    type: civo:ObjectStore
    properties:
        accessKeyId: string
        maxSizeGb: 0
        name: string
        region: string
    

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

    AccessKeyId string
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    MaxSizeGb int
    The maximum size of the Object Store. Default is 500GB.
    Name string
    The name of the Object Store. Must be unique.
    Region string
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    AccessKeyId string
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    MaxSizeGb int
    The maximum size of the Object Store. Default is 500GB.
    Name string
    The name of the Object Store. Must be unique.
    Region string
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    accessKeyId String
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    maxSizeGb Integer
    The maximum size of the Object Store. Default is 500GB.
    name String
    The name of the Object Store. Must be unique.
    region String
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    accessKeyId string
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    maxSizeGb number
    The maximum size of the Object Store. Default is 500GB.
    name string
    The name of the Object Store. Must be unique.
    region string
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    access_key_id str
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    max_size_gb int
    The maximum size of the Object Store. Default is 500GB.
    name str
    The name of the Object Store. Must be unique.
    region str
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    accessKeyId String
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    maxSizeGb Number
    The maximum size of the Object Store. Default is 500GB.
    name String
    The name of the Object Store. Must be unique.
    region String
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)

    Outputs

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

    BucketUrl string
    The endpoint of the Object Store. It is generated by the provider.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Object Store.
    BucketUrl string
    The endpoint of the Object Store. It is generated by the provider.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Object Store.
    bucketUrl String
    The endpoint of the Object Store. It is generated by the provider.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Object Store.
    bucketUrl string
    The endpoint of the Object Store. It is generated by the provider.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the Object Store.
    bucket_url str
    The endpoint of the Object Store. It is generated by the provider.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the Object Store.
    bucketUrl String
    The endpoint of the Object Store. It is generated by the provider.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Object Store.

    Look up Existing ObjectStore Resource

    Get an existing ObjectStore 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?: ObjectStoreState, opts?: CustomResourceOptions): ObjectStore
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_key_id: Optional[str] = None,
            bucket_url: Optional[str] = None,
            max_size_gb: Optional[int] = None,
            name: Optional[str] = None,
            region: Optional[str] = None,
            status: Optional[str] = None) -> ObjectStore
    func GetObjectStore(ctx *Context, name string, id IDInput, state *ObjectStoreState, opts ...ResourceOption) (*ObjectStore, error)
    public static ObjectStore Get(string name, Input<string> id, ObjectStoreState? state, CustomResourceOptions? opts = null)
    public static ObjectStore get(String name, Output<String> id, ObjectStoreState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccessKeyId string
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    BucketUrl string
    The endpoint of the Object Store. It is generated by the provider.
    MaxSizeGb int
    The maximum size of the Object Store. Default is 500GB.
    Name string
    The name of the Object Store. Must be unique.
    Region string
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    Status string
    The status of the Object Store.
    AccessKeyId string
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    BucketUrl string
    The endpoint of the Object Store. It is generated by the provider.
    MaxSizeGb int
    The maximum size of the Object Store. Default is 500GB.
    Name string
    The name of the Object Store. Must be unique.
    Region string
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    Status string
    The status of the Object Store.
    accessKeyId String
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    bucketUrl String
    The endpoint of the Object Store. It is generated by the provider.
    maxSizeGb Integer
    The maximum size of the Object Store. Default is 500GB.
    name String
    The name of the Object Store. Must be unique.
    region String
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    status String
    The status of the Object Store.
    accessKeyId string
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    bucketUrl string
    The endpoint of the Object Store. It is generated by the provider.
    maxSizeGb number
    The maximum size of the Object Store. Default is 500GB.
    name string
    The name of the Object Store. Must be unique.
    region string
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    status string
    The status of the Object Store.
    access_key_id str
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    bucket_url str
    The endpoint of the Object Store. It is generated by the provider.
    max_size_gb int
    The maximum size of the Object Store. Default is 500GB.
    name str
    The name of the Object Store. Must be unique.
    region str
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    status str
    The status of the Object Store.
    accessKeyId String
    The access key ID from the Object Store credential. If this is not set, a new credential will be created.
    bucketUrl String
    The endpoint of the Object Store. It is generated by the provider.
    maxSizeGb Number
    The maximum size of the Object Store. Default is 500GB.
    name String
    The name of the Object Store. Must be unique.
    region String
    The region for the Object Store, if not declared we use the region as declared in the provider (Defaults to LON1)
    status String
    The status of the Object Store.

    Import

    using ID

    $ pulumi import civo:index/objectStore:ObjectStore custom_object b8ecd2ab-2267-4a5e-8692-cbf1d32583e3
    

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

    Package Details

    Repository
    Civo pulumi/pulumi-civo
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the civo Terraform Provider.
    civo logo
    Civo v2.3.18 published on Tuesday, Jun 11, 2024 by Pulumi