HashiCorp Vault

v5.7.0 published on Thursday, Oct 13, 2022 by Pulumi

AuthBackendRoleSecretId

Manages an AppRole auth backend SecretID in a Vault server. See the Vault documentation for more information.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var approle = new Vault.AuthBackend("approle", new()
    {
        Type = "approle",
    });

    var example = new Vault.AppRole.AuthBackendRole("example", new()
    {
        Backend = approle.Path,
        RoleName = "test-role",
        TokenPolicies = new[]
        {
            "default",
            "dev",
            "prod",
        },
    });

    var id = new Vault.AppRole.AuthBackendRoleSecretId("id", new()
    {
        Backend = approle.Path,
        RoleName = example.RoleName,
        Metadata = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["hello"] = "world",
        }),
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault"
	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault/appRole"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		approle, err := vault.NewAuthBackend(ctx, "approle", &vault.AuthBackendArgs{
			Type: pulumi.String("approle"),
		})
		if err != nil {
			return err
		}
		example, err := appRole.NewAuthBackendRole(ctx, "example", &appRole.AuthBackendRoleArgs{
			Backend:  approle.Path,
			RoleName: pulumi.String("test-role"),
			TokenPolicies: pulumi.StringArray{
				pulumi.String("default"),
				pulumi.String("dev"),
				pulumi.String("prod"),
			},
		})
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"hello": "world",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = appRole.NewAuthBackendRoleSecretId(ctx, "id", &appRole.AuthBackendRoleSecretIdArgs{
			Backend:  approle.Path,
			RoleName: example.RoleName,
			Metadata: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.AuthBackend;
import com.pulumi.vault.AuthBackendArgs;
import com.pulumi.vault.appRole.AuthBackendRole;
import com.pulumi.vault.appRole.AuthBackendRoleArgs;
import com.pulumi.vault.appRole.AuthBackendRoleSecretId;
import com.pulumi.vault.appRole.AuthBackendRoleSecretIdArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 approle = new AuthBackend("approle", AuthBackendArgs.builder()        
            .type("approle")
            .build());

        var example = new AuthBackendRole("example", AuthBackendRoleArgs.builder()        
            .backend(approle.path())
            .roleName("test-role")
            .tokenPolicies(            
                "default",
                "dev",
                "prod")
            .build());

        var id = new AuthBackendRoleSecretId("id", AuthBackendRoleSecretIdArgs.builder()        
            .backend(approle.path())
            .roleName(example.roleName())
            .metadata(serializeJson(
                jsonObject(
                    jsonProperty("hello", "world")
                )))
            .build());

    }
}
import pulumi
import json
import pulumi_vault as vault

approle = vault.AuthBackend("approle", type="approle")
example = vault.app_role.AuthBackendRole("example",
    backend=approle.path,
    role_name="test-role",
    token_policies=[
        "default",
        "dev",
        "prod",
    ])
id = vault.app_role.AuthBackendRoleSecretId("id",
    backend=approle.path,
    role_name=example.role_name,
    metadata=json.dumps({
        "hello": "world",
    }))
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const approle = new vault.AuthBackend("approle", {type: "approle"});
const example = new vault.approle.AuthBackendRole("example", {
    backend: approle.path,
    roleName: "test-role",
    tokenPolicies: [
        "default",
        "dev",
        "prod",
    ],
});
const id = new vault.approle.AuthBackendRoleSecretId("id", {
    backend: approle.path,
    roleName: example.roleName,
    metadata: JSON.stringify({
        hello: "world",
    }),
});
resources:
  approle:
    type: vault:AuthBackend
    properties:
      type: approle
  example:
    type: vault:appRole:AuthBackendRole
    properties:
      backend: ${approle.path}
      roleName: test-role
      tokenPolicies:
        - default
        - dev
        - prod
  id:
    type: vault:appRole:AuthBackendRoleSecretId
    properties:
      backend: ${approle.path}
      roleName: ${example.roleName}
      metadata:
        Fn::ToJSON:
          hello: world

Create AuthBackendRoleSecretId Resource

new AuthBackendRoleSecretId(name: string, args: AuthBackendRoleSecretIdArgs, opts?: CustomResourceOptions);
@overload
def AuthBackendRoleSecretId(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            backend: Optional[str] = None,
                            cidr_lists: Optional[Sequence[str]] = None,
                            metadata: Optional[str] = None,
                            namespace: Optional[str] = None,
                            role_name: Optional[str] = None,
                            secret_id: Optional[str] = None,
                            with_wrapped_accessor: Optional[bool] = None,
                            wrapping_ttl: Optional[str] = None)
