vault logo
HashiCorp Vault v5.11.0, Apr 25 23

vault.identity.getOidcClientCreds

Explore with Pulumi AI

Example Usage

using System.Collections.Generic;
using Pulumi;
using Vault = Pulumi.Vault;

return await Deployment.RunAsync(() => 
{
    var app = new Vault.Identity.OidcClient("app", new()
    {
        RedirectUris = new[]
        {
            "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
            "http://127.0.0.1:8251/callback",
            "http://127.0.0.1:8080/callback",
        },
        IdTokenTtl = 2400,
        AccessTokenTtl = 7200,
    });

    var creds = Vault.Identity.GetOidcClientCreds.Invoke(new()
    {
        Name = app.Name,
    });

});
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		app, err := identity.NewOidcClient(ctx, "app", &identity.OidcClientArgs{
			RedirectUris: pulumi.StringArray{
				pulumi.String("http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback"),
				pulumi.String("http://127.0.0.1:8251/callback"),
				pulumi.String("http://127.0.0.1:8080/callback"),
			},
			IdTokenTtl:     pulumi.Int(2400),
			AccessTokenTtl: pulumi.Int(7200),
		})
		if err != nil {
			return err
		}
		_ = identity.GetOidcClientCredsOutput(ctx, identity.GetOidcClientCredsOutputArgs{
			Name: app.Name,
		}, nil)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.identity.OidcClient;
import com.pulumi.vault.identity.OidcClientArgs;
import com.pulumi.vault.identity.IdentityFunctions;
import com.pulumi.vault.identity.inputs.GetOidcClientCredsArgs;
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 app = new OidcClient("app", OidcClientArgs.builder()        
            .redirectUris(            
                "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
                "http://127.0.0.1:8251/callback",
                "http://127.0.0.1:8080/callback")
            .idTokenTtl(2400)
            .accessTokenTtl(7200)
            .build());

        final var creds = IdentityFunctions.getOidcClientCreds(GetOidcClientCredsArgs.builder()
            .name(app.name())
            .build());

    }
}
import pulumi
import pulumi_vault as vault

app = vault.identity.OidcClient("app",
    redirect_uris=[
        "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
        "http://127.0.0.1:8251/callback",
        "http://127.0.0.1:8080/callback",
    ],
    id_token_ttl=2400,
    access_token_ttl=7200)
creds = vault.identity.get_oidc_client_creds_output(name=app.name)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const app = new vault.identity.OidcClient("app", {
    redirectUris: [
        "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
        "http://127.0.0.1:8251/callback",
        "http://127.0.0.1:8080/callback",
    ],
    idTokenTtl: 2400,
    accessTokenTtl: 7200,
});
const creds = vault.identity.getOidcClientCredsOutput({
    name: app.name,
});
resources:
  app:
    type: vault:identity:OidcClient
    properties:
      redirectUris:
        - http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback
        - http://127.0.0.1:8251/callback
        - http://127.0.0.1:8080/callback
      idTokenTtl: 2400
      accessTokenTtl: 7200
variables:
  creds:
    Fn::Invoke:
      Function: vault:identity:getOidcClientCreds
      Arguments:
        name: ${app.name}

Using getOidcClientCreds

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 getOidcClientCreds(args: GetOidcClientCredsArgs, opts?: InvokeOptions): Promise<GetOidcClientCredsResult>
function getOidcClientCredsOutput(args: GetOidcClientCredsOutputArgs, opts?: InvokeOptions): Output<GetOidcClientCredsResult>
def get_oidc_client_creds(name: Optional[str] = None,
                          namespace: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetOidcClientCredsResult
def get_oidc_client_creds_output(name: Optional[pulumi.Input[str]] = None,
                          namespace: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetOidcClientCredsResult]
func GetOidcClientCreds(ctx *Context, args *GetOidcClientCredsArgs, opts ...InvokeOption) (*GetOidcClientCredsResult, error)
func GetOidcClientCredsOutput(ctx *Context, args *GetOidcClientCredsOutputArgs, opts ...InvokeOption) GetOidcClientCredsResultOutput

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

public static class GetOidcClientCreds 
{
    public static Task<GetOidcClientCredsResult> InvokeAsync(GetOidcClientCredsArgs args, InvokeOptions? opts = null)
    public static Output<GetOidcClientCredsResult> Invoke(GetOidcClientCredsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetOidcClientCredsResult> getOidcClientCreds(GetOidcClientCredsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: vault:identity/getOidcClientCreds:getOidcClientCreds
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of the OIDC Client in Vault.

Namespace string

The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

Name string

The name of the OIDC Client in Vault.

Namespace string

The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

name String

The name of the OIDC Client in Vault.

namespace String

The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

name string

The name of the OIDC Client in Vault.

namespace string

The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

name str

The name of the OIDC Client in Vault.

namespace str

The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

name String

The name of the OIDC Client in Vault.

namespace String

The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

getOidcClientCreds Result

The following output properties are available:

ClientId string

The Client ID returned by Vault.

ClientSecret string

The Client Secret Key returned by Vault.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Namespace string
ClientId string

The Client ID returned by Vault.

ClientSecret string

The Client Secret Key returned by Vault.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Namespace string
clientId String

The Client ID returned by Vault.

clientSecret String

The Client Secret Key returned by Vault.

id String

The provider-assigned unique ID for this managed resource.

name String
namespace String
clientId string

The Client ID returned by Vault.

clientSecret string

The Client Secret Key returned by Vault.

id string

The provider-assigned unique ID for this managed resource.

name string
namespace string
client_id str

The Client ID returned by Vault.

client_secret str

The Client Secret Key returned by Vault.

id str

The provider-assigned unique ID for this managed resource.

name str
namespace str
clientId String

The Client ID returned by Vault.

clientSecret String

The Client Secret Key returned by Vault.

id String

The provider-assigned unique ID for this managed resource.

name String
namespace String

Package Details

Repository
Vault pulumi/pulumi-vault
License
Apache-2.0
Notes

This Pulumi package is based on the vault Terraform Provider.