@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
165 lines (164 loc) • 5.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The hmacKeys resource represents an HMAC key within Cloud Storage. The resource
* consists of a secret and HMAC key metadata. HMAC keys can be used as credentials
* for service accounts.
*
* To get more information about HmacKey, see:
*
* * [API documentation](https://cloud.google.com/storage/docs/json_api/v1/projects/hmacKeys)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/storage/docs/authentication/managing-hmackeys)
*
* ## Example Usage
*
* ### Storage Hmac Key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* // Create a new service account
* const serviceAccount = new gcp.serviceaccount.Account("service_account", {accountId: "my-svc-acc"});
* //Create the HMAC key for the associated service account
* const key = new gcp.storage.HmacKey("key", {serviceAccountEmail: serviceAccount.email});
* ```
*
* ## Import
*
* HmacKey can be imported using any of these accepted formats:
*
* * `projects/{{project}}/hmacKeys/{{access_id}}`
*
* * `{{project}}/{{access_id}}`
*
* * `{{access_id}}`
*
* When using the `pulumi import` command, HmacKey can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:storage/hmacKey:HmacKey default projects/{{project}}/hmacKeys/{{access_id}}
* ```
*
* ```sh
* $ pulumi import gcp:storage/hmacKey:HmacKey default {{project}}/{{access_id}}
* ```
*
* ```sh
* $ pulumi import gcp:storage/hmacKey:HmacKey default {{access_id}}
* ```
*/
export declare class HmacKey extends pulumi.CustomResource {
/**
* Get an existing HmacKey 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?: HmacKeyState, opts?: pulumi.CustomResourceOptions): HmacKey;
/**
* Returns true if the given object is an instance of HmacKey. 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 HmacKey;
/**
* The access ID of the HMAC Key.
*/
readonly accessId: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* HMAC secret key material.
* **Note**: This property is sensitive and will not be displayed in the plan.
*/
readonly secret: pulumi.Output<string>;
/**
* The email address of the key's associated service account.
*/
readonly serviceAccountEmail: pulumi.Output<string>;
/**
* The state of the key. Can be set to one of ACTIVE, INACTIVE.
* Default value is `ACTIVE`.
* Possible values are: `ACTIVE`, `INACTIVE`.
*/
readonly state: pulumi.Output<string | undefined>;
/**
* 'The creation time of the HMAC key in RFC 3339 format. '
*/
readonly timeCreated: pulumi.Output<string>;
/**
* 'The last modification time of the HMAC key metadata in RFC 3339 format.'
*/
readonly updated: pulumi.Output<string>;
/**
* Create a HmacKey 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: HmacKeyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering HmacKey resources.
*/
export interface HmacKeyState {
/**
* The access ID of the HMAC Key.
*/
accessId?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* HMAC secret key material.
* **Note**: This property is sensitive and will not be displayed in the plan.
*/
secret?: pulumi.Input<string>;
/**
* The email address of the key's associated service account.
*/
serviceAccountEmail?: pulumi.Input<string>;
/**
* The state of the key. Can be set to one of ACTIVE, INACTIVE.
* Default value is `ACTIVE`.
* Possible values are: `ACTIVE`, `INACTIVE`.
*/
state?: pulumi.Input<string>;
/**
* 'The creation time of the HMAC key in RFC 3339 format. '
*/
timeCreated?: pulumi.Input<string>;
/**
* 'The last modification time of the HMAC key metadata in RFC 3339 format.'
*/
updated?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a HmacKey resource.
*/
export interface HmacKeyArgs {
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The email address of the key's associated service account.
*/
serviceAccountEmail: pulumi.Input<string>;
/**
* The state of the key. Can be set to one of ACTIVE, INACTIVE.
* Default value is `ACTIVE`.
* Possible values are: `ACTIVE`, `INACTIVE`.
*/
state?: pulumi.Input<string>;
}