civo.getObjectStoreCredential
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
// Read a credential for the object store
const backup = civo.getObjectStoreCredential({
name: "backup-server",
});
// Use the credential to create a bucket
const backupObjectStore = new civo.ObjectStore("backup", {
name: "backup-server",
maxSizeGb: 500,
region: "LON1",
accessKeyId: backup.then(backup => backup.accessKeyId),
});
import pulumi
import pulumi_civo as civo
# Read a credential for the object store
backup = civo.get_object_store_credential(name="backup-server")
# Use the credential to create a bucket
backup_object_store = civo.ObjectStore("backup",
name="backup-server",
max_size_gb=500,
region="LON1",
access_key_id=backup.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 {
// Read a credential for the object store
backup, err := civo.LookupObjectStoreCredential(ctx, &civo.LookupObjectStoreCredentialArgs{
Name: pulumi.StringRef("backup-server"),
}, nil)
if err != nil {
return err
}
// Use the credential to create a bucket
_, err = civo.NewObjectStore(ctx, "backup", &civo.ObjectStoreArgs{
Name: pulumi.String("backup-server"),
MaxSizeGb: pulumi.Int(500),
Region: pulumi.String("LON1"),
AccessKeyId: pulumi.String(backup.AccessKeyId),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Civo = Pulumi.Civo;
return await Deployment.RunAsync(() =>
{
// Read a credential for the object store
var backup = Civo.GetObjectStoreCredential.Invoke(new()
{
Name = "backup-server",
});
// Use the credential to create a bucket
var backupObjectStore = new Civo.ObjectStore("backup", new()
{
Name = "backup-server",
MaxSizeGb = 500,
Region = "LON1",
AccessKeyId = backup.Apply(getObjectStoreCredentialResult => getObjectStoreCredentialResult.AccessKeyId),
});
});
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) {
// Read a credential for the object store
final var backup = CivoFunctions.getObjectStoreCredential(GetObjectStoreCredentialArgs.builder()
.name("backup-server")
.build());
// Use the credential to create a bucket
var backupObjectStore = new ObjectStore("backupObjectStore", ObjectStoreArgs.builder()
.name("backup-server")
.maxSizeGb(500)
.region("LON1")
.accessKeyId(backup.applyValue(getObjectStoreCredentialResult -> getObjectStoreCredentialResult.accessKeyId()))
.build());
}
}
resources:
# Use the credential to create a bucket
backupObjectStore:
type: civo:ObjectStore
name: backup
properties:
name: backup-server
maxSizeGb: 500
region: LON1
accessKeyId: ${backup.accessKeyId}
variables:
# Read a credential for the object store
backup:
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:
getObjectStoreCredential Result
The following output properties are available:
- Access
Key stringId - The access key id of the Object Store Credential
- Secret
Access stringKey - 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 stringId - The access key id of the Object Store Credential
- Secret
Access stringKey - 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 StringId - The access key id of the Object Store Credential
- secret
Access StringKey - 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 stringId - The access key id of the Object Store Credential
- secret
Access stringKey - 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_ strid - The access key id of the Object Store Credential
- secret_
access_ strkey - 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
- access
Key StringId - The access key id of the Object Store Credential
- secret
Access StringKey - 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.