civo.ObjectStoreCredential
Explore with Pulumi AI
Provides an Object Store Credential resource. This can be used to create, modify, and delete object stores credential.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";
// Create a simple credential for the object store
const backup = civo.getObjectStoreCredential({
name: "backup-server",
});
// Create a credential for the object store with a specific access key and secret key
const backupObjectStoreCredential = new civo.ObjectStoreCredential("backup", {
name: "backup-server",
accessKeyId: "my-access-key",
secretAccessKey: "my-secret-key",
});
// Use the credential to create a bucket
const backupObjectStore = new civo.ObjectStore("backup", {
name: "backup-server",
maxSizeGb: 500,
region: "LON1",
accessKeyId: backupObjectStoreCredential.accessKeyId,
});
import pulumi
import pulumi_civo as civo
# Create a simple credential for the object store
backup = civo.get_object_store_credential(name="backup-server")
# Create a credential for the object store with a specific access key and secret key
backup_object_store_credential = civo.ObjectStoreCredential("backup",
name="backup-server",
access_key_id="my-access-key",
secret_access_key="my-secret-key")
# 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_object_store_credential.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 {
// Create a simple credential for the object store
_, err := civo.LookupObjectStoreCredential(ctx, &civo.LookupObjectStoreCredentialArgs{
Name: pulumi.StringRef("backup-server"),
}, nil)
if err != nil {
return err
}
// Create a credential for the object store with a specific access key and secret key
backupObjectStoreCredential, err := civo.NewObjectStoreCredential(ctx, "backup", &civo.ObjectStoreCredentialArgs{
Name: pulumi.String("backup-server"),
AccessKeyId: pulumi.String("my-access-key"),
SecretAccessKey: pulumi.String("my-secret-key"),
})
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: backupObjectStoreCredential.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(() =>
{
// Create a simple credential for the object store
var backup = Civo.GetObjectStoreCredential.Invoke(new()
{
Name = "backup-server",
});
// Create a credential for the object store with a specific access key and secret key
var backupObjectStoreCredential = new Civo.ObjectStoreCredential("backup", new()
{
Name = "backup-server",
AccessKeyId = "my-access-key",
SecretAccessKey = "my-secret-key",
});
// Use the credential to create a bucket
var backupObjectStore = new Civo.ObjectStore("backup", new()
{
Name = "backup-server",
MaxSizeGb = 500,
Region = "LON1",
AccessKeyId = backupObjectStoreCredential.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.ObjectStoreCredential;
import com.pulumi.civo.ObjectStoreCredentialArgs;
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) {
// Create a simple credential for the object store
final var backup = CivoFunctions.getObjectStoreCredential(GetObjectStoreCredentialArgs.builder()
.name("backup-server")
.build());
// Create a credential for the object store with a specific access key and secret key
var backupObjectStoreCredential = new ObjectStoreCredential("backupObjectStoreCredential", ObjectStoreCredentialArgs.builder()
.name("backup-server")
.accessKeyId("my-access-key")
.secretAccessKey("my-secret-key")
.build());
// Use the credential to create a bucket
var backupObjectStore = new ObjectStore("backupObjectStore", ObjectStoreArgs.builder()
.name("backup-server")
.maxSizeGb(500)
.region("LON1")
.accessKeyId(backupObjectStoreCredential.accessKeyId())
.build());
}
}
resources:
# Create a credential for the object store with a specific access key and secret key
backupObjectStoreCredential:
type: civo:ObjectStoreCredential
name: backup
properties:
name: backup-server
accessKeyId: my-access-key
secretAccessKey: my-secret-key
# Use the credential to create a bucket
backupObjectStore:
type: civo:ObjectStore
name: backup
properties:
name: backup-server
maxSizeGb: 500
region: LON1
accessKeyId: ${backupObjectStoreCredential.accessKeyId}
variables:
# Create a simple credential for the object store
backup:
fn::invoke:
Function: civo:getObjectStoreCredential
Arguments:
name: backup-server
Create ObjectStoreCredential Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ObjectStoreCredential(name: string, args?: ObjectStoreCredentialArgs, opts?: CustomResourceOptions);
@overload
def ObjectStoreCredential(resource_name: str,
args: Optional[ObjectStoreCredentialArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def ObjectStoreCredential(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_key_id: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
secret_access_key: Optional[str] = None)
func NewObjectStoreCredential(ctx *Context, name string, args *ObjectStoreCredentialArgs, opts ...ResourceOption) (*ObjectStoreCredential, error)
public ObjectStoreCredential(string name, ObjectStoreCredentialArgs? args = null, CustomResourceOptions? opts = null)
public ObjectStoreCredential(String name, ObjectStoreCredentialArgs args)
public ObjectStoreCredential(String name, ObjectStoreCredentialArgs args, CustomResourceOptions options)
type: civo:ObjectStoreCredential
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 ObjectStoreCredentialArgs
- 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 ObjectStoreCredentialArgs
- 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 ObjectStoreCredentialArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ObjectStoreCredentialArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ObjectStoreCredentialArgs
- 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 objectStoreCredentialResource = new Civo.ObjectStoreCredential("objectStoreCredentialResource", new()
{
AccessKeyId = "string",
Name = "string",
Region = "string",
SecretAccessKey = "string",
});
example, err := civo.NewObjectStoreCredential(ctx, "objectStoreCredentialResource", &civo.ObjectStoreCredentialArgs{
AccessKeyId: pulumi.String("string"),
Name: pulumi.String("string"),
Region: pulumi.String("string"),
SecretAccessKey: pulumi.String("string"),
})
var objectStoreCredentialResource = new ObjectStoreCredential("objectStoreCredentialResource", ObjectStoreCredentialArgs.builder()
.accessKeyId("string")
.name("string")
.region("string")
.secretAccessKey("string")
.build());
object_store_credential_resource = civo.ObjectStoreCredential("objectStoreCredentialResource",
access_key_id="string",
name="string",
region="string",
secret_access_key="string")
const objectStoreCredentialResource = new civo.ObjectStoreCredential("objectStoreCredentialResource", {
accessKeyId: "string",
name: "string",
region: "string",
secretAccessKey: "string",
});
type: civo:ObjectStoreCredential
properties:
accessKeyId: string
name: string
region: string
secretAccessKey: string
ObjectStoreCredential 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 ObjectStoreCredential resource accepts the following input properties:
- Access
Key stringId - The access key id of the Object Store Credential. It is generated by the provider.
- Name string
- The name of the Object Store Credential. Must be unique.
- Region string
- The region where the Object Store Credential will be created.
- Secret
Access stringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- Access
Key stringId - The access key id of the Object Store Credential. It is generated by the provider.
- Name string
- The name of the Object Store Credential. Must be unique.
- Region string
- The region where the Object Store Credential will be created.
- Secret
Access stringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- access
Key StringId - The access key id of the Object Store Credential. It is generated by the provider.
- name String
- The name of the Object Store Credential. Must be unique.
- region String
- The region where the Object Store Credential will be created.
- secret
Access StringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- access
Key stringId - The access key id of the Object Store Credential. It is generated by the provider.
- name string
- The name of the Object Store Credential. Must be unique.
- region string
- The region where the Object Store Credential will be created.
- secret
Access stringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- access_
key_ strid - The access key id of the Object Store Credential. It is generated by the provider.
- name str
- The name of the Object Store Credential. Must be unique.
- region str
- The region where the Object Store Credential will be created.
- secret_
access_ strkey - The secret access key of the Object Store Credential. It is generated by the provider.
- access
Key StringId - The access key id of the Object Store Credential. It is generated by the provider.
- name String
- The name of the Object Store Credential. Must be unique.
- region String
- The region where the Object Store Credential will be created.
- secret
Access StringKey - The secret access key of the Object Store Credential. It is generated by the provider.
Outputs
All input properties are implicitly available as output properties. Additionally, the ObjectStoreCredential resource produces the following output properties:
Look up Existing ObjectStoreCredential Resource
Get an existing ObjectStoreCredential 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?: ObjectStoreCredentialState, opts?: CustomResourceOptions): ObjectStoreCredential
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_key_id: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
secret_access_key: Optional[str] = None,
status: Optional[str] = None) -> ObjectStoreCredential
func GetObjectStoreCredential(ctx *Context, name string, id IDInput, state *ObjectStoreCredentialState, opts ...ResourceOption) (*ObjectStoreCredential, error)
public static ObjectStoreCredential Get(string name, Input<string> id, ObjectStoreCredentialState? state, CustomResourceOptions? opts = null)
public static ObjectStoreCredential get(String name, Output<String> id, ObjectStoreCredentialState 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.
- Access
Key stringId - The access key id of the Object Store Credential. It is generated by the provider.
- Name string
- The name of the Object Store Credential. Must be unique.
- Region string
- The region where the Object Store Credential will be created.
- Secret
Access stringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- Status string
- The status of the Object Store Credential.
- Access
Key stringId - The access key id of the Object Store Credential. It is generated by the provider.
- Name string
- The name of the Object Store Credential. Must be unique.
- Region string
- The region where the Object Store Credential will be created.
- Secret
Access stringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- Status string
- The status of the Object Store Credential.
- access
Key StringId - The access key id of the Object Store Credential. It is generated by the provider.
- name String
- The name of the Object Store Credential. Must be unique.
- region String
- The region where the Object Store Credential will be created.
- secret
Access StringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- status String
- The status of the Object Store Credential.
- access
Key stringId - The access key id of the Object Store Credential. It is generated by the provider.
- name string
- The name of the Object Store Credential. Must be unique.
- region string
- The region where the Object Store Credential will be created.
- secret
Access stringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- status string
- The status of the Object Store Credential.
- access_
key_ strid - The access key id of the Object Store Credential. It is generated by the provider.
- name str
- The name of the Object Store Credential. Must be unique.
- region str
- The region where the Object Store Credential will be created.
- secret_
access_ strkey - The secret access key of the Object Store Credential. It is generated by the provider.
- status str
- The status of the Object Store Credential.
- access
Key StringId - The access key id of the Object Store Credential. It is generated by the provider.
- name String
- The name of the Object Store Credential. Must be unique.
- region String
- The region where the Object Store Credential will be created.
- secret
Access StringKey - The secret access key of the Object Store Credential. It is generated by the provider.
- status String
- The status of the Object Store Credential.
Import
using ID
$ pulumi import civo:index/objectStoreCredential:ObjectStoreCredential 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.