gcp.secretmanager.SecretVersion
Explore with Pulumi AI
A secret version resource.
Example Usage
Secret Version Basic
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",
});
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")
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
})
}
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 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());
}
}
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
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",
});
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")
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
})
}
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 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());
}
}
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
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",
});
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")
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
})
}
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 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());
}
}
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
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as std from "@pulumi/std";
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: std.filebase64({
input: "secret-data.pfx",
}).then(invoke => invoke.result),
});
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std
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=std.filebase64(input="secret-data.pfx").result)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
"github.com/pulumi/pulumi-std/sdk/go/std"
"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
}
invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
Input: "secret-data.pfx",
}, nil)
if err != nil {
return err
}
_, err = secretmanager.NewSecretVersion(ctx, "secret-version-base64", &secretmanager.SecretVersionArgs{
Secret: secret_basic.ID(),
IsSecretDataBase64: pulumi.Bool(true),
SecretData: invokeFilebase64.Result,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;
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 = Std.Filebase64.Invoke(new()
{
Input = "secret-data.pfx",
}).Apply(invoke => invoke.Result),
});
});
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(StdFunctions.filebase64(Filebase64Args.builder()
.input("secret-data.pfx")
.build()).result())
.build());
}
}
resources:
secret-basic:
type: gcp:secretmanager:Secret
properties:
secretId: secret-version
replication:
userManaged:
replicas:
- location: us-central1
secret-version-base64:
type: gcp:secretmanager:SecretVersion
properties:
secret: ${["secret-basic"].id}
isSecretDataBase64: true
secretData:
fn::invoke:
Function: std:filebase64
Arguments:
input: secret-data.pfx
Return: result
Create SecretVersion Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecretVersion(name: string, args: SecretVersionArgs, opts?: CustomResourceOptions);
@overload
def SecretVersion(resource_name: str,
args: SecretVersionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecretVersion(resource_name: str,
opts: Optional[ResourceOptions] = None,
secret: Optional[str] = None,
secret_data: Optional[str] = None,
deletion_policy: Optional[str] = None,
enabled: Optional[bool] = None,
is_secret_data_base64: Optional[bool] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var secretVersionResource = new Gcp.SecretManager.SecretVersion("secretVersionResource", new()
{
Secret = "string",
SecretData = "string",
DeletionPolicy = "string",
Enabled = false,
IsSecretDataBase64 = false,
});
example, err := secretmanager.NewSecretVersion(ctx, "secretVersionResource", &secretmanager.SecretVersionArgs{
Secret: pulumi.String("string"),
SecretData: pulumi.String("string"),
DeletionPolicy: pulumi.String("string"),
Enabled: pulumi.Bool(false),
IsSecretDataBase64: pulumi.Bool(false),
})
var secretVersionResource = new SecretVersion("secretVersionResource", SecretVersionArgs.builder()
.secret("string")
.secretData("string")
.deletionPolicy("string")
.enabled(false)
.isSecretDataBase64(false)
.build());
secret_version_resource = gcp.secretmanager.SecretVersion("secretVersionResource",
secret="string",
secret_data="string",
deletion_policy="string",
enabled=False,
is_secret_data_base64=False)
const secretVersionResource = new gcp.secretmanager.SecretVersion("secretVersionResource", {
secret: "string",
secretData: "string",
deletionPolicy: "string",
enabled: false,
isSecretDataBase64: false,
});
type: gcp:secretmanager:SecretVersion
properties:
deletionPolicy: string
enabled: false
isSecretDataBase64: false
secret: string
secretData: string
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}}
When using the pulumi import
command, 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}}
To learn more about importing existing cloud resources, see Importing resources.
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.