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",
});
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")
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
})
}
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",
});
});
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());
}
}
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
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==",
});
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==")
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
})
}
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==",
});
});
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());
}
}
resources:
v2:
type: tencentcloud:SsmSecretVersion
properties:
secretName: ${tencentcloud_ssm_secret.example.secret_name}
versionId: v2
secretBinary: MTIzMTIzMTIzMTIzMTIzQQ==
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 string
- The unique name of the resource.
- args SsmSecretVersionArgs
- 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 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 string
- The unique name of the resource.
- args SsmSecretVersionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SsmSecretVersionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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:
- Secret
Name 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.
- Version
Id 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 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. - Secret
String 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. - Ssm
Secret stringVersion Id - ID of the resource.
- Secret
Name 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.
- Version
Id 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 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. - Secret
String 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. - Ssm
Secret stringVersion Id - ID of the resource.
- secret
Name 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.
- version
Id 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 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. - secret
String 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. - ssm
Secret StringVersion Id - ID of the resource.
- secret
Name 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.
- version
Id 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 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. - secret
String 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. - ssm
Secret stringVersion Id - ID of the resource.
- 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.
- 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.
- 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_ strversion_ id - ID of the resource.
- secret
Name 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.
- version
Id 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 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. - secret
String 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. - ssm
Secret StringVersion Id - 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
- 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.
- Secret
Binary 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. - Secret
Name 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.
- Secret
String 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. - Ssm
Secret stringVersion Id - ID of the resource.
- Version
Id 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 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. - Secret
Name 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.
- Secret
String 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. - Ssm
Secret stringVersion Id - ID of the resource.
- Version
Id 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 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. - secret
Name 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.
- secret
String 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. - ssm
Secret StringVersion Id - ID of the resource.
- version
Id 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 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. - secret
Name 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.
- secret
String 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. - ssm
Secret stringVersion Id - ID of the resource.
- version
Id 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_ strversion_ id - 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.
- secret
Binary 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. - secret
Name 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.
- secret
String 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. - ssm
Secret StringVersion Id - ID of the resource.
- version
Id 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
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.