Class Secret
A Secret is a logical secret whose value and versions can be accessed.
To get more information about Secret, see:
Example Usage - Secret Config Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new Gcp.SecretManager.SecretArgs
{
Labels =
{
{ "label", "my-label" },
},
Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
{
UserManaged = new Gcp.SecretManager.Inputs.SecretReplicationUserManagedArgs
{
Replicas =
{
new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
{
Location = "us-central1",
},
new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
{
Location = "us-east1",
},
},
},
},
SecretId = "secret",
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.SecretManager
Assembly: Pulumi.Gcp.dll
Syntax
public class Secret : CustomResource
Constructors
View SourceSecret(String, SecretArgs, CustomResourceOptions)
Create a Secret resource with the given unique name, arguments, and options.
Declaration
public Secret(string name, SecretArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SecretArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCreateTime
The time at which the Secret was created.
Declaration
public Output<string> CreateTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Labels
The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}-]{0,62} Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}-]{0,63} No more than 64 labels can be assigned to a given resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
Name
The resource name of the Secret. Format: 'projects/{{project}}/secrets/{{secret_id}}'
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Replication
The replication policy of the secret data attached to the Secret. It cannot be changed after the Secret has been created. Structure is documented below.
Declaration
public Output<SecretReplication> Replication { get; }
Property Value
| Type | Description |
|---|---|
| Output<SecretReplication> |
SecretId
This must be unique within the project.
Declaration
public Output<string> SecretId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, SecretState, CustomResourceOptions)
Get an existing Secret resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Secret Get(string name, Input<string> id, SecretState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| SecretState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Secret |