1. Packages
  2. Pulumi Vault Provider
  3. API Docs
  4. identity
  5. OidcKey
HashiCorp Vault v6.4.0 published on Wednesday, Nov 20, 2024 by Pulumi

vault.identity.OidcKey

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.4.0 published on Wednesday, Nov 20, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const key = new vault.identity.OidcKey("key", {
        name: "key",
        algorithm: "RS256",
    });
    const role = new vault.identity.OidcRole("role", {
        name: "role",
        key: key.name,
    });
    const roleOidcKeyAllowedClientID = new vault.identity.OidcKeyAllowedClientID("role", {
        keyName: key.name,
        allowedClientId: role.clientId,
    });
    
    import pulumi
    import pulumi_vault as vault
    
    key = vault.identity.OidcKey("key",
        name="key",
        algorithm="RS256")
    role = vault.identity.OidcRole("role",
        name="role",
        key=key.name)
    role_oidc_key_allowed_client_id = vault.identity.OidcKeyAllowedClientID("role",
        key_name=key.name,
        allowed_client_id=role.client_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		key, err := identity.NewOidcKey(ctx, "key", &identity.OidcKeyArgs{
    			Name:      pulumi.String("key"),
    			Algorithm: pulumi.String("RS256"),
    		})
    		if err != nil {
    			return err
    		}
    		role, err := identity.NewOidcRole(ctx, "role", &identity.OidcRoleArgs{
    			Name: pulumi.String("role"),
    			Key:  key.Name,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = identity.NewOidcKeyAllowedClientID(ctx, "role", &identity.OidcKeyAllowedClientIDArgs{
    			KeyName:         key.Name,
    			AllowedClientId: role.ClientId,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var key = new Vault.Identity.OidcKey("key", new()
        {
            Name = "key",
            Algorithm = "RS256",
        });
    
        var role = new Vault.Identity.OidcRole("role", new()
        {
            Name = "role",
            Key = key.Name,
        });
    
        var roleOidcKeyAllowedClientID = new Vault.Identity.OidcKeyAllowedClientID("role", new()
        {
            KeyName = key.Name,
            AllowedClientId = role.ClientId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.identity.OidcKey;
    import com.pulumi.vault.identity.OidcKeyArgs;
    import com.pulumi.vault.identity.OidcRole;
    import com.pulumi.vault.identity.OidcRoleArgs;
    import com.pulumi.vault.identity.OidcKeyAllowedClientID;
    import com.pulumi.vault.identity.OidcKeyAllowedClientIDArgs;
    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 key = new OidcKey("key", OidcKeyArgs.builder()
                .name("key")
                .algorithm("RS256")
                .build());
    
            var role = new OidcRole("role", OidcRoleArgs.builder()
                .name("role")
                .key(key.name())
                .build());
    
            var roleOidcKeyAllowedClientID = new OidcKeyAllowedClientID("roleOidcKeyAllowedClientID", OidcKeyAllowedClientIDArgs.builder()
                .keyName(key.name())
                .allowedClientId(role.clientId())
                .build());
    
        }
    }
    
    resources:
      key:
        type: vault:identity:OidcKey
        properties:
          name: key
          algorithm: RS256
      role:
        type: vault:identity:OidcRole
        properties:
          name: role
          key: ${key.name}
      roleOidcKeyAllowedClientID:
        type: vault:identity:OidcKeyAllowedClientID
        name: role
        properties:
          keyName: ${key.name}
          allowedClientId: ${role.clientId}
    

    Create OidcKey Resource

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

    Constructor syntax

    new OidcKey(name: string, args?: OidcKeyArgs, opts?: CustomResourceOptions);
    @overload
    def OidcKey(resource_name: str,
                args: Optional[OidcKeyArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def OidcKey(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                algorithm: Optional[str] = None,
                allowed_client_ids: Optional[Sequence[str]] = None,
                name: Optional[str] = None,
                namespace: Optional[str] = None,
                rotation_period: Optional[int] = None,
                verification_ttl: Optional[int] = None)
    func NewOidcKey(ctx *Context, name string, args *OidcKeyArgs, opts ...ResourceOption) (*OidcKey, error)
    public OidcKey(string name, OidcKeyArgs? args = null, CustomResourceOptions? opts = null)
    public OidcKey(String name, OidcKeyArgs args)
    public OidcKey(String name, OidcKeyArgs args, CustomResourceOptions options)
    
    type: vault:identity:OidcKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args OidcKeyArgs
    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 OidcKeyArgs
    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 OidcKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OidcKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OidcKeyArgs
    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 oidcKeyResource = new Vault.Identity.OidcKey("oidcKeyResource", new()
    {
        Algorithm = "string",
        AllowedClientIds = new[]
        {
            "string",
        },
        Name = "string",
        Namespace = "string",
        RotationPeriod = 0,
        VerificationTtl = 0,
    });
    
    example, err := identity.NewOidcKey(ctx, "oidcKeyResource", &identity.OidcKeyArgs{
    	Algorithm: pulumi.String("string"),
    	AllowedClientIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:            pulumi.String("string"),
    	Namespace:       pulumi.String("string"),
    	RotationPeriod:  pulumi.Int(0),
    	VerificationTtl: pulumi.Int(0),
    })
    
    var oidcKeyResource = new OidcKey("oidcKeyResource", OidcKeyArgs.builder()
        .algorithm("string")
        .allowedClientIds("string")
        .name("string")
        .namespace("string")
        .rotationPeriod(0)
        .verificationTtl(0)
        .build());
    
    oidc_key_resource = vault.identity.OidcKey("oidcKeyResource",
        algorithm="string",
        allowed_client_ids=["string"],
        name="string",
        namespace="string",
        rotation_period=0,
        verification_ttl=0)
    
    const oidcKeyResource = new vault.identity.OidcKey("oidcKeyResource", {
        algorithm: "string",
        allowedClientIds: ["string"],
        name: "string",
        namespace: "string",
        rotationPeriod: 0,
        verificationTtl: 0,
    });
    
    type: vault:identity:OidcKey
    properties:
        algorithm: string
        allowedClientIds:
            - string
        name: string
        namespace: string
        rotationPeriod: 0
        verificationTtl: 0
    

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

    Algorithm string
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    AllowedClientIds List<string>
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    Name string
    Name of the OIDC Key to create.
    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.
    RotationPeriod int
    How often to generate a new signing key in number of seconds
    VerificationTtl int
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    Algorithm string
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    AllowedClientIds []string
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    Name string
    Name of the OIDC Key to create.
    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.
    RotationPeriod int
    How often to generate a new signing key in number of seconds
    VerificationTtl int
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm String
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowedClientIds List<String>
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name String
    Name of the OIDC Key to create.
    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.
    rotationPeriod Integer
    How often to generate a new signing key in number of seconds
    verificationTtl Integer
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm string
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowedClientIds string[]
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name string
    Name of the OIDC Key to create.
    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.
    rotationPeriod number
    How often to generate a new signing key in number of seconds
    verificationTtl number
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm str
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowed_client_ids Sequence[str]
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name str
    Name of the OIDC Key to create.
    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.
    rotation_period int
    How often to generate a new signing key in number of seconds
    verification_ttl int
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm String
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowedClientIds List<String>
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name String
    Name of the OIDC Key to create.
    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.
    rotationPeriod Number
    How often to generate a new signing key in number of seconds
    verificationTtl Number
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.

    Outputs

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

    Get an existing OidcKey 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?: OidcKeyState, opts?: CustomResourceOptions): OidcKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            algorithm: Optional[str] = None,
            allowed_client_ids: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            rotation_period: Optional[int] = None,
            verification_ttl: Optional[int] = None) -> OidcKey
    func GetOidcKey(ctx *Context, name string, id IDInput, state *OidcKeyState, opts ...ResourceOption) (*OidcKey, error)
    public static OidcKey Get(string name, Input<string> id, OidcKeyState? state, CustomResourceOptions? opts = null)
    public static OidcKey get(String name, Output<String> id, OidcKeyState 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:
    Algorithm string
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    AllowedClientIds List<string>
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    Name string
    Name of the OIDC Key to create.
    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.
    RotationPeriod int
    How often to generate a new signing key in number of seconds
    VerificationTtl int
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    Algorithm string
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    AllowedClientIds []string
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    Name string
    Name of the OIDC Key to create.
    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.
    RotationPeriod int
    How often to generate a new signing key in number of seconds
    VerificationTtl int
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm String
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowedClientIds List<String>
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name String
    Name of the OIDC Key to create.
    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.
    rotationPeriod Integer
    How often to generate a new signing key in number of seconds
    verificationTtl Integer
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm string
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowedClientIds string[]
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name string
    Name of the OIDC Key to create.
    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.
    rotationPeriod number
    How often to generate a new signing key in number of seconds
    verificationTtl number
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm str
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowed_client_ids Sequence[str]
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name str
    Name of the OIDC Key to create.
    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.
    rotation_period int
    How often to generate a new signing key in number of seconds
    verification_ttl int
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.
    algorithm String
    Signing algorithm to use. Signing algorithm to use. Allowed values are: RS256 (default), RS384, RS512, ES256, ES384, ES512, EdDSA.
    allowedClientIds List<String>
    Array of role client ID allowed to use this key for signing. If empty, no roles are allowed. If ["*"], all roles are allowed.
    name String
    Name of the OIDC Key to create.
    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.
    rotationPeriod Number
    How often to generate a new signing key in number of seconds
    verificationTtl Number
    "Controls how long the public portion of a signing key will be available for verification after being rotated in seconds.

    Import

    The key can be imported with the key name, for example:

    $ pulumi import vault:identity/oidcKey:OidcKey key key
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v6.4.0 published on Wednesday, Nov 20, 2024 by Pulumi