1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. SsmSecret
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.SsmSecret

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provide a resource to create a SSM secret.

    Example Usage

    Create user defined secret

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.SsmSecret("example", {
        description: "desc.",
        isEnabled: true,
        recoveryWindowInDays: 0,
        secretName: "tf-example",
        tags: {
            createBy: "terraform",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.SsmSecret("example",
        description="desc.",
        is_enabled=True,
        recovery_window_in_days=0,
        secret_name="tf-example",
        tags={
            "createBy": "terraform",
        })
    
    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.NewSsmSecret(ctx, "example", &tencentcloud.SsmSecretArgs{
    			Description:          pulumi.String("desc."),
    			IsEnabled:            pulumi.Bool(true),
    			RecoveryWindowInDays: pulumi.Float64(0),
    			SecretName:           pulumi.String("tf-example"),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("terraform"),
    			},
    		})
    		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()
        {
            Description = "desc.",
            IsEnabled = true,
            RecoveryWindowInDays = 0,
            SecretName = "tf-example",
            Tags = 
            {
                { "createBy", "terraform" },
            },
        });
    
    });
    
    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 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()
                .description("desc.")
                .isEnabled(true)
                .recoveryWindowInDays(0)
                .secretName("tf-example")
                .tags(Map.of("createBy", "terraform"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:SsmSecret
        properties:
          description: desc.
          isEnabled: true
          recoveryWindowInDays: 0
          secretName: tf-example
          tags:
            createBy: terraform
    

    Create SsmSecret Resource

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

    Constructor syntax

    new SsmSecret(name: string, args: SsmSecretArgs, opts?: CustomResourceOptions);
    @overload
    def SsmSecret(resource_name: str,
                  args: SsmSecretArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def SsmSecret(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  secret_name: Optional[str] = None,
                  additional_config: Optional[str] = None,
                  description: Optional[str] = None,
                  is_enabled: Optional[bool] = None,
                  kms_key_id: Optional[str] = None,
                  recovery_window_in_days: Optional[float] = None,
                  secret_type: Optional[float] = None,
                  ssm_secret_id: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None)
    func NewSsmSecret(ctx *Context, name string, args SsmSecretArgs, opts ...ResourceOption) (*SsmSecret, error)
    public SsmSecret(string name, SsmSecretArgs args, CustomResourceOptions? opts = null)
    public SsmSecret(String name, SsmSecretArgs args)
    public SsmSecret(String name, SsmSecretArgs args, CustomResourceOptions options)
    
    type: tencentcloud:SsmSecret
    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 SsmSecretArgs
    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 SsmSecretArgs
    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 SsmSecretArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SsmSecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SsmSecretArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    SsmSecret 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 SsmSecret resource accepts the following input properties:

    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.
    AdditionalConfig string
    Additional config for specific secret types in JSON string format.
    Description string
    Description of secret. The maximum is 2048 bytes.
    IsEnabled bool
    Specify whether to enable secret. Default value is true.
    KmsKeyId string
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    RecoveryWindowInDays double
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    SecretType double
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    SsmSecretId string
    ID of the resource.
    Tags Dictionary<string, string>
    Tags of secret.
    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.
    AdditionalConfig string
    Additional config for specific secret types in JSON string format.
    Description string
    Description of secret. The maximum is 2048 bytes.
    IsEnabled bool
    Specify whether to enable secret. Default value is true.
    KmsKeyId string
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    RecoveryWindowInDays float64
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    SecretType float64
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    SsmSecretId string
    ID of the resource.
    Tags map[string]string
    Tags of secret.
    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.
    additionalConfig String
    Additional config for specific secret types in JSON string format.
    description String
    Description of secret. The maximum is 2048 bytes.
    isEnabled Boolean
    Specify whether to enable secret. Default value is true.
    kmsKeyId String
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recoveryWindowInDays Double
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    secretType Double
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssmSecretId String
    ID of the resource.
    tags Map<String,String>
    Tags of secret.
    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.
    additionalConfig string
    Additional config for specific secret types in JSON string format.
    description string
    Description of secret. The maximum is 2048 bytes.
    isEnabled boolean
    Specify whether to enable secret. Default value is true.
    kmsKeyId string
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recoveryWindowInDays number
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    secretType number
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssmSecretId string
    ID of the resource.
    tags {[key: string]: string}
    Tags of secret.
    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.
    additional_config str
    Additional config for specific secret types in JSON string format.
    description str
    Description of secret. The maximum is 2048 bytes.
    is_enabled bool
    Specify whether to enable secret. Default value is true.
    kms_key_id str
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recovery_window_in_days float
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    secret_type float
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssm_secret_id str
    ID of the resource.
    tags Mapping[str, str]
    Tags of secret.
    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.
    additionalConfig String
    Additional config for specific secret types in JSON string format.
    description String
    Description of secret. The maximum is 2048 bytes.
    isEnabled Boolean
    Specify whether to enable secret. Default value is true.
    kmsKeyId String
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recoveryWindowInDays Number
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    secretType Number
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssmSecretId String
    ID of the resource.
    tags Map<String>
    Tags of secret.

    Outputs

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

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

    Look up Existing SsmSecret Resource

    Get an existing SsmSecret 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?: SsmSecretState, opts?: CustomResourceOptions): SsmSecret
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_config: Optional[str] = None,
            description: Optional[str] = None,
            is_enabled: Optional[bool] = None,
            kms_key_id: Optional[str] = None,
            recovery_window_in_days: Optional[float] = None,
            secret_name: Optional[str] = None,
            secret_type: Optional[float] = None,
            ssm_secret_id: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> SsmSecret
    func GetSsmSecret(ctx *Context, name string, id IDInput, state *SsmSecretState, opts ...ResourceOption) (*SsmSecret, error)
    public static SsmSecret Get(string name, Input<string> id, SsmSecretState? state, CustomResourceOptions? opts = null)
    public static SsmSecret get(String name, Output<String> id, SsmSecretState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:SsmSecret    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.
    The following state arguments are supported:
    AdditionalConfig string
    Additional config for specific secret types in JSON string format.
    Description string
    Description of secret. The maximum is 2048 bytes.
    IsEnabled bool
    Specify whether to enable secret. Default value is true.
    KmsKeyId string
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    RecoveryWindowInDays double
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    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.
    SecretType double
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    SsmSecretId string
    ID of the resource.
    Status string
    Status of secret.
    Tags Dictionary<string, string>
    Tags of secret.
    AdditionalConfig string
    Additional config for specific secret types in JSON string format.
    Description string
    Description of secret. The maximum is 2048 bytes.
    IsEnabled bool
    Specify whether to enable secret. Default value is true.
    KmsKeyId string
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    RecoveryWindowInDays float64
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    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.
    SecretType float64
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    SsmSecretId string
    ID of the resource.
    Status string
    Status of secret.
    Tags map[string]string
    Tags of secret.
    additionalConfig String
    Additional config for specific secret types in JSON string format.
    description String
    Description of secret. The maximum is 2048 bytes.
    isEnabled Boolean
    Specify whether to enable secret. Default value is true.
    kmsKeyId String
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recoveryWindowInDays Double
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    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.
    secretType Double
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssmSecretId String
    ID of the resource.
    status String
    Status of secret.
    tags Map<String,String>
    Tags of secret.
    additionalConfig string
    Additional config for specific secret types in JSON string format.
    description string
    Description of secret. The maximum is 2048 bytes.
    isEnabled boolean
    Specify whether to enable secret. Default value is true.
    kmsKeyId string
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recoveryWindowInDays number
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    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.
    secretType number
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssmSecretId string
    ID of the resource.
    status string
    Status of secret.
    tags {[key: string]: string}
    Tags of secret.
    additional_config str
    Additional config for specific secret types in JSON string format.
    description str
    Description of secret. The maximum is 2048 bytes.
    is_enabled bool
    Specify whether to enable secret. Default value is true.
    kms_key_id str
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recovery_window_in_days float
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    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_type float
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssm_secret_id str
    ID of the resource.
    status str
    Status of secret.
    tags Mapping[str, str]
    Tags of secret.
    additionalConfig String
    Additional config for specific secret types in JSON string format.
    description String
    Description of secret. The maximum is 2048 bytes.
    isEnabled Boolean
    Specify whether to enable secret. Default value is true.
    kmsKeyId String
    KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption.
    recoveryWindowInDays Number
    Specify the scheduled deletion date. Default value is 0 that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date.
    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.
    secretType Number
    Type of secret. 0: user-defined secret. 4: redis secret. Default is 0.
    ssmSecretId String
    ID of the resource.
    status String
    Status of secret.
    tags Map<String>
    Tags of secret.

    Import

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

    $ pulumi import tencentcloud:index/ssmSecret:SsmSecret foo test
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack