1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. NomadSecretRole
HashiCorp Vault v5.17.0 published on Thursday, Nov 9, 2023 by Pulumi

vault.NomadSecretRole

Explore with Pulumi AI

vault logo
HashiCorp Vault v5.17.0 published on Thursday, Nov 9, 2023 by Pulumi

    Import

    Nomad secret role can be imported using the backend, e.g.

     $ pulumi import vault:index/nomadSecretRole:NomadSecretRole bob nomad/role/bob
    

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Vault.NomadSecretBackend("config", new()
        {
            Backend = "nomad",
            Description = "test description",
            DefaultLeaseTtlSeconds = 3600,
            MaxLeaseTtlSeconds = 7200,
            Address = "https://127.0.0.1:4646",
            Token = "ae20ceaa-...",
        });
    
        var test = new Vault.NomadSecretRole("test", new()
        {
            Backend = config.Backend,
            Role = "test",
            Type = "client",
            Policies = new[]
            {
                "readonly",
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		config, err := vault.NewNomadSecretBackend(ctx, "config", &vault.NomadSecretBackendArgs{
    			Backend:                pulumi.String("nomad"),
    			Description:            pulumi.String("test description"),
    			DefaultLeaseTtlSeconds: pulumi.Int(3600),
    			MaxLeaseTtlSeconds:     pulumi.Int(7200),
    			Address:                pulumi.String("https://127.0.0.1:4646"),
    			Token:                  pulumi.String("ae20ceaa-..."),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vault.NewNomadSecretRole(ctx, "test", &vault.NomadSecretRoleArgs{
    			Backend: config.Backend,
    			Role:    pulumi.String("test"),
    			Type:    pulumi.String("client"),
    			Policies: pulumi.StringArray{
    				pulumi.String("readonly"),
    			},
    		})
    		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.NomadSecretBackend;
    import com.pulumi.vault.NomadSecretBackendArgs;
    import com.pulumi.vault.NomadSecretRole;
    import com.pulumi.vault.NomadSecretRoleArgs;
    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 config = new NomadSecretBackend("config", NomadSecretBackendArgs.builder()        
                .backend("nomad")
                .description("test description")
                .defaultLeaseTtlSeconds("3600")
                .maxLeaseTtlSeconds("7200")
                .address("https://127.0.0.1:4646")
                .token("ae20ceaa-...")
                .build());
    
            var test = new NomadSecretRole("test", NomadSecretRoleArgs.builder()        
                .backend(config.backend())
                .role("test")
                .type("client")
                .policies("readonly")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_vault as vault
    
    config = vault.NomadSecretBackend("config",
        backend="nomad",
        description="test description",
        default_lease_ttl_seconds=3600,
        max_lease_ttl_seconds=7200,
        address="https://127.0.0.1:4646",
        token="ae20ceaa-...")
    test = vault.NomadSecretRole("test",
        backend=config.backend,
        role="test",
        type="client",
        policies=["readonly"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const config = new vault.NomadSecretBackend("config", {
        backend: "nomad",
        description: "test description",
        defaultLeaseTtlSeconds: 3600,
        maxLeaseTtlSeconds: 7200,
        address: "https://127.0.0.1:4646",
        token: "ae20ceaa-...",
    });
    const test = new vault.NomadSecretRole("test", {
        backend: config.backend,
        role: "test",
        type: "client",
        policies: ["readonly"],
    });
    
    resources:
      config:
        type: vault:NomadSecretBackend
        properties:
          backend: nomad
          description: test description
          defaultLeaseTtlSeconds: '3600'
          maxLeaseTtlSeconds: '7200'
          address: https://127.0.0.1:4646
          token: ae20ceaa-...
      test:
        type: vault:NomadSecretRole
        properties:
          backend: ${config.backend}
          role: test
          type: client
          policies:
            - readonly
    

    Create NomadSecretRole Resource

    new NomadSecretRole(name: string, args: NomadSecretRoleArgs, opts?: CustomResourceOptions);
    @overload
    def NomadSecretRole(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        backend: Optional[str] = None,
                        global_: Optional[bool] = None,
                        namespace: Optional[str] = None,
                        policies: Optional[Sequence[str]] = None,
                        role: Optional[str] = None,
                        type: Optional[str] = None)
    @overload
    def NomadSecretRole(resource_name: str,
                        args: NomadSecretRoleArgs,
                        opts: Optional[ResourceOptions] = None)
    func NewNomadSecretRole(ctx *Context, name string, args NomadSecretRoleArgs, opts ...ResourceOption) (*NomadSecretRole, error)
    public NomadSecretRole(string name, NomadSecretRoleArgs args, CustomResourceOptions? opts = null)
    public NomadSecretRole(String name, NomadSecretRoleArgs args)
    public NomadSecretRole(String name, NomadSecretRoleArgs args, CustomResourceOptions options)
    
    type: vault:NomadSecretRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args NomadSecretRoleArgs
    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 NomadSecretRoleArgs
    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 NomadSecretRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NomadSecretRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NomadSecretRoleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Backend string

    The unique path this backend should be mounted at.

    Role string

    The name to identify this role within the backend. Must be unique within the backend.

    Global bool

    Specifies if the generated token should be global. Defaults to false.

    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.

    Policies List<string>

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    Type string

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    Backend string

    The unique path this backend should be mounted at.

    Role string

    The name to identify this role within the backend. Must be unique within the backend.

    Global bool

    Specifies if the generated token should be global. Defaults to false.

    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.

    Policies []string

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    Type string

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend String

    The unique path this backend should be mounted at.

    role String

    The name to identify this role within the backend. Must be unique within the backend.

    global Boolean

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies List<String>

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    type String

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend string

    The unique path this backend should be mounted at.

    role string

    The name to identify this role within the backend. Must be unique within the backend.

    global boolean

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies string[]

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    type string

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend str

    The unique path this backend should be mounted at.

    role str

    The name to identify this role within the backend. Must be unique within the backend.

    global_ bool

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies Sequence[str]

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    type str

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend String

    The unique path this backend should be mounted at.

    role String

    The name to identify this role within the backend. Must be unique within the backend.

    global Boolean

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies List<String>

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    type String

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    Outputs

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

    Get an existing NomadSecretRole 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?: NomadSecretRoleState, opts?: CustomResourceOptions): NomadSecretRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            backend: Optional[str] = None,
            global_: Optional[bool] = None,
            namespace: Optional[str] = None,
            policies: Optional[Sequence[str]] = None,
            role: Optional[str] = None,
            type: Optional[str] = None) -> NomadSecretRole
    func GetNomadSecretRole(ctx *Context, name string, id IDInput, state *NomadSecretRoleState, opts ...ResourceOption) (*NomadSecretRole, error)
    public static NomadSecretRole Get(string name, Input<string> id, NomadSecretRoleState? state, CustomResourceOptions? opts = null)
    public static NomadSecretRole get(String name, Output<String> id, NomadSecretRoleState 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:
    Backend string

    The unique path this backend should be mounted at.

    Global bool

    Specifies if the generated token should be global. Defaults to false.

    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.

    Policies List<string>

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    Role string

    The name to identify this role within the backend. Must be unique within the backend.

    Type string

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    Backend string

    The unique path this backend should be mounted at.

    Global bool

    Specifies if the generated token should be global. Defaults to false.

    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.

    Policies []string

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    Role string

    The name to identify this role within the backend. Must be unique within the backend.

    Type string

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend String

    The unique path this backend should be mounted at.

    global Boolean

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies List<String>

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    role String

    The name to identify this role within the backend. Must be unique within the backend.

    type String

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend string

    The unique path this backend should be mounted at.

    global boolean

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies string[]

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    role string

    The name to identify this role within the backend. Must be unique within the backend.

    type string

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend str

    The unique path this backend should be mounted at.

    global_ bool

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies Sequence[str]

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    role str

    The name to identify this role within the backend. Must be unique within the backend.

    type str

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    backend String

    The unique path this backend should be mounted at.

    global Boolean

    Specifies if the generated token should be global. Defaults to false.

    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.

    policies List<String>

    List of policies attached to the generated token. This setting is only used when type is 'client'.

    role String

    The name to identify this role within the backend. Must be unique within the backend.

    type String

    Specifies the type of token to create when using this role. Valid settings are 'client' and 'management'. Defaults to 'client'.

    Package Details

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

    This Pulumi package is based on the vault Terraform Provider.

    vault logo
    HashiCorp Vault v5.17.0 published on Thursday, Nov 9, 2023 by Pulumi