1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. SsmSecretVersion
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.SsmSecretVersion

Explore with Pulumi AI

Provide a resource to create a SSM secret version.

Note: A maximum of 10 versions can be supported under one credential. Only new versions can be added to credentials in the enabled and disabled states.

Example Usage

Text type credential information plaintext

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const example = new tencentcloud.SsmSecret("example", {
    secretName: "tf-example",
    description: "desc.",
    recoveryWindowInDays: 0,
    isEnabled: true,
    tags: {
        createdBy: "terraform",
    },
});
const v1 = new tencentcloud.SsmSecretVersion("v1", {
    secretName: example.secretName,
    versionId: "v1",
    secretString: "this is secret string",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

example = tencentcloud.SsmSecret("example",
    secret_name="tf-example",
    description="desc.",
    recovery_window_in_days=0,
    is_enabled=True,
    tags={
        "createdBy": "terraform",
    })
v1 = tencentcloud.SsmSecretVersion("v1",
    secret_name=example.secret_name,
    version_id="v1",
    secret_string="this is secret string")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := tencentcloud.NewSsmSecret(ctx, "example", &tencentcloud.SsmSecretArgs{
			SecretName:           pulumi.String("tf-example"),
			Description:          pulumi.String("desc."),
			RecoveryWindowInDays: pulumi.Float64(0),
			IsEnabled:            pulumi.Bool(true),
			Tags: pulumi.StringMap{
				"createdBy": pulumi.String("terraform"),
			},
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewSsmSecretVersion(ctx, "v1", &tencentcloud.SsmSecretVersionArgs{
			SecretName:   example.SecretName,
			VersionId:    pulumi.String("v1"),
			SecretString: pulumi.String("this is secret string"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var example = new Tencentcloud.SsmSecret("example", new()
    {
        SecretName = "tf-example",
        Description = "desc.",
        RecoveryWindowInDays = 0,
        IsEnabled = true,
        Tags = 
        {
            { "createdBy", "terraform" },
        },
    });

    var v1 = new Tencentcloud.SsmSecretVersion("v1", new()
    {
        SecretName = example.SecretName,
        VersionId = "v1",
        SecretString = "this is secret string",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.SsmSecret;
import com.pulumi.tencentcloud.SsmSecretArgs;
import com.pulumi.tencentcloud.SsmSecretVersion;
import com.pulumi.tencentcloud.SsmSecretVersionArgs;
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 example = new SsmSecret("example", SsmSecretArgs.builder()
            .secretName("tf-example")
            .description("desc.")
            .recoveryWindowInDays(0)
            .isEnabled(true)
            .tags(Map.of("createdBy", "terraform"))
            .build());

        var v1 = new SsmSecretVersion("v1", SsmSecretVersionArgs.builder()
            .secretName(example.secretName())
            .versionId("v1")
            .secretString("this is secret string")
            .build());

    }
}
Copy
resources:
  example:
    type: tencentcloud:SsmSecret
    properties:
      secretName: tf-example
      description: desc.
      recoveryWindowInDays: 0
      isEnabled: true
      tags:
        createdBy: terraform
  v1:
    type: tencentcloud:SsmSecretVersion
    properties:
      secretName: ${example.secretName}
      versionId: v1
      secretString: this is secret string
Copy

Binary credential information, encoded using base64

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const v2 = new tencentcloud.SsmSecretVersion("v2", {
    secretName: tencentcloud_ssm_secret.example.secret_name,
    versionId: "v2",
    secretBinary: "MTIzMTIzMTIzMTIzMTIzQQ==",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

v2 = tencentcloud.SsmSecretVersion("v2",
    secret_name=tencentcloud_ssm_secret["example"]["secret_name"],
    version_id="v2",
    secret_binary="MTIzMTIzMTIzMTIzMTIzQQ==")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tencentcloud.NewSsmSecretVersion(ctx, "v2", &tencentcloud.SsmSecretVersionArgs{
			SecretName:   pulumi.Any(tencentcloud_ssm_secret.Example.Secret_name),
			VersionId:    pulumi.String("v2"),
			SecretBinary: pulumi.String("MTIzMTIzMTIzMTIzMTIzQQ=="),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var v2 = new Tencentcloud.SsmSecretVersion("v2", new()
    {
        SecretName = tencentcloud_ssm_secret.Example.Secret_name,
        VersionId = "v2",
        SecretBinary = "MTIzMTIzMTIzMTIzMTIzQQ==",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.SsmSecretVersion;
import com.pulumi.tencentcloud.SsmSecretVersionArgs;
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 v2 = new SsmSecretVersion("v2", SsmSecretVersionArgs.builder()
            .secretName(tencentcloud_ssm_secret.example().secret_name())
            .versionId("v2")
            .secretBinary("MTIzMTIzMTIzMTIzMTIzQQ==")
            .build());

    }
}
Copy
resources:
  v2:
    type: tencentcloud:SsmSecretVersion
    properties:
      secretName: ${tencentcloud_ssm_secret.example.secret_name}
      versionId: v2
      secretBinary: MTIzMTIzMTIzMTIzMTIzQQ==
Copy

Create SsmSecretVersion Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SsmSecretVersion(name: string, args: SsmSecretVersionArgs, opts?: CustomResourceOptions);
@overload
def SsmSecretVersion(resource_name: str,
                     args: SsmSecretVersionArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def SsmSecretVersion(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     secret_name: Optional[str] = None,
                     version_id: Optional[str] = None,
                     secret_binary: Optional[str] = None,
                     secret_string: Optional[str] = None,
                     ssm_secret_version_id: Optional[str] = None)
func NewSsmSecretVersion(ctx *Context, name string, args SsmSecretVersionArgs, opts ...ResourceOption) (*SsmSecretVersion, error)
public SsmSecretVersion(string name, SsmSecretVersionArgs args, CustomResourceOptions? opts = null)
public SsmSecretVersion(String name, SsmSecretVersionArgs args)
public SsmSecretVersion(String name, SsmSecretVersionArgs args, CustomResourceOptions options)
type: tencentcloud:SsmSecretVersion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SsmSecretVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SsmSecretVersionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SsmSecretVersionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SsmSecretVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SsmSecretVersionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SsmSecretVersion Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SsmSecretVersion resource accepts the following input properties:

SecretName This property is required. string
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
VersionId This property is required. string
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretBinary string
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SecretString string
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SsmSecretVersionId string
ID of the resource.
SecretName This property is required. string
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
VersionId This property is required. string
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretBinary string
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SecretString string
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SsmSecretVersionId string
ID of the resource.
secretName This property is required. String
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
versionId This property is required. String
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretBinary String
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secretString String
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssmSecretVersionId String
ID of the resource.
secretName This property is required. string
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
versionId This property is required. string
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretBinary string
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secretString string
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssmSecretVersionId string
ID of the resource.
secret_name This property is required. str
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
version_id This property is required. str
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secret_binary str
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secret_string str
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssm_secret_version_id str
ID of the resource.
secretName This property is required. String
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
versionId This property is required. String
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretBinary String
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secretString String
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssmSecretVersionId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the SsmSecretVersion resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SsmSecretVersion Resource

Get an existing SsmSecretVersion 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?: SsmSecretVersionState, opts?: CustomResourceOptions): SsmSecretVersion
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        secret_binary: Optional[str] = None,
        secret_name: Optional[str] = None,
        secret_string: Optional[str] = None,
        ssm_secret_version_id: Optional[str] = None,
        version_id: Optional[str] = None) -> SsmSecretVersion
func GetSsmSecretVersion(ctx *Context, name string, id IDInput, state *SsmSecretVersionState, opts ...ResourceOption) (*SsmSecretVersion, error)
public static SsmSecretVersion Get(string name, Input<string> id, SsmSecretVersionState? state, CustomResourceOptions? opts = null)
public static SsmSecretVersion get(String name, Output<String> id, SsmSecretVersionState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:SsmSecretVersion    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
SecretBinary string
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SecretName string
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretString string
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SsmSecretVersionId string
ID of the resource.
VersionId string
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretBinary string
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SecretName string
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
SecretString string
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
SsmSecretVersionId string
ID of the resource.
VersionId string
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretBinary String
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secretName String
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretString String
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssmSecretVersionId String
ID of the resource.
versionId String
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretBinary string
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secretName string
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretString string
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssmSecretVersionId string
ID of the resource.
versionId string
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secret_binary str
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secret_name str
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secret_string str
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssm_secret_version_id str
ID of the resource.
version_id str
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretBinary String
The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
secretName String
Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.
secretString String
The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is Disabled, this field will not update anymore.
ssmSecretVersionId String
ID of the resource.
versionId String
Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number.

Import

SSM secret version can be imported using the secretName#versionId, e.g.

$ pulumi import tencentcloud:index/ssmSecretVersion:SsmSecretVersion v1 test#v1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.