civo.getObjectStoreCredential

Get information of an Object Store Credential for use in other resources. This data source provides all of the Object Store Credential’s properties as configured on your Civo account.

Note: This data source returns a single Object Store Credential. When specifying a name, an error will be raised if more than one Object Store Credentials with the same name found.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Civo = Pulumi.Civo;

return await Deployment.RunAsync(() => 
{
    var backupObjectStoreCredential = Civo.GetObjectStoreCredential.Invoke(new()
    {
        Name = "backup-server",
    });

    // Use the credential to create a bucket
    var backupObjectStore = new Civo.ObjectStore("backupObjectStore", new()
    {
        MaxSizeGb = 500,
        Region = "LON1",
        AccessKeyId = backupObjectStoreCredential.Apply(getObjectStoreCredentialResult => getObjectStoreCredentialResult.AccessKeyId),
    });

});
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 {
		backupObjectStoreCredential, err := civo.LookupObjectStoreCredential(ctx, &civo.LookupObjectStoreCredentialArgs{
			Name: pulumi.StringRef("backup-server"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = civo.NewObjectStore(ctx, "backupObjectStore", &civo.ObjectStoreArgs{
			MaxSizeGb:   pulumi.Int(500),
			Region:      pulumi.String("LON1"),
			AccessKeyId: *pulumi.String(backupObjectStoreCredential.AccessKeyId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.civo.CivoFunctions;
import com.pulumi.civo.inputs.GetObjectStoreCredentialArgs;
import com.pulumi.civo.ObjectStore;
import com.pulumi.civo.ObjectStoreArgs;
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 backupObjectStoreCredential = CivoFunctions.getObjectStoreCredential(GetObjectStoreCredentialArgs.builder()
            .name("backup-server")
            .build());

        var backupObjectStore = new ObjectStore("backupObjectStore", ObjectStoreArgs.builder()        
            .maxSizeGb(500)
            .region("LON1")
            .accessKeyId(backupObjectStoreCredential.applyValue(getObjectStoreCredentialResult -> getObjectStoreCredentialResult.accessKeyId()))
            .build());

    }
}
import pulumi
import pulumi_civo as civo

backup_object_store_credential = civo.get_object_store_credential(name="backup-server")
# Use the credential to create a bucket
backup_object_store = civo.ObjectStore("backupObjectStore",
    max_size_gb=500,
    region="LON1",
    access_key_id=backup_object_store_credential.access_key_id)
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const backupObjectStoreCredential = civo.getObjectStoreCredential({
    name: "backup-server",
});
// Use the credential to create a bucket
const backupObjectStore = new civo.ObjectStore("backupObjectStore", {
    maxSizeGb: 500,
    region: "LON1",
    accessKeyId: backupObjectStoreCredential.then(backupObjectStoreCredential => backupObjectStoreCredential.accessKeyId),
});
resources:
  # Use the credential to create a bucket
  backupObjectStore:
    type: civo:ObjectStore
    properties:
      maxSizeGb: 500
      region: LON1
      accessKeyId: ${backupObjectStoreCredential.accessKeyId}
variables:
  backupObjectStoreCredential:
    fn::invoke:
      Function: civo:getObjectStoreCredential
      Arguments:
        name: backup-server

Using getObjectStoreCredential

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getObjectStoreCredential(args: GetObjectStoreCredentialArgs, opts?: InvokeOptions): Promise<GetObjectStoreCredentialResult>
function getObjectStoreCredentialOutput(args: GetObjectStoreCredentialOutputArgs, opts?: InvokeOptions): Output<GetObjectStoreCredentialResult>
def get_object_store_credential(id: Optional[str] = None,
                                name: Optional[str] = None,
                                region: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetObjectStoreCredentialResult
def get_object_store_credential_output(id: Optional[pulumi.Input[str]] = None,
                                name: Optional[pulumi.Input[str]] = None,
                                region: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetObjectStoreCredentialResult]
func LookupObjectStoreCredential(ctx *Context, args *LookupObjectStoreCredentialArgs, opts ...InvokeOption) (*LookupObjectStoreCredentialResult, error)
func LookupObjectStoreCredentialOutput(ctx *Context, args *LookupObjectStoreCredentialOutputArgs, opts ...InvokeOption) LookupObjectStoreCredentialResultOutput

> Note: This function is named LookupObjectStoreCredential in the Go SDK.

public static class GetObjectStoreCredential 
{
    public static Task<GetObjectStoreCredentialResult> InvokeAsync(GetObjectStoreCredentialArgs args, InvokeOptions? opts = null)
    public static Output<GetObjectStoreCredentialResult> Invoke(GetObjectStoreCredentialInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetObjectStoreCredentialResult> getObjectStoreCredential(GetObjectStoreCredentialArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: civo:index/getObjectStoreCredential:getObjectStoreCredential
  arguments:
    # arguments dictionary

The following arguments are supported:

Id string

The ID of the Object Store Credential

Name string

The name of the Object Store Credential

Region string

The region of an existing Object Store

Id string

The ID of the Object Store Credential

Name string

The name of the Object Store Credential

Region string

The region of an existing Object Store

id String

The ID of the Object Store Credential

name String

The name of the Object Store Credential

region String

The region of an existing Object Store

id string

The ID of the Object Store Credential

name string

The name of the Object Store Credential

region string

The region of an existing Object Store

id str

The ID of the Object Store Credential

name str

The name of the Object Store Credential

region str

The region of an existing Object Store

id String

The ID of the Object Store Credential

name String

The name of the Object Store Credential

region String

The region of an existing Object Store

getObjectStoreCredential Result

The following output properties are available:

AccessKeyId string

The access key id of the Object Store Credential

SecretAccessKey string

The secret access key of the Object Store Credential

Status string

The status of the Object Store Credential

Id string

The ID of the Object Store Credential

Name string

The name of the Object Store Credential

Region string

The region of an existing Object Store

AccessKeyId string

The access key id of the Object Store Credential

SecretAccessKey string

The secret access key of the Object Store Credential

Status string

The status of the Object Store Credential

Id string

The ID of the Object Store Credential

Name string

The name of the Object Store Credential

Region string

The region of an existing Object Store

accessKeyId String

The access key id of the Object Store Credential

secretAccessKey String

The secret access key of the Object Store Credential

status String

The status of the Object Store Credential

id String

The ID of the Object Store Credential

name String

The name of the Object Store Credential

region String

The region of an existing Object Store

accessKeyId string

The access key id of the Object Store Credential

secretAccessKey string

The secret access key of the Object Store Credential

status string

The status of the Object Store Credential

id string

The ID of the Object Store Credential

name string

The name of the Object Store Credential

region string

The region of an existing Object Store

access_key_id str

The access key id of the Object Store Credential

secret_access_key str

The secret access key of the Object Store Credential

status str

The status of the Object Store Credential

id str

The ID of the Object Store Credential

name str

The name of the Object Store Credential

region str

The region of an existing Object Store

accessKeyId String

The access key id of the Object Store Credential

secretAccessKey String

The secret access key of the Object Store Credential

status String

The status of the Object Store Credential

id String

The ID of the Object Store Credential

name String

The name of the Object Store Credential

region String

The region of an existing Object Store

Package Details

Repository
Civo pulumi/pulumi-civo
License
Apache-2.0
Notes

This Pulumi package is based on the civo Terraform Provider.