gcp.secretmanager.SecretVersion
Explore with Pulumi AI
A secret version resource.
Warning: All arguments including
payload.secret_data
will be stored in the raw state as plain-text.
Example Usage
Secret Version Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new()
{
SecretId = "secret-version",
Labels =
{
{ "label", "my-label" },
},
Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
{
Auto = null,
},
});
var secret_version_basic = new Gcp.SecretManager.SecretVersion("secret-version-basic", new()
{
Secret = secret_basic.Id,
SecretData = "secret-data",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.NewSecret(ctx, "secret-basic", &secretmanager.SecretArgs{
SecretId: pulumi.String("secret-version"),
Labels: pulumi.StringMap{
"label": pulumi.String("my-label"),
},
Replication: &secretmanager.SecretReplicationArgs{
Auto: nil,
},
})
if err != nil {
return err
}
_, err = secretmanager.NewSecretVersion(ctx, "secret-version-basic", &secretmanager.SecretVersionArgs{
Secret: secret_basic.ID(),
SecretData: pulumi.String("secret-data"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.Secret;
import com.pulumi.gcp.secretmanager.SecretArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
import com.pulumi.gcp.secretmanager.SecretVersion;
import com.pulumi.gcp.secretmanager.SecretVersionArgs;
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) {
var secret_basic = new Secret("secret-basic", SecretArgs.builder()
.secretId("secret-version")
.labels(Map.of("label", "my-label"))
.replication(SecretReplicationArgs.builder()
.auto()
.build())
.build());
var secret_version_basic = new SecretVersion("secret-version-basic", SecretVersionArgs.builder()
.secret(secret_basic.id())
.secretData("secret-data")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
secret_basic = gcp.secretmanager.Secret("secret-basic",
secret_id="secret-version",
labels={
"label": "my-label",
},
replication=gcp.secretmanager.SecretReplicationArgs(
auto=gcp.secretmanager.SecretReplicationAutoArgs(),
))
secret_version_basic = gcp.secretmanager.SecretVersion("secret-version-basic",
secret=secret_basic.id,
secret_data="secret-data")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
secretId: "secret-version",
labels: {
label: "my-label",
},
replication: {
auto: {},
},
});
const secret_version_basic = new gcp.secretmanager.SecretVersion("secret-version-basic", {
secret: secret_basic.id,
secretData: "secret-data",
});
resources:
secret-basic:
type: gcp:secretmanager:Secret
properties:
secretId: secret-version
labels:
label: my-label
replication:
auto: {}
secret-version-basic:
type: gcp:secretmanager:SecretVersion
properties:
secret: ${["secret-basic"].id}
secretData: secret-data
Secret Version Deletion Policy Abandon
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new()
{
SecretId = "secret-version",
Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
{
UserManaged = new Gcp.SecretManager.Inputs.SecretReplicationUserManagedArgs
{
Replicas = new[]
{
new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
{
Location = "us-central1",
},
},
},
},
});
var secret_version_deletion_policy = new Gcp.SecretManager.SecretVersion("secret-version-deletion-policy", new()
{
Secret = secret_basic.Id,
SecretData = "secret-data",
DeletionPolicy = "ABANDON",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.NewSecret(ctx, "secret-basic", &secretmanager.SecretArgs{
SecretId: pulumi.String("secret-version"),
Replication: &secretmanager.SecretReplicationArgs{
UserManaged: &secretmanager.SecretReplicationUserManagedArgs{
Replicas: secretmanager.SecretReplicationUserManagedReplicaArray{
&secretmanager.SecretReplicationUserManagedReplicaArgs{
Location: pulumi.String("us-central1"),
},
},
},
},
})
if err != nil {
return err
}
_, err = secretmanager.NewSecretVersion(ctx, "secret-version-deletion-policy", &secretmanager.SecretVersionArgs{
Secret: secret_basic.ID(),
SecretData: pulumi.String("secret-data"),
DeletionPolicy: pulumi.String("ABANDON"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.Secret;
import com.pulumi.gcp.secretmanager.SecretArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationUserManagedArgs;
import com.pulumi.gcp.secretmanager.SecretVersion;
import com.pulumi.gcp.secretmanager.SecretVersionArgs;
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) {
var secret_basic = new Secret("secret-basic", SecretArgs.builder()
.secretId("secret-version")
.replication(SecretReplicationArgs.builder()
.userManaged(SecretReplicationUserManagedArgs.builder()
.replicas(SecretReplicationUserManagedReplicaArgs.builder()
.location("us-central1")
.build())
.build())
.build())
.build());
var secret_version_deletion_policy = new SecretVersion("secret-version-deletion-policy", SecretVersionArgs.builder()
.secret(secret_basic.id())
.secretData("secret-data")
.deletionPolicy("ABANDON")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
secret_basic = gcp.secretmanager.Secret("secret-basic",
secret_id="secret-version",
replication=gcp.secretmanager.SecretReplicationArgs(
user_managed=gcp.secretmanager.SecretReplicationUserManagedArgs(
replicas=[gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
location="us-central1",
)],
),
))
secret_version_deletion_policy = gcp.secretmanager.SecretVersion("secret-version-deletion-policy",
secret=secret_basic.id,
secret_data="secret-data",
deletion_policy="ABANDON")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
secretId: "secret-version",
replication: {
userManaged: {
replicas: [{
location: "us-central1",
}],
},
},
});
const secret_version_deletion_policy = new gcp.secretmanager.SecretVersion("secret-version-deletion-policy", {
secret: secret_basic.id,
secretData: "secret-data",
deletionPolicy: "ABANDON",
});
resources:
secret-basic:
type: gcp:secretmanager:Secret
properties:
secretId: secret-version
replication:
userManaged:
replicas:
- location: us-central1
secret-version-deletion-policy:
type: gcp:secretmanager:SecretVersion
properties:
secret: ${["secret-basic"].id}
secretData: secret-data
deletionPolicy: ABANDON
Secret Version Deletion Policy Disable
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new()
{
SecretId = "secret-version",
Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
{
UserManaged = new Gcp.SecretManager.Inputs.SecretReplicationUserManagedArgs
{
Replicas = new[]
{
new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
{
Location = "us-central1",
},
},
},
},
});
var secret_version_deletion_policy = new Gcp.SecretManager.SecretVersion("secret-version-deletion-policy", new()
{
Secret = secret_basic.Id,
SecretData = "secret-data",
DeletionPolicy = "DISABLE",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.NewSecret(ctx, "secret-basic", &secretmanager.SecretArgs{
SecretId: pulumi.String("secret-version"),
Replication: &secretmanager.SecretReplicationArgs{
UserManaged: &secretmanager.SecretReplicationUserManagedArgs{
Replicas: secretmanager.SecretReplicationUserManagedReplicaArray{
&secretmanager.SecretReplicationUserManagedReplicaArgs{
Location: pulumi.String("us-central1"),
},
},
},
},
})
if err != nil {
return err
}
_, err = secretmanager.NewSecretVersion(ctx, "secret-version-deletion-policy", &secretmanager.SecretVersionArgs{
Secret: secret_basic.ID(),
SecretData: pulumi.String("secret-data"),
DeletionPolicy: pulumi.String("DISABLE"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.Secret;
import com.pulumi.gcp.secretmanager.SecretArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationUserManagedArgs;
import com.pulumi.gcp.secretmanager.SecretVersion;
import com.pulumi.gcp.secretmanager.SecretVersionArgs;
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) {
var secret_basic = new Secret("secret-basic", SecretArgs.builder()
.secretId("secret-version")
.replication(SecretReplicationArgs.builder()
.userManaged(SecretReplicationUserManagedArgs.builder()
.replicas(SecretReplicationUserManagedReplicaArgs.builder()
.location("us-central1")
.build())
.build())
.build())
.build());
var secret_version_deletion_policy = new SecretVersion("secret-version-deletion-policy", SecretVersionArgs.builder()
.secret(secret_basic.id())
.secretData("secret-data")
.deletionPolicy("DISABLE")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
secret_basic = gcp.secretmanager.Secret("secret-basic",
secret_id="secret-version",
replication=gcp.secretmanager.SecretReplicationArgs(
user_managed=gcp.secretmanager.SecretReplicationUserManagedArgs(
replicas=[gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
location="us-central1",
)],
),
))
secret_version_deletion_policy = gcp.secretmanager.SecretVersion("secret-version-deletion-policy",
secret=secret_basic.id,
secret_data="secret-data",
deletion_policy="DISABLE")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
secretId: "secret-version",
replication: {
userManaged: {
replicas: [{
location: "us-central1",
}],
},
},
});
const secret_version_deletion_policy = new gcp.secretmanager.SecretVersion("secret-version-deletion-policy", {
secret: secret_basic.id,
secretData: "secret-data",
deletionPolicy: "DISABLE",
});
resources:
secret-basic:
type: gcp:secretmanager:Secret
properties:
secretId: secret-version
replication:
userManaged:
replicas:
- location: us-central1
secret-version-deletion-policy:
type: gcp:secretmanager:SecretVersion
properties:
secret: ${["secret-basic"].id}
secretData: secret-data
deletionPolicy: DISABLE
Secret Version With Base64 String Secret Data
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
private static string ReadFileBase64(string path) {
return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path)));
}
return await Deployment.RunAsync(() =>
{
var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new()
{
SecretId = "secret-version",
Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
{
UserManaged = new Gcp.SecretManager.Inputs.SecretReplicationUserManagedArgs
{
Replicas = new[]
{
new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
{
Location = "us-central1",
},
},
},
},
});
var secret_version_base64 = new Gcp.SecretManager.SecretVersion("secret-version-base64", new()
{
Secret = secret_basic.Id,
IsSecretDataBase64 = true,
SecretData = ReadFileBase64("secret-data.pfx"),
});
});
package main
import (
"encoding/base64"
"os"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func filebase64OrPanic(path string) pulumi.StringPtrInput {
if fileData, err := os.ReadFile(path); err == nil {
return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
} else {
panic(err.Error())
}
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.NewSecret(ctx, "secret-basic", &secretmanager.SecretArgs{
SecretId: pulumi.String("secret-version"),
Replication: &secretmanager.SecretReplicationArgs{
UserManaged: &secretmanager.SecretReplicationUserManagedArgs{
Replicas: secretmanager.SecretReplicationUserManagedReplicaArray{
&secretmanager.SecretReplicationUserManagedReplicaArgs{
Location: pulumi.String("us-central1"),
},
},
},
},
})
if err != nil {
return err
}
_, err = secretmanager.NewSecretVersion(ctx, "secret-version-base64", &secretmanager.SecretVersionArgs{
Secret: secret_basic.ID(),
IsSecretDataBase64: pulumi.Bool(true),
SecretData: filebase64OrPanic("secret-data.pfx"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.Secret;
import com.pulumi.gcp.secretmanager.SecretArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationUserManagedArgs;
import com.pulumi.gcp.secretmanager.SecretVersion;
import com.pulumi.gcp.secretmanager.SecretVersionArgs;
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) {
var secret_basic = new Secret("secret-basic", SecretArgs.builder()
.secretId("secret-version")
.replication(SecretReplicationArgs.builder()
.userManaged(SecretReplicationUserManagedArgs.builder()
.replicas(SecretReplicationUserManagedReplicaArgs.builder()
.location("us-central1")
.build())
.build())
.build())
.build());
var secret_version_base64 = new SecretVersion("secret-version-base64", SecretVersionArgs.builder()
.secret(secret_basic.id())
.isSecretDataBase64(true)
.secretData(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("secret-data.pfx"))))
.build());
}
}
import pulumi
import base64
import pulumi_gcp as gcp
secret_basic = gcp.secretmanager.Secret("secret-basic",
secret_id="secret-version",
replication=gcp.secretmanager.SecretReplicationArgs(
user_managed=gcp.secretmanager.SecretReplicationUserManagedArgs(
replicas=[gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
location="us-central1",
)],
),
))
secret_version_base64 = gcp.secretmanager.SecretVersion("secret-version-base64",
secret=secret_basic.id,
is_secret_data_base64=True,
secret_data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("secret-data.pfx"))
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as gcp from "@pulumi/gcp";
const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
secretId: "secret-version",
replication: {
userManaged: {
replicas: [{
location: "us-central1",
}],
},
},
});
const secret_version_base64 = new gcp.secretmanager.SecretVersion("secret-version-base64", {
secret: secret_basic.id,
isSecretDataBase64: true,
secretData: Buffer.from(fs.readFileSync("secret-data.pfx"), 'binary').toString('base64'),
});
Coming soon!
Create SecretVersion Resource
new SecretVersion(name: string, args: SecretVersionArgs, opts?: CustomResourceOptions);
@overload
def SecretVersion(resource_name: str,
opts: Optional[ResourceOptions] = None,
deletion_policy: Optional[str] = None,
enabled: Optional[bool] = None,
is_secret_data_base64: Optional[bool] = None,
secret: Optional[str] = None,
secret_data: Optional[str] = None)
@overload
def SecretVersion(resource_name: str,
args: SecretVersionArgs,
opts: Optional[ResourceOptions] = None)
func NewSecretVersion(ctx *Context, name string, args SecretVersionArgs, opts ...ResourceOption) (*SecretVersion, error)
public SecretVersion(string name, SecretVersionArgs args, CustomResourceOptions? opts = null)
public SecretVersion(String name, SecretVersionArgs args)
public SecretVersion(String name, SecretVersionArgs args, CustomResourceOptions options)
type: gcp:secretmanager:SecretVersion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecretVersionArgs
- 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 SecretVersionArgs
- 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 SecretVersionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecretVersionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecretVersionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
SecretVersion Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The SecretVersion resource accepts the following input properties:
- Secret string
Secret Manager secret resource
- Secret
Data string The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- Deletion
Policy string The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- Enabled bool
The current state of the SecretVersion.
- Is
Secret boolData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- Secret string
Secret Manager secret resource
- Secret
Data string The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- Deletion
Policy string The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- Enabled bool
The current state of the SecretVersion.
- Is
Secret boolData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- secret String
Secret Manager secret resource
- secret
Data String The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- deletion
Policy String The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- enabled Boolean
The current state of the SecretVersion.
- is
Secret BooleanData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- secret string
Secret Manager secret resource
- secret
Data string The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- deletion
Policy string The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- enabled boolean
The current state of the SecretVersion.
- is
Secret booleanData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- secret str
Secret Manager secret resource
- secret_
data str The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- deletion_
policy str The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- enabled bool
The current state of the SecretVersion.
- is_
secret_ booldata_ base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- secret String
Secret Manager secret resource
- secret
Data String The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- deletion
Policy String The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- enabled Boolean
The current state of the SecretVersion.
- is
Secret BooleanData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
Outputs
All input properties are implicitly available as output properties. Additionally, the SecretVersion resource produces the following output properties:
- Create
Time string The time at which the Secret was created.
- Destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- Version string
The version of the Secret.
- Create
Time string The time at which the Secret was created.
- Destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- Version string
The version of the Secret.
- create
Time String The time at which the Secret was created.
- destroy
Time String The time at which the Secret was destroyed. Only present if state is DESTROYED.
- id String
The provider-assigned unique ID for this managed resource.
- name String
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- version String
The version of the Secret.
- create
Time string The time at which the Secret was created.
- destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- id string
The provider-assigned unique ID for this managed resource.
- name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- version string
The version of the Secret.
- create_
time str The time at which the Secret was created.
- destroy_
time str The time at which the Secret was destroyed. Only present if state is DESTROYED.
- id str
The provider-assigned unique ID for this managed resource.
- name str
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- version str
The version of the Secret.
- create
Time String The time at which the Secret was created.
- destroy
Time String The time at which the Secret was destroyed. Only present if state is DESTROYED.
- id String
The provider-assigned unique ID for this managed resource.
- name String
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- version String
The version of the Secret.
Look up Existing SecretVersion Resource
Get an existing SecretVersion 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?: SecretVersionState, opts?: CustomResourceOptions): SecretVersion
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
deletion_policy: Optional[str] = None,
destroy_time: Optional[str] = None,
enabled: Optional[bool] = None,
is_secret_data_base64: Optional[bool] = None,
name: Optional[str] = None,
secret: Optional[str] = None,
secret_data: Optional[str] = None,
version: Optional[str] = None) -> SecretVersion
func GetSecretVersion(ctx *Context, name string, id IDInput, state *SecretVersionState, opts ...ResourceOption) (*SecretVersion, error)
public static SecretVersion Get(string name, Input<string> id, SecretVersionState? state, CustomResourceOptions? opts = null)
public static SecretVersion get(String name, Output<String> id, SecretVersionState 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.
- Create
Time string The time at which the Secret was created.
- Deletion
Policy string The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- Destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- Enabled bool
The current state of the SecretVersion.
- Is
Secret boolData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- Name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- Secret string
Secret Manager secret resource
- Secret
Data string The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- Version string
The version of the Secret.
- Create
Time string The time at which the Secret was created.
- Deletion
Policy string The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- Destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- Enabled bool
The current state of the SecretVersion.
- Is
Secret boolData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- Name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- Secret string
Secret Manager secret resource
- Secret
Data string The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- Version string
The version of the Secret.
- create
Time String The time at which the Secret was created.
- deletion
Policy String The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- destroy
Time String The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled Boolean
The current state of the SecretVersion.
- is
Secret BooleanData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- name String
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- secret String
Secret Manager secret resource
- secret
Data String The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- version String
The version of the Secret.
- create
Time string The time at which the Secret was created.
- deletion
Policy string The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- destroy
Time string The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled boolean
The current state of the SecretVersion.
- is
Secret booleanData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- name string
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- secret string
Secret Manager secret resource
- secret
Data string The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- version string
The version of the Secret.
- create_
time str The time at which the Secret was created.
- deletion_
policy str The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- destroy_
time str The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled bool
The current state of the SecretVersion.
- is_
secret_ booldata_ base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- name str
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- secret str
Secret Manager secret resource
- secret_
data str The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- version str
The version of the Secret.
- create
Time String The time at which the Secret was created.
- deletion
Policy String The deletion policy for the secret version. Setting
ABANDON
allows the resource to be abandoned rather than deleted. SettingDISABLE
allows the resource to be disabled rather than deleted. Default isDELETE
. Possible values are:- DELETE
- DISABLE
- ABANDON
- destroy
Time String The time at which the Secret was destroyed. Only present if state is DESTROYED.
- enabled Boolean
The current state of the SecretVersion.
- is
Secret BooleanData Base64 If set to 'true', the secret data is expected to be base64-encoded string and would be sent as is.
- name String
The resource name of the SecretVersion. Format:
projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
- secret String
Secret Manager secret resource
- secret
Data String The secret data. Must be no larger than 64KiB. Note: This property is sensitive and will not be displayed in the plan.
- version String
The version of the Secret.
Import
SecretVersion can be imported using any of these accepted formats* projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
In Terraform v1.5.0 and later, use an import
block to import SecretVersion using one of the formats above. For exampletf import {
id = “projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}”
to = google_secret_manager_secret_version.default }
$ pulumi import gcp:secretmanager/secretVersion:SecretVersion When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), SecretVersion can be imported using one of the formats above. For example
$ pulumi import gcp:secretmanager/secretVersion:SecretVersion default projects/{{project}}/secrets/{{secret_id}}/versions/{{version}}
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.