1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. getSecretWinrm
Harness v0.9.3 published on Tuesday, Nov 25, 2025 by Pulumi
harness logo
Harness v0.9.3 published on Tuesday, Nov 25, 2025 by Pulumi

    Data source for looking up a WinRM credential secret.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    // Data source to retrieve account level WinRM credential by identifier
    const example = harness.platform.getSecretWinrm({
        identifier: "winrm_credential_id",
    });
    // Data source to retrieve organization level WinRM credential
    const orgExample = harness.platform.getSecretWinrm({
        identifier: "winrm_credential_id",
        orgId: "org_identifier",
    });
    // Data source to retrieve project level WinRM credential
    const projectExample = harness.platform.getSecretWinrm({
        identifier: "winrm_credential_id",
        orgId: "org_identifier",
        projectId: "project_identifier",
    });
    export const winrmPort = example.then(example => example.port);
    export const winrmAuthType = example.then(example => example.ntlms).length.apply(length => length > 0 ? "NTLM" : "Kerberos");
    
    import pulumi
    import pulumi_harness as harness
    
    # Data source to retrieve account level WinRM credential by identifier
    example = harness.platform.get_secret_winrm(identifier="winrm_credential_id")
    # Data source to retrieve organization level WinRM credential
    org_example = harness.platform.get_secret_winrm(identifier="winrm_credential_id",
        org_id="org_identifier")
    # Data source to retrieve project level WinRM credential
    project_example = harness.platform.get_secret_winrm(identifier="winrm_credential_id",
        org_id="org_identifier",
        project_id="project_identifier")
    pulumi.export("winrmPort", example.port)
    pulumi.export("winrmAuthType", len(example.ntlms).apply(lambda length: "NTLM" if length > 0 else "Kerberos"))
    
    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 {
    		// Data source to retrieve account level WinRM credential by identifier
    		example, err := platform.LookupSecretWinrm(ctx, &platform.LookupSecretWinrmArgs{
    			Identifier: "winrm_credential_id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Data source to retrieve organization level WinRM credential
    		_, err = platform.LookupSecretWinrm(ctx, &platform.LookupSecretWinrmArgs{
    			Identifier: "winrm_credential_id",
    			OrgId:      pulumi.StringRef("org_identifier"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Data source to retrieve project level WinRM credential
    		_, err = platform.LookupSecretWinrm(ctx, &platform.LookupSecretWinrmArgs{
    			Identifier: "winrm_credential_id",
    			OrgId:      pulumi.StringRef("org_identifier"),
    			ProjectId:  pulumi.StringRef("project_identifier"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("winrmPort", example.Port)
    		var tmp0 string
    		if length > 0 {
    			tmp0 = "NTLM"
    		} else {
    			tmp0 = "Kerberos"
    		}
    		ctx.Export("winrmAuthType", len(example.Ntlms).ApplyT(func(length int) (string, error) {
    			return tmp0, nil
    		}).(pulumi.StringOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        // Data source to retrieve account level WinRM credential by identifier
        var example = Harness.Platform.GetSecretWinrm.Invoke(new()
        {
            Identifier = "winrm_credential_id",
        });
    
        // Data source to retrieve organization level WinRM credential
        var orgExample = Harness.Platform.GetSecretWinrm.Invoke(new()
        {
            Identifier = "winrm_credential_id",
            OrgId = "org_identifier",
        });
    
        // Data source to retrieve project level WinRM credential
        var projectExample = Harness.Platform.GetSecretWinrm.Invoke(new()
        {
            Identifier = "winrm_credential_id",
            OrgId = "org_identifier",
            ProjectId = "project_identifier",
        });
    
        return new Dictionary<string, object?>
        {
            ["winrmPort"] = example.Apply(getSecretWinrmResult => getSecretWinrmResult.Port),
            ["winrmAuthType"] = example.Apply(getSecretWinrmResult => getSecretWinrmResult.Ntlms).Length.Apply(length => length > 0 ? "NTLM" : "Kerberos"),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.PlatformFunctions;
    import com.pulumi.harness.platform.inputs.GetSecretWinrmArgs;
    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) {
            // Data source to retrieve account level WinRM credential by identifier
            final var example = PlatformFunctions.getSecretWinrm(GetSecretWinrmArgs.builder()
                .identifier("winrm_credential_id")
                .build());
    
            // Data source to retrieve organization level WinRM credential
            final var orgExample = PlatformFunctions.getSecretWinrm(GetSecretWinrmArgs.builder()
                .identifier("winrm_credential_id")
                .orgId("org_identifier")
                .build());
    
            // Data source to retrieve project level WinRM credential
            final var projectExample = PlatformFunctions.getSecretWinrm(GetSecretWinrmArgs.builder()
                .identifier("winrm_credential_id")
                .orgId("org_identifier")
                .projectId("project_identifier")
                .build());
    
            ctx.export("winrmPort", example.port());
            ctx.export("winrmAuthType", example.ntlms().length().applyValue(_length -> _length > 0 ? "NTLM" : "Kerberos"));
        }
    }
    
    Example coming soon!
    

    Using getSecretWinrm

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSecretWinrm(args: GetSecretWinrmArgs, opts?: InvokeOptions): Promise<GetSecretWinrmResult>
    function getSecretWinrmOutput(args: GetSecretWinrmOutputArgs, opts?: InvokeOptions): Output<GetSecretWinrmResult>
    def get_secret_winrm(identifier: Optional[str] = None,
                         name: Optional[str] = None,
                         org_id: Optional[str] = None,
                         project_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetSecretWinrmResult
    def get_secret_winrm_output(identifier: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         org_id: Optional[pulumi.Input[str]] = None,
                         project_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetSecretWinrmResult]
    func LookupSecretWinrm(ctx *Context, args *LookupSecretWinrmArgs, opts ...InvokeOption) (*LookupSecretWinrmResult, error)
    func LookupSecretWinrmOutput(ctx *Context, args *LookupSecretWinrmOutputArgs, opts ...InvokeOption) LookupSecretWinrmResultOutput

    > Note: This function is named LookupSecretWinrm in the Go SDK.

    public static class GetSecretWinrm 
    {
        public static Task<GetSecretWinrmResult> InvokeAsync(GetSecretWinrmArgs args, InvokeOptions? opts = null)
        public static Output<GetSecretWinrmResult> Invoke(GetSecretWinrmInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecretWinrmResult> getSecretWinrm(GetSecretWinrmArgs args, InvokeOptions options)
    public static Output<GetSecretWinrmResult> getSecretWinrm(GetSecretWinrmArgs args, InvokeOptions options)
    
    fn::invoke:
      function: harness:platform/getSecretWinrm:getSecretWinrm
      arguments:
        # arguments dictionary

    The following arguments are supported:

    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.
    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.
    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.
    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.
    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.
    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.

    getSecretWinrm Result

    The following output properties are available:

    Description string
    Description of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource.
    Kerberos List<GetSecretWinrmKerbero>
    Kerberos authentication scheme
    Ntlms List<GetSecretWinrmNtlm>
    NTLM authentication scheme
    Port int
    WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
    Tags List<string>
    Tags to associate with the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Description string
    Description of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource.
    Kerberos []GetSecretWinrmKerbero
    Kerberos authentication scheme
    Ntlms []GetSecretWinrmNtlm
    NTLM authentication scheme
    Port int
    WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
    Tags []string
    Tags to associate with the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    description String
    Description of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource.
    kerberos List<GetSecretWinrmKerbero>
    Kerberos authentication scheme
    ntlms List<GetSecretWinrmNtlm>
    NTLM authentication scheme
    port Integer
    WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
    tags List<String>
    Tags to associate with the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    description string
    Description of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    identifier string
    Unique identifier of the resource.
    kerberos GetSecretWinrmKerbero[]
    Kerberos authentication scheme
    ntlms GetSecretWinrmNtlm[]
    NTLM authentication scheme
    port number
    WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
    tags string[]
    Tags to associate with the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    description str
    Description of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    identifier str
    Unique identifier of the resource.
    kerberos Sequence[GetSecretWinrmKerbero]
    Kerberos authentication scheme
    ntlms Sequence[GetSecretWinrmNtlm]
    NTLM authentication scheme
    port int
    WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
    tags Sequence[str]
    Tags to associate with the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    description String
    Description of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource.
    kerberos List<Property Map>
    Kerberos authentication scheme
    ntlms List<Property Map>
    NTLM authentication scheme
    port Number
    WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
    tags List<String>
    Tags to associate with the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.

    Supporting Types

    GetSecretWinrmKerbero

    Principal string
    Kerberos principal.
    Realm string
    Kerberos realm.
    SkipCertCheck bool
    Skip certificate verification.
    TgtGenerationMethod string
    Method to generate TGT (Ticket Granting Ticket).
    TgtKeyTabFilePathSpecs List<GetSecretWinrmKerberoTgtKeyTabFilePathSpec>
    TGT generation using key tab file.
    TgtPasswordSpecs List<GetSecretWinrmKerberoTgtPasswordSpec>
    TGT generation using password.
    UseNoProfile bool
    Use no profile.
    UseSsl bool
    Use SSL/TLS for WinRM communication.
    Principal string
    Kerberos principal.
    Realm string
    Kerberos realm.
    SkipCertCheck bool
    Skip certificate verification.
    TgtGenerationMethod string
    Method to generate TGT (Ticket Granting Ticket).
    TgtKeyTabFilePathSpecs []GetSecretWinrmKerberoTgtKeyTabFilePathSpec
    TGT generation using key tab file.
    TgtPasswordSpecs []GetSecretWinrmKerberoTgtPasswordSpec
    TGT generation using password.
    UseNoProfile bool
    Use no profile.
    UseSsl bool
    Use SSL/TLS for WinRM communication.
    principal String
    Kerberos principal.
    realm String
    Kerberos realm.
    skipCertCheck Boolean
    Skip certificate verification.
    tgtGenerationMethod String
    Method to generate TGT (Ticket Granting Ticket).
    tgtKeyTabFilePathSpecs List<GetSecretWinrmKerberoTgtKeyTabFilePathSpec>
    TGT generation using key tab file.
    tgtPasswordSpecs List<GetSecretWinrmKerberoTgtPasswordSpec>
    TGT generation using password.
    useNoProfile Boolean
    Use no profile.
    useSsl Boolean
    Use SSL/TLS for WinRM communication.
    principal string
    Kerberos principal.
    realm string
    Kerberos realm.
    skipCertCheck boolean
    Skip certificate verification.
    tgtGenerationMethod string
    Method to generate TGT (Ticket Granting Ticket).
    tgtKeyTabFilePathSpecs GetSecretWinrmKerberoTgtKeyTabFilePathSpec[]
    TGT generation using key tab file.
    tgtPasswordSpecs GetSecretWinrmKerberoTgtPasswordSpec[]
    TGT generation using password.
    useNoProfile boolean
    Use no profile.
    useSsl boolean
    Use SSL/TLS for WinRM communication.
    principal str
    Kerberos principal.
    realm str
    Kerberos realm.
    skip_cert_check bool
    Skip certificate verification.
    tgt_generation_method str
    Method to generate TGT (Ticket Granting Ticket).
    tgt_key_tab_file_path_specs Sequence[GetSecretWinrmKerberoTgtKeyTabFilePathSpec]
    TGT generation using key tab file.
    tgt_password_specs Sequence[GetSecretWinrmKerberoTgtPasswordSpec]
    TGT generation using password.
    use_no_profile bool
    Use no profile.
    use_ssl bool
    Use SSL/TLS for WinRM communication.
    principal String
    Kerberos principal.
    realm String
    Kerberos realm.
    skipCertCheck Boolean
    Skip certificate verification.
    tgtGenerationMethod String
    Method to generate TGT (Ticket Granting Ticket).
    tgtKeyTabFilePathSpecs List<Property Map>
    TGT generation using key tab file.
    tgtPasswordSpecs List<Property Map>
    TGT generation using password.
    useNoProfile Boolean
    Use no profile.
    useSsl Boolean
    Use SSL/TLS for WinRM communication.

    GetSecretWinrmKerberoTgtKeyTabFilePathSpec

    KeyPath string
    Path to the key tab file.
    KeyPath string
    Path to the key tab file.
    keyPath String
    Path to the key tab file.
    keyPath string
    Path to the key tab file.
    key_path str
    Path to the key tab file.
    keyPath String
    Path to the key tab file.

    GetSecretWinrmKerberoTgtPasswordSpec

    PasswordRef string
    Reference to a secret containing the password.
    PasswordRef string
    Reference to a secret containing the password.
    passwordRef String
    Reference to a secret containing the password.
    passwordRef string
    Reference to a secret containing the password.
    password_ref str
    Reference to a secret containing the password.
    passwordRef String
    Reference to a secret containing the password.

    GetSecretWinrmNtlm

    Domain string
    Domain name for NTLM authentication.
    PasswordRef string
    Reference to a secret containing the password to use for authentication.
    SkipCertCheck bool
    Skip certificate verification.
    UseNoProfile bool
    Use no profile.
    UseSsl bool
    Use SSL/TLS for WinRM communication.
    Username string
    Username to use for authentication.
    Domain string
    Domain name for NTLM authentication.
    PasswordRef string
    Reference to a secret containing the password to use for authentication.
    SkipCertCheck bool
    Skip certificate verification.
    UseNoProfile bool
    Use no profile.
    UseSsl bool
    Use SSL/TLS for WinRM communication.
    Username string
    Username to use for authentication.
    domain String
    Domain name for NTLM authentication.
    passwordRef String
    Reference to a secret containing the password to use for authentication.
    skipCertCheck Boolean
    Skip certificate verification.
    useNoProfile Boolean
    Use no profile.
    useSsl Boolean
    Use SSL/TLS for WinRM communication.
    username String
    Username to use for authentication.
    domain string
    Domain name for NTLM authentication.
    passwordRef string
    Reference to a secret containing the password to use for authentication.
    skipCertCheck boolean
    Skip certificate verification.
    useNoProfile boolean
    Use no profile.
    useSsl boolean
    Use SSL/TLS for WinRM communication.
    username string
    Username to use for authentication.
    domain str
    Domain name for NTLM authentication.
    password_ref str
    Reference to a secret containing the password to use for authentication.
    skip_cert_check bool
    Skip certificate verification.
    use_no_profile bool
    Use no profile.
    use_ssl bool
    Use SSL/TLS for WinRM communication.
    username str
    Username to use for authentication.
    domain String
    Domain name for NTLM authentication.
    passwordRef String
    Reference to a secret containing the password to use for authentication.
    skipCertCheck Boolean
    Skip certificate verification.
    useNoProfile Boolean
    Use no profile.
    useSsl Boolean
    Use SSL/TLS for WinRM communication.
    username String
    Username to use for authentication.

    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.9.3 published on Tuesday, Nov 25, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate