1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. SecretText
Harness v0.8.1 published on Saturday, Aug 23, 2025 by Pulumi

harness.platform.SecretText

Explore with Pulumi AI

harness logo
Harness v0.8.1 published on Saturday, Aug 23, 2025 by Pulumi

    Resource for creating secret of type secret text

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const inline = new harness.platform.SecretText("inline", {
        identifier: "identifier",
        name: "name",
        description: "example",
        tags: ["foo:bar"],
        secretManagerIdentifier: "harnessSecretManager",
        valueType: "Inline",
        value: "secret",
    });
    const reference = new harness.platform.SecretText("reference", {
        identifier: "identifier",
        name: "name",
        description: "example",
        tags: ["foo:bar"],
        secretManagerIdentifier: "azureSecretManager",
        valueType: "Reference",
        value: "secret",
    });
    const gcpSecretManagerReference = new harness.platform.SecretText("gcp_secret_manager_reference", {
        identifier: "identifier",
        name: "name",
        description: "example",
        tags: ["foo:bar"],
        secretManagerIdentifier: "gcpSecretManager",
        valueType: "Reference",
        value: "secret",
        additionalMetadatas: [{
            values: [{
                version: "1",
            }],
        }],
    });
    
    import pulumi
    import pulumi_harness as harness
    
    inline = harness.platform.SecretText("inline",
        identifier="identifier",
        name="name",
        description="example",
        tags=["foo:bar"],
        secret_manager_identifier="harnessSecretManager",
        value_type="Inline",
        value="secret")
    reference = harness.platform.SecretText("reference",
        identifier="identifier",
        name="name",
        description="example",
        tags=["foo:bar"],
        secret_manager_identifier="azureSecretManager",
        value_type="Reference",
        value="secret")
    gcp_secret_manager_reference = harness.platform.SecretText("gcp_secret_manager_reference",
        identifier="identifier",
        name="name",
        description="example",
        tags=["foo:bar"],
        secret_manager_identifier="gcpSecretManager",
        value_type="Reference",
        value="secret",
        additional_metadatas=[{
            "values": [{
                "version": "1",
            }],
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := platform.NewSecretText(ctx, "inline", &platform.SecretTextArgs{
    			Identifier:  pulumi.String("identifier"),
    			Name:        pulumi.String("name"),
    			Description: pulumi.String("example"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    			},
    			SecretManagerIdentifier: pulumi.String("harnessSecretManager"),
    			ValueType:               pulumi.String("Inline"),
    			Value:                   pulumi.String("secret"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = platform.NewSecretText(ctx, "reference", &platform.SecretTextArgs{
    			Identifier:  pulumi.String("identifier"),
    			Name:        pulumi.String("name"),
    			Description: pulumi.String("example"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    			},
    			SecretManagerIdentifier: pulumi.String("azureSecretManager"),
    			ValueType:               pulumi.String("Reference"),
    			Value:                   pulumi.String("secret"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = platform.NewSecretText(ctx, "gcp_secret_manager_reference", &platform.SecretTextArgs{
    			Identifier:  pulumi.String("identifier"),
    			Name:        pulumi.String("name"),
    			Description: pulumi.String("example"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    			},
    			SecretManagerIdentifier: pulumi.String("gcpSecretManager"),
    			ValueType:               pulumi.String("Reference"),
    			Value:                   pulumi.String("secret"),
    			AdditionalMetadatas: platform.SecretTextAdditionalMetadataArray{
    				&platform.SecretTextAdditionalMetadataArgs{
    					Values: platform.SecretTextAdditionalMetadataValueArray{
    						&platform.SecretTextAdditionalMetadataValueArgs{
    							Version: pulumi.String("1"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var inline = new Harness.Platform.SecretText("inline", new()
        {
            Identifier = "identifier",
            Name = "name",
            Description = "example",
            Tags = new[]
            {
                "foo:bar",
            },
            SecretManagerIdentifier = "harnessSecretManager",
            ValueType = "Inline",
            Value = "secret",
        });
    
        var reference = new Harness.Platform.SecretText("reference", new()
        {
            Identifier = "identifier",
            Name = "name",
            Description = "example",
            Tags = new[]
            {
                "foo:bar",
            },
            SecretManagerIdentifier = "azureSecretManager",
            ValueType = "Reference",
            Value = "secret",
        });
    
        var gcpSecretManagerReference = new Harness.Platform.SecretText("gcp_secret_manager_reference", new()
        {
            Identifier = "identifier",
            Name = "name",
            Description = "example",
            Tags = new[]
            {
                "foo:bar",
            },
            SecretManagerIdentifier = "gcpSecretManager",
            ValueType = "Reference",
            Value = "secret",
            AdditionalMetadatas = new[]
            {
                new Harness.Platform.Inputs.SecretTextAdditionalMetadataArgs
                {
                    Values = new[]
                    {
                        new Harness.Platform.Inputs.SecretTextAdditionalMetadataValueArgs
                        {
                            Version = "1",
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.SecretText;
    import com.pulumi.harness.platform.SecretTextArgs;
    import com.pulumi.harness.platform.inputs.SecretTextAdditionalMetadataArgs;
    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 inline = new SecretText("inline", SecretTextArgs.builder()
                .identifier("identifier")
                .name("name")
                .description("example")
                .tags("foo:bar")
                .secretManagerIdentifier("harnessSecretManager")
                .valueType("Inline")
                .value("secret")
                .build());
    
            var reference = new SecretText("reference", SecretTextArgs.builder()
                .identifier("identifier")
                .name("name")
                .description("example")
                .tags("foo:bar")
                .secretManagerIdentifier("azureSecretManager")
                .valueType("Reference")
                .value("secret")
                .build());
    
            var gcpSecretManagerReference = new SecretText("gcpSecretManagerReference", SecretTextArgs.builder()
                .identifier("identifier")
                .name("name")
                .description("example")
                .tags("foo:bar")
                .secretManagerIdentifier("gcpSecretManager")
                .valueType("Reference")
                .value("secret")
                .additionalMetadatas(SecretTextAdditionalMetadataArgs.builder()
                    .values(SecretTextAdditionalMetadataValueArgs.builder()
                        .version("1")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      inline:
        type: harness:platform:SecretText
        properties:
          identifier: identifier
          name: name
          description: example
          tags:
            - foo:bar
          secretManagerIdentifier: harnessSecretManager
          valueType: Inline
          value: secret
      reference:
        type: harness:platform:SecretText
        properties:
          identifier: identifier
          name: name
          description: example
          tags:
            - foo:bar
          secretManagerIdentifier: azureSecretManager
          valueType: Reference
          value: secret
      gcpSecretManagerReference:
        type: harness:platform:SecretText
        name: gcp_secret_manager_reference
        properties:
          identifier: identifier
          name: name
          description: example
          tags:
            - foo:bar
          secretManagerIdentifier: gcpSecretManager
          valueType: Reference
          value: secret
          additionalMetadatas:
            - values:
                - version: '1'
    

    Create SecretText Resource

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

    Constructor syntax

    new SecretText(name: string, args: SecretTextArgs, opts?: CustomResourceOptions);
    @overload
    def SecretText(resource_name: str,
                   args: SecretTextArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecretText(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   identifier: Optional[str] = None,
                   secret_manager_identifier: Optional[str] = None,
                   value_type: Optional[str] = None,
                   additional_metadatas: Optional[Sequence[SecretTextAdditionalMetadataArgs]] = None,
                   description: Optional[str] = None,
                   name: Optional[str] = None,
                   org_id: Optional[str] = None,
                   project_id: Optional[str] = None,
                   tags: Optional[Sequence[str]] = None,
                   value: Optional[str] = None)
    func NewSecretText(ctx *Context, name string, args SecretTextArgs, opts ...ResourceOption) (*SecretText, error)
    public SecretText(string name, SecretTextArgs args, CustomResourceOptions? opts = null)
    public SecretText(String name, SecretTextArgs args)
    public SecretText(String name, SecretTextArgs args, CustomResourceOptions options)
    
    type: harness:platform:SecretText
    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 SecretTextArgs
    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 SecretTextArgs
    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 SecretTextArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretTextArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretTextArgs
    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 secretTextResource = new Harness.Platform.SecretText("secretTextResource", new()
    {
        Identifier = "string",
        SecretManagerIdentifier = "string",
        ValueType = "string",
        AdditionalMetadatas = new[]
        {
            new Harness.Platform.Inputs.SecretTextAdditionalMetadataArgs
            {
                Values = new[]
                {
                    new Harness.Platform.Inputs.SecretTextAdditionalMetadataValueArgs
                    {
                        Version = "string",
                    },
                },
            },
        },
        Description = "string",
        Name = "string",
        OrgId = "string",
        ProjectId = "string",
        Tags = new[]
        {
            "string",
        },
        Value = "string",
    });
    
    example, err := platform.NewSecretText(ctx, "secretTextResource", &platform.SecretTextArgs{
    	Identifier:              pulumi.String("string"),
    	SecretManagerIdentifier: pulumi.String("string"),
    	ValueType:               pulumi.String("string"),
    	AdditionalMetadatas: platform.SecretTextAdditionalMetadataArray{
    		&platform.SecretTextAdditionalMetadataArgs{
    			Values: platform.SecretTextAdditionalMetadataValueArray{
    				&platform.SecretTextAdditionalMetadataValueArgs{
    					Version: pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	OrgId:       pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Value: pulumi.String("string"),
    })
    
    var secretTextResource = new SecretText("secretTextResource", SecretTextArgs.builder()
        .identifier("string")
        .secretManagerIdentifier("string")
        .valueType("string")
        .additionalMetadatas(SecretTextAdditionalMetadataArgs.builder()
            .values(SecretTextAdditionalMetadataValueArgs.builder()
                .version("string")
                .build())
            .build())
        .description("string")
        .name("string")
        .orgId("string")
        .projectId("string")
        .tags("string")
        .value("string")
        .build());
    
    secret_text_resource = harness.platform.SecretText("secretTextResource",
        identifier="string",
        secret_manager_identifier="string",
        value_type="string",
        additional_metadatas=[{
            "values": [{
                "version": "string",
            }],
        }],
        description="string",
        name="string",
        org_id="string",
        project_id="string",
        tags=["string"],
        value="string")
    
    const secretTextResource = new harness.platform.SecretText("secretTextResource", {
        identifier: "string",
        secretManagerIdentifier: "string",
        valueType: "string",
        additionalMetadatas: [{
            values: [{
                version: "string",
            }],
        }],
        description: "string",
        name: "string",
        orgId: "string",
        projectId: "string",
        tags: ["string"],
        value: "string",
    });
    
    type: harness:platform:SecretText
    properties:
        additionalMetadatas:
            - values:
                - version: string
        description: string
        identifier: string
        name: string
        orgId: string
        projectId: string
        secretManagerIdentifier: string
        tags:
            - string
        value: string
        valueType: string
    

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

    Identifier string
    Unique identifier of the resource.
    SecretManagerIdentifier string
    Identifier of the Secret Manager used to manage the secret.
    ValueType string
    This has details to specify if the secret value is Inline or Reference.
    AdditionalMetadatas List<SecretTextAdditionalMetadata>
    Additional Metadata for the Secret
    Description string
    Description of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    Value string
    Value of the Secret
    Identifier string
    Unique identifier of the resource.
    SecretManagerIdentifier string
    Identifier of the Secret Manager used to manage the secret.
    ValueType string
    This has details to specify if the secret value is Inline or Reference.
    AdditionalMetadatas []SecretTextAdditionalMetadataArgs
    Additional Metadata for the Secret
    Description string
    Description of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    Value string
    Value of the Secret
    identifier String
    Unique identifier of the resource.
    secretManagerIdentifier String
    Identifier of the Secret Manager used to manage the secret.
    valueType String
    This has details to specify if the secret value is Inline or Reference.
    additionalMetadatas List<SecretTextAdditionalMetadata>
    Additional Metadata for the Secret
    description String
    Description of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    value String
    Value of the Secret
    identifier string
    Unique identifier of the resource.
    secretManagerIdentifier string
    Identifier of the Secret Manager used to manage the secret.
    valueType string
    This has details to specify if the secret value is Inline or Reference.
    additionalMetadatas SecretTextAdditionalMetadata[]
    Additional Metadata for the Secret
    description string
    Description of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    value string
    Value of the Secret
    identifier str
    Unique identifier of the resource.
    secret_manager_identifier str
    Identifier of the Secret Manager used to manage the secret.
    value_type str
    This has details to specify if the secret value is Inline or Reference.
    additional_metadatas Sequence[SecretTextAdditionalMetadataArgs]
    Additional Metadata for the Secret
    description str
    Description of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    value str
    Value of the Secret
    identifier String
    Unique identifier of the resource.
    secretManagerIdentifier String
    Identifier of the Secret Manager used to manage the secret.
    valueType String
    This has details to specify if the secret value is Inline or Reference.
    additionalMetadatas List<Property Map>
    Additional Metadata for the Secret
    description String
    Description of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    value String
    Value of the Secret

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SecretText 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 SecretText Resource

    Get an existing SecretText 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?: SecretTextState, opts?: CustomResourceOptions): SecretText
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_metadatas: Optional[Sequence[SecretTextAdditionalMetadataArgs]] = None,
            description: Optional[str] = None,
            identifier: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            secret_manager_identifier: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            value: Optional[str] = None,
            value_type: Optional[str] = None) -> SecretText
    func GetSecretText(ctx *Context, name string, id IDInput, state *SecretTextState, opts ...ResourceOption) (*SecretText, error)
    public static SecretText Get(string name, Input<string> id, SecretTextState? state, CustomResourceOptions? opts = null)
    public static SecretText get(String name, Output<String> id, SecretTextState state, CustomResourceOptions options)
    resources:  _:    type: harness:platform:SecretText    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:
    AdditionalMetadatas List<SecretTextAdditionalMetadata>
    Additional Metadata for the Secret
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    SecretManagerIdentifier string
    Identifier of the Secret Manager used to manage the secret.
    Tags List<string>
    Tags to associate with the resource.
    Value string
    Value of the Secret
    ValueType string
    This has details to specify if the secret value is Inline or Reference.
    AdditionalMetadatas []SecretTextAdditionalMetadataArgs
    Additional Metadata for the Secret
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    SecretManagerIdentifier string
    Identifier of the Secret Manager used to manage the secret.
    Tags []string
    Tags to associate with the resource.
    Value string
    Value of the Secret
    ValueType string
    This has details to specify if the secret value is Inline or Reference.
    additionalMetadatas List<SecretTextAdditionalMetadata>
    Additional Metadata for the Secret
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    secretManagerIdentifier String
    Identifier of the Secret Manager used to manage the secret.
    tags List<String>
    Tags to associate with the resource.
    value String
    Value of the Secret
    valueType String
    This has details to specify if the secret value is Inline or Reference.
    additionalMetadatas SecretTextAdditionalMetadata[]
    Additional Metadata for the Secret
    description string
    Description of the resource.
    identifier string
    Unique identifier of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    secretManagerIdentifier string
    Identifier of the Secret Manager used to manage the secret.
    tags string[]
    Tags to associate with the resource.
    value string
    Value of the Secret
    valueType string
    This has details to specify if the secret value is Inline or Reference.
    additional_metadatas Sequence[SecretTextAdditionalMetadataArgs]
    Additional Metadata for the Secret
    description str
    Description of the resource.
    identifier str
    Unique identifier of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    secret_manager_identifier str
    Identifier of the Secret Manager used to manage the secret.
    tags Sequence[str]
    Tags to associate with the resource.
    value str
    Value of the Secret
    value_type str
    This has details to specify if the secret value is Inline or Reference.
    additionalMetadatas List<Property Map>
    Additional Metadata for the Secret
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    secretManagerIdentifier String
    Identifier of the Secret Manager used to manage the secret.
    tags List<String>
    Tags to associate with the resource.
    value String
    Value of the Secret
    valueType String
    This has details to specify if the secret value is Inline or Reference.

    Supporting Types

    SecretTextAdditionalMetadata, SecretTextAdditionalMetadataArgs

    SecretTextAdditionalMetadataValue, SecretTextAdditionalMetadataValueArgs

    Version string
    Version string
    version String
    version string
    version String

    Import

    The pulumi import command can be used, for example:

    Import account level secret text

    $ pulumi import harness:platform/secretText:SecretText example <secret_text_id>
    

    Import org level secret text

    $ pulumi import harness:platform/secretText:SecretText example <ord_id>/<secret_text_id>
    

    Import project level secret text

    $ pulumi import harness:platform/secretText:SecretText example <org_id>/<project_id>/<secret_text_id>
    

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

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.8.1 published on Saturday, Aug 23, 2025 by Pulumi