@overload
def AuthBackendRoleSecretId(resource_name: str,
                            args: AuthBackendRoleSecretIdArgs,
                            opts: Optional[ResourceOptions] = None)
func NewAuthBackendRoleSecretId(ctx *Context, name string, args AuthBackendRoleSecretIdArgs, opts ...ResourceOption) (*AuthBackendRoleSecretId, error)
public AuthBackendRoleSecretId(string name, AuthBackendRoleSecretIdArgs args, CustomResourceOptions? opts = null)
public AuthBackendRoleSecretId(String name, AuthBackendRoleSecretIdArgs args)
public AuthBackendRoleSecretId(String name, AuthBackendRoleSecretIdArgs args, CustomResourceOptions options)
type: vault:appRole:AuthBackendRoleSecretId
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AuthBackendRoleSecretIdArgs
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 AuthBackendRoleSecretIdArgs
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 AuthBackendRoleSecretIdArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AuthBackendRoleSecretIdArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AuthBackendRoleSecretIdArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AuthBackendRoleSecretId Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AuthBackendRoleSecretId resource accepts the following input properties:

RoleName string

The name of the role to create the SecretID for.

Backend string

Unique name of the auth backend to configure.

CidrLists List<string>

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

Metadata string

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

Namespace string

The namespace to provision the resource in. 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.

SecretId string

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

WithWrappedAccessor bool

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

WrappingTtl string

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

RoleName string

The name of the role to create the SecretID for.

Backend string

Unique name of the auth backend to configure.

CidrLists []string

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

Metadata string

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

Namespace string

The namespace to provision the resource in. 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.

SecretId string

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

WithWrappedAccessor bool

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

WrappingTtl string

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

roleName String

The name of the role to create the SecretID for.

backend String

Unique name of the auth backend to configure.

cidrLists List<String>

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata String

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace String

The namespace to provision the resource in. 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.

secretId String

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

withWrappedAccessor Boolean

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrappingTtl String

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

roleName string

The name of the role to create the SecretID for.

backend string

Unique name of the auth backend to configure.

cidrLists string[]

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata string

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace string

The namespace to provision the resource in. 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.

secretId string

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

withWrappedAccessor boolean

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrappingTtl string

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

role_name str

The name of the role to create the SecretID for.

backend str

Unique name of the auth backend to configure.

cidr_lists Sequence[str]

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata str

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace str

The namespace to provision the resource in. 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.

secret_id str

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

with_wrapped_accessor bool

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrapping_ttl str

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

roleName String

The name of the role to create the SecretID for.

backend String

Unique name of the auth backend to configure.

cidrLists List<String>

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata String

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace String

The namespace to provision the resource in. 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.

secretId String

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

withWrappedAccessor Boolean

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrappingTtl String

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

Outputs

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

Accessor string

The unique ID for this SecretID that can be safely logged.

Id string

The provider-assigned unique ID for this managed resource.

WrappingAccessor string

The unique ID for the response-wrapped SecretID that can be safely logged.

WrappingToken string

The token used to retrieve a response-wrapped SecretID.

Accessor string

The unique ID for this SecretID that can be safely logged.

Id string

The provider-assigned unique ID for this managed resource.

WrappingAccessor string

The unique ID for the response-wrapped SecretID that can be safely logged.

WrappingToken string

The token used to retrieve a response-wrapped SecretID.

accessor String

The unique ID for this SecretID that can be safely logged.

id String

The provider-assigned unique ID for this managed resource.

wrappingAccessor String

The unique ID for the response-wrapped SecretID that can be safely logged.

wrappingToken String

The token used to retrieve a response-wrapped SecretID.

accessor string

The unique ID for this SecretID that can be safely logged.

id string

The provider-assigned unique ID for this managed resource.

wrappingAccessor string

The unique ID for the response-wrapped SecretID that can be safely logged.

wrappingToken string

The token used to retrieve a response-wrapped SecretID.

accessor str

The unique ID for this SecretID that can be safely logged.

id str

The provider-assigned unique ID for this managed resource.

wrapping_accessor str

The unique ID for the response-wrapped SecretID that can be safely logged.

wrapping_token str

The token used to retrieve a response-wrapped SecretID.

accessor String

The unique ID for this SecretID that can be safely logged.

id String

The provider-assigned unique ID for this managed resource.

wrappingAccessor String

The unique ID for the response-wrapped SecretID that can be safely logged.

wrappingToken String

The token used to retrieve a response-wrapped SecretID.

Look up Existing AuthBackendRoleSecretId Resource

