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 dictionaryThe following arguments are supported:
- Identifier string
- Unique identifier of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- Identifier string
- Unique identifier of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- identifier String
- Unique identifier of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- identifier string
- Unique identifier of the resource.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- project
Id 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.
- org
Id String - Unique identifier of the organization.
- project
Id 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<Get
Secret Winrm Kerbero> - Kerberos authentication scheme
- Ntlms
List<Get
Secret Winrm Ntlm> - NTLM authentication scheme
- Port int
- WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
- List<string>
- Tags to associate with the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id 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
[]Get
Secret Winrm Kerbero - Kerberos authentication scheme
- Ntlms
[]Get
Secret Winrm Ntlm - NTLM authentication scheme
- Port int
- WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
- []string
- Tags to associate with the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id 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<Get
Secret Winrm Kerbero> - Kerberos authentication scheme
- ntlms
List<Get
Secret Winrm Ntlm> - NTLM authentication scheme
- port Integer
- WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
- List<String>
- Tags to associate with the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id 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
Get
Secret Winrm Kerbero[] - Kerberos authentication scheme
- ntlms
Get
Secret Winrm Ntlm[] - NTLM authentication scheme
- port number
- WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
- string[]
- Tags to associate with the resource.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- project
Id 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[Get
Secret Winrm Kerbero] - Kerberos authentication scheme
- ntlms
Sequence[Get
Secret Winrm Ntlm] - NTLM authentication scheme
- port int
- WinRM port. Default is 5986 for HTTPS, 5985 for HTTP.
- 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.
- List<String>
- Tags to associate with the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
Supporting Types
GetSecretWinrmKerbero
- Principal string
- Kerberos principal.
- Realm string
- Kerberos realm.
- Skip
Cert boolCheck - Skip certificate verification.
- Tgt
Generation stringMethod - Method to generate TGT (Ticket Granting Ticket).
- Tgt
Key List<GetTab File Path Specs Secret Winrm Kerbero Tgt Key Tab File Path Spec> - TGT generation using key tab file.
- Tgt
Password List<GetSpecs Secret Winrm Kerbero Tgt Password Spec> - TGT generation using password.
- Use
No boolProfile - Use no profile.
- Use
Ssl bool - Use SSL/TLS for WinRM communication.
- Principal string
- Kerberos principal.
- Realm string
- Kerberos realm.
- Skip
Cert boolCheck - Skip certificate verification.
- Tgt
Generation stringMethod - Method to generate TGT (Ticket Granting Ticket).
- Tgt
Key []GetTab File Path Specs Secret Winrm Kerbero Tgt Key Tab File Path Spec - TGT generation using key tab file.
- Tgt
Password []GetSpecs Secret Winrm Kerbero Tgt Password Spec - TGT generation using password.
- Use
No boolProfile - Use no profile.
- Use
Ssl bool - Use SSL/TLS for WinRM communication.
- principal String
- Kerberos principal.
- realm String
- Kerberos realm.
- skip
Cert BooleanCheck - Skip certificate verification.
- tgt
Generation StringMethod - Method to generate TGT (Ticket Granting Ticket).
- tgt
Key List<GetTab File Path Specs Secret Winrm Kerbero Tgt Key Tab File Path Spec> - TGT generation using key tab file.
- tgt
Password List<GetSpecs Secret Winrm Kerbero Tgt Password Spec> - TGT generation using password.
- use
No BooleanProfile - Use no profile.
- use
Ssl Boolean - Use SSL/TLS for WinRM communication.
- principal string
- Kerberos principal.
- realm string
- Kerberos realm.
- skip
Cert booleanCheck - Skip certificate verification.
- tgt
Generation stringMethod - Method to generate TGT (Ticket Granting Ticket).
- tgt
Key GetTab File Path Specs Secret Winrm Kerbero Tgt Key Tab File Path Spec[] - TGT generation using key tab file.
- tgt
Password GetSpecs Secret Winrm Kerbero Tgt Password Spec[] - TGT generation using password.
- use
No booleanProfile - Use no profile.
- use
Ssl boolean - Use SSL/TLS for WinRM communication.
- principal str
- Kerberos principal.
- realm str
- Kerberos realm.
- skip_
cert_ boolcheck - Skip certificate verification.
- tgt_
generation_ strmethod - Method to generate TGT (Ticket Granting Ticket).
- tgt_
key_ Sequence[Gettab_ file_ path_ specs Secret Winrm Kerbero Tgt Key Tab File Path Spec] - TGT generation using key tab file.
- tgt_
password_ Sequence[Getspecs Secret Winrm Kerbero Tgt Password Spec] - TGT generation using password.
- use_
no_ boolprofile - Use no profile.
- use_
ssl bool - Use SSL/TLS for WinRM communication.
- principal String
- Kerberos principal.
- realm String
- Kerberos realm.
- skip
Cert BooleanCheck - Skip certificate verification.
- tgt
Generation StringMethod - Method to generate TGT (Ticket Granting Ticket).
- tgt
Key List<Property Map>Tab File Path Specs - TGT generation using key tab file.
- tgt
Password List<Property Map>Specs - TGT generation using password.
- use
No BooleanProfile - Use no profile.
- use
Ssl Boolean - Use SSL/TLS for WinRM communication.
GetSecretWinrmKerberoTgtKeyTabFilePathSpec
- Key
Path string - Path to the key tab file.
- Key
Path string - Path to the key tab file.
- key
Path String - Path to the key tab file.
- key
Path string - Path to the key tab file.
- key_
path str - Path to the key tab file.
- key
Path String - Path to the key tab file.
GetSecretWinrmKerberoTgtPasswordSpec
- Password
Ref string - Reference to a secret containing the password.
- Password
Ref string - Reference to a secret containing the password.
- password
Ref String - Reference to a secret containing the password.
- password
Ref string - Reference to a secret containing the password.
- password_
ref str - Reference to a secret containing the password.
- password
Ref String - Reference to a secret containing the password.
GetSecretWinrmNtlm
- Domain string
- Domain name for NTLM authentication.
- Password
Ref string - Reference to a secret containing the password to use for authentication.
- Skip
Cert boolCheck - Skip certificate verification.
- Use
No boolProfile - Use no profile.
- Use
Ssl bool - Use SSL/TLS for WinRM communication.
- Username string
- Username to use for authentication.
- Domain string
- Domain name for NTLM authentication.
- Password
Ref string - Reference to a secret containing the password to use for authentication.
- Skip
Cert boolCheck - Skip certificate verification.
- Use
No boolProfile - Use no profile.
- Use
Ssl bool - Use SSL/TLS for WinRM communication.
- Username string
- Username to use for authentication.
- domain String
- Domain name for NTLM authentication.
- password
Ref String - Reference to a secret containing the password to use for authentication.
- skip
Cert BooleanCheck - Skip certificate verification.
- use
No BooleanProfile - Use no profile.
- use
Ssl Boolean - Use SSL/TLS for WinRM communication.
- username String
- Username to use for authentication.
- domain string
- Domain name for NTLM authentication.
- password
Ref string - Reference to a secret containing the password to use for authentication.
- skip
Cert booleanCheck - Skip certificate verification.
- use
No booleanProfile - Use no profile.
- use
Ssl 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_ boolcheck - Skip certificate verification.
- use_
no_ boolprofile - 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.
- password
Ref String - Reference to a secret containing the password to use for authentication.
- skip
Cert BooleanCheck - Skip certificate verification.
- use
No BooleanProfile - Use no profile.
- use
Ssl 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
harnessTerraform Provider.
