@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
143 lines (142 loc) • 4.64 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Provides a key resource for Spaces, DigitalOcean's object storage product.
*
* The [Spaces API](https://docs.digitalocean.com/reference/api/spaces-api/) was
* designed to be interoperable with Amazon's AWS S3 API. This allows users to
* interact with the service while using the tools they already know. Spaces
* mirrors S3's authentication framework and requests to Spaces require a key pair
* similar to Amazon's Access ID and Secret Key.
*
* As a Spaces owner, you limit others’ access to your buckets using Spaces access
* keys. Access keys can provide several levels of permissions to create, destroy,
* read, and write to specific associated buckets. However, access keys only limit
* access to certain commands using the S3 API or CLI, not the control panel or
* other DigitalOcean resources.
*
* ## Example Usage
*
* ### Create a New Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const foobar = new digitalocean.SpacesKey("foobar", {name: "foobar"});
* ```
*
* ### Create a New Key with Grants
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const foobar = new digitalocean.SpacesKey("foobar", {
* name: "foobar",
* grants: [{
* bucket: "my-bucket",
* permission: "read",
* }],
* });
* ```
*
* ### Create a New Key with full access
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const foobar = new digitalocean.SpacesKey("foobar", {
* name: "foobar",
* grants: [{
* bucket: "",
* permission: "fullaccess",
* }],
* });
* ```
*/
export declare class SpacesKey extends pulumi.CustomResource {
/**
* Get an existing SpacesKey resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SpacesKeyState, opts?: pulumi.CustomResourceOptions): SpacesKey;
/**
* Returns true if the given object is an instance of SpacesKey. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is SpacesKey;
/**
* The access key ID of the key
*/
readonly accessKey: pulumi.Output<string>;
/**
* The creation time of the key
*/
readonly createdAt: pulumi.Output<string>;
/**
* A grant for the key (documented below).
*/
readonly grants: pulumi.Output<outputs.SpacesKeyGrant[] | undefined>;
/**
* The name of the key
*/
readonly name: pulumi.Output<string>;
/**
* The access key secret of the key
*/
readonly secretKey: pulumi.Output<string>;
/**
* Create a SpacesKey resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: SpacesKeyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering SpacesKey resources.
*/
export interface SpacesKeyState {
/**
* The access key ID of the key
*/
accessKey?: pulumi.Input<string>;
/**
* The creation time of the key
*/
createdAt?: pulumi.Input<string>;
/**
* A grant for the key (documented below).
*/
grants?: pulumi.Input<pulumi.Input<inputs.SpacesKeyGrant>[]>;
/**
* The name of the key
*/
name?: pulumi.Input<string>;
/**
* The access key secret of the key
*/
secretKey?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a SpacesKey resource.
*/
export interface SpacesKeyArgs {
/**
* A grant for the key (documented below).
*/
grants?: pulumi.Input<pulumi.Input<inputs.SpacesKeyGrant>[]>;
/**
* The name of the key
*/
name?: pulumi.Input<string>;
}