Get an existing AuthBackendRoleSecretId 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?: AuthBackendRoleSecretIdState, opts?: CustomResourceOptions): AuthBackendRoleSecretId
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        accessor: Optional[str] = None,
        backend: Optional[str] = None,
        cidr_lists: Optional[Sequence[str]] = None,
        metadata: Optional[str] = None,
        namespace: Optional[str] = None,
        role_name: Optional[str] = None,
        secret_id: Optional[str] = None,
        with_wrapped_accessor: Optional[bool] = None,
        wrapping_accessor: Optional[str] = None,
        wrapping_token: Optional[str] = None,
        wrapping_ttl: Optional[str] = None) -> AuthBackendRoleSecretId
func GetAuthBackendRoleSecretId(ctx *Context, name string, id IDInput, state *AuthBackendRoleSecretIdState, opts ...ResourceOption) (*AuthBackendRoleSecretId, error)
public static AuthBackendRoleSecretId Get(string name, Input<string> id, AuthBackendRoleSecretIdState? state, CustomResourceOptions? opts = null)
public static AuthBackendRoleSecretId get(String name, Output<String> id, AuthBackendRoleSecretIdState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
Accessor string

The unique ID for this SecretID that can be safely logged.

Backend string

Unique name of the auth backend to configure.

CidrLists List<string>

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

Metadata string

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

Namespace string

The namespace to provision the resource in. 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.

RoleName string

The name of the role to create the SecretID for.

SecretId string

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

WithWrappedAccessor bool

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

WrappingAccessor string

The unique ID for the response-wrapped SecretID that can be safely logged.

WrappingToken string

The token used to retrieve a response-wrapped SecretID.

WrappingTtl string

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

Accessor string

The unique ID for this SecretID that can be safely logged.

Backend string

Unique name of the auth backend to configure.

CidrLists []string

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

Metadata string

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

Namespace string

The namespace to provision the resource in. 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.

RoleName string

The name of the role to create the SecretID for.

SecretId string

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

WithWrappedAccessor bool

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

WrappingAccessor string

The unique ID for the response-wrapped SecretID that can be safely logged.

WrappingToken string

The token used to retrieve a response-wrapped SecretID.

WrappingTtl string

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

accessor String

The unique ID for this SecretID that can be safely logged.

backend String

Unique name of the auth backend to configure.

cidrLists List<String>

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata String

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace String

The namespace to provision the resource in. 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.

roleName String

The name of the role to create the SecretID for.

secretId String

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

withWrappedAccessor Boolean

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrappingAccessor String

The unique ID for the response-wrapped SecretID that can be safely logged.

wrappingToken String

The token used to retrieve a response-wrapped SecretID.

wrappingTtl String

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

accessor string

The unique ID for this SecretID that can be safely logged.

backend string

Unique name of the auth backend to configure.

cidrLists string[]

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata string

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace string

The namespace to provision the resource in. 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.

roleName string

The name of the role to create the SecretID for.

secretId string

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

withWrappedAccessor boolean

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrappingAccessor string

The unique ID for the response-wrapped SecretID that can be safely logged.

wrappingToken string

The token used to retrieve a response-wrapped SecretID.

wrappingTtl string

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

accessor str

The unique ID for this SecretID that can be safely logged.

backend str

Unique name of the auth backend to configure.

cidr_lists Sequence[str]

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata str

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace str

The namespace to provision the resource in. 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.

role_name str

The name of the role to create the SecretID for.

secret_id str

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

with_wrapped_accessor bool

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrapping_accessor str

The unique ID for the response-wrapped SecretID that can be safely logged.

wrapping_token str

The token used to retrieve a response-wrapped SecretID.

wrapping_ttl str

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

accessor String

The unique ID for this SecretID that can be safely logged.

backend String

Unique name of the auth backend to configure.

cidrLists List<String>

If set, specifies blocks of IP addresses which can perform the login operation using this SecretID.

metadata String

A JSON-encoded string containing metadata in key-value pairs to be set on tokens issued with this SecretID.

namespace String

The namespace to provision the resource in. 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.

roleName String

The name of the role to create the SecretID for.

secretId String

The SecretID to be created. If set, uses "Push" mode. Defaults to Vault auto-generating SecretIDs.

withWrappedAccessor Boolean

Set to true to use the wrapped secret-id accessor as the resource ID. If false (default value), a fresh secret ID will be regenerated whenever the wrapping token is expired or invalidated through unwrapping.

wrappingAccessor String

The unique ID for the response-wrapped SecretID that can be safely logged.

wrappingToken String

The token used to retrieve a response-wrapped SecretID.

wrappingTtl String

If set, the SecretID response will be response-wrapped and available for the duration specified. Only a single unwrapping of the token is allowed.

Package Details

Repository
https://github.com/pulumi/pulumi-vault
License
Apache-2.0
Notes

This Pulumi package is based on the vault Terraform Provider.