1. Packages
  2. HashiCorp Vault Provider
  3. API Docs
  4. transform
  5. Role
HashiCorp Vault v6.6.0 published on Thursday, Mar 13, 2025 by Pulumi

vault.transform.Role

Explore with Pulumi AI

This resource supports the “/transform/role/{name}” Vault endpoint.

It creates or updates the role with the given name. If a role with the name does not exist, it will be created. If the role exists, it will be updated with the new attributes.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const mountTransform = new vault.Mount("mount_transform", {
    path: "transform",
    type: "transform",
});
const test = new vault.transform.Role("test", {
    path: mountTransform.path,
    name: "payments",
    transformations: ["ccn-fpe"],
});
Copy
import pulumi
import pulumi_vault as vault

mount_transform = vault.Mount("mount_transform",
    path="transform",
    type="transform")
test = vault.transform.Role("test",
    path=mount_transform.path,
    name="payments",
    transformations=["ccn-fpe"])
Copy
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/transform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mountTransform, err := vault.NewMount(ctx, "mount_transform", &vault.MountArgs{
			Path: pulumi.String("transform"),
			Type: pulumi.String("transform"),
		})
		if err != nil {
			return err
		}
		_, err = transform.NewRole(ctx, "test", &transform.RoleArgs{
			Path: mountTransform.Path,
			Name: pulumi.String("payments"),
			Transformations: pulumi.StringArray{
				pulumi.String("ccn-fpe"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;

return await Deployment.RunAsync(() => 
{
    var mountTransform = new Vault.Mount("mount_transform", new()
    {
        Path = "transform",
        Type = "transform",
    });

    var test = new Vault.Transform.Role("test", new()
    {
        Path = mountTransform.Path,
        Name = "payments",
        Transformations = new[]
        {
            "ccn-fpe",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.Mount;
import com.pulumi.vault.MountArgs;
import com.pulumi.vault.transform.Role;
import com.pulumi.vault.transform.RoleArgs;
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 mountTransform = new Mount("mountTransform", MountArgs.builder()
            .path("transform")
            .type("transform")
            .build());

        var test = new Role("test", RoleArgs.builder()
            .path(mountTransform.path())
            .name("payments")
            .transformations("ccn-fpe")
            .build());

    }
}
Copy
resources:
  mountTransform:
    type: vault:Mount
    name: mount_transform
    properties:
      path: transform
      type: transform
  test:
    type: vault:transform:Role
    properties:
      path: ${mountTransform.path}
      name: payments
      transformations:
        - ccn-fpe
Copy

Create Role Resource

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

Constructor syntax

new Role(name: string, args: RoleArgs, opts?: CustomResourceOptions);
@overload
def Role(resource_name: str,
         args: RoleArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def Role(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         path: Optional[str] = None,
         name: Optional[str] = None,
         namespace: Optional[str] = None,
         transformations: Optional[Sequence[str]] = None)
func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)
public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)
public Role(String name, RoleArgs args)
public Role(String name, RoleArgs args, CustomResourceOptions options)
type: vault:transform:Role
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RoleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RoleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RoleArgs
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 roleResource = new Vault.Transform.Role("roleResource", new()
{
    Path = "string",
    Name = "string",
    Namespace = "string",
    Transformations = new[]
    {
        "string",
    },
});
Copy
example, err := transform.NewRole(ctx, "roleResource", &transform.RoleArgs{
	Path:      pulumi.String("string"),
	Name:      pulumi.String("string"),
	Namespace: pulumi.String("string"),
	Transformations: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var roleResource = new Role("roleResource", RoleArgs.builder()
    .path("string")
    .name("string")
    .namespace("string")
    .transformations("string")
    .build());
Copy
role_resource = vault.transform.Role("roleResource",
    path="string",
    name="string",
    namespace="string",
    transformations=["string"])
Copy
const roleResource = new vault.transform.Role("roleResource", {
    path: "string",
    name: "string",
    namespace: "string",
    transformations: ["string"],
});
Copy
type: vault:transform:Role
properties:
    name: string
    namespace: string
    path: string
    transformations:
        - string
Copy

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

Path
This property is required.
Changes to this property will trigger replacement.
string
Path to where the back-end is mounted within Vault.
Name Changes to this property will trigger replacement. string
The name of the role.
Namespace Changes to this property will trigger replacement. 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.
Transformations List<string>
A comma separated string or slice of transformations to use.
Path
This property is required.
Changes to this property will trigger replacement.
string
Path to where the back-end is mounted within Vault.
Name Changes to this property will trigger replacement. string
The name of the role.
Namespace Changes to this property will trigger replacement. 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.
Transformations []string
A comma separated string or slice of transformations to use.
path
This property is required.
Changes to this property will trigger replacement.
String
Path to where the back-end is mounted within Vault.
name Changes to this property will trigger replacement. String
The name of the role.
namespace Changes to this property will trigger replacement. 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.
transformations List<String>
A comma separated string or slice of transformations to use.
path
This property is required.
Changes to this property will trigger replacement.
string
Path to where the back-end is mounted within Vault.
name Changes to this property will trigger replacement. string
The name of the role.
namespace Changes to this property will trigger replacement. 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.
transformations string[]
A comma separated string or slice of transformations to use.
path
This property is required.
Changes to this property will trigger replacement.
str
Path to where the back-end is mounted within Vault.
name Changes to this property will trigger replacement. str
The name of the role.
namespace Changes to this property will trigger replacement. 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.
transformations Sequence[str]
A comma separated string or slice of transformations to use.
path
This property is required.
Changes to this property will trigger replacement.
String
Path to where the back-end is mounted within Vault.
name Changes to this property will trigger replacement. String
The name of the role.
namespace Changes to this property will trigger replacement. 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.
transformations List<String>
A comma separated string or slice of transformations to use.

Outputs

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

Get an existing Role 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?: RoleState, opts?: CustomResourceOptions): Role
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None,
        path: Optional[str] = None,
        transformations: Optional[Sequence[str]] = None) -> Role
func GetRole(ctx *Context, name string, id IDInput, state *RoleState, opts ...ResourceOption) (*Role, error)
public static Role Get(string name, Input<string> id, RoleState? state, CustomResourceOptions? opts = null)
public static Role get(String name, Output<String> id, RoleState state, CustomResourceOptions options)
resources:  _:    type: vault:transform:Role    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Name Changes to this property will trigger replacement. string
The name of the role.
Namespace Changes to this property will trigger replacement. 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.
Path Changes to this property will trigger replacement. string
Path to where the back-end is mounted within Vault.
Transformations List<string>
A comma separated string or slice of transformations to use.
Name Changes to this property will trigger replacement. string
The name of the role.
Namespace Changes to this property will trigger replacement. 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.
Path Changes to this property will trigger replacement. string
Path to where the back-end is mounted within Vault.
Transformations []string
A comma separated string or slice of transformations to use.
name Changes to this property will trigger replacement. String
The name of the role.
namespace Changes to this property will trigger replacement. 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.
path Changes to this property will trigger replacement. String
Path to where the back-end is mounted within Vault.
transformations List<String>
A comma separated string or slice of transformations to use.
name Changes to this property will trigger replacement. string
The name of the role.
namespace Changes to this property will trigger replacement. 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.
path Changes to this property will trigger replacement. string
Path to where the back-end is mounted within Vault.
transformations string[]
A comma separated string or slice of transformations to use.
name Changes to this property will trigger replacement. str
The name of the role.
namespace Changes to this property will trigger replacement. 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.
path Changes to this property will trigger replacement. str
Path to where the back-end is mounted within Vault.
transformations Sequence[str]
A comma separated string or slice of transformations to use.
name Changes to this property will trigger replacement. String
The name of the role.
namespace Changes to this property will trigger replacement. 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.
path Changes to this property will trigger replacement. String
Path to where the back-end is mounted within Vault.
transformations List<String>
A comma separated string or slice of transformations to use.

Package Details

Repository
Vault pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.