1. Packages
  2. FusionAuth
  3. API Docs
  4. FusionAuthKey
FusionAuth v6.0.2 published on Sunday, Feb 9, 2025 by Theo Gravity

fusionauth.FusionAuthKey

Explore with Pulumi AI

# Key Resource

Cryptographic keys are used in signing and verifying JWTs and verifying responses for third party identity providers. It is more likely you will interact with keys using the FusionAuth UI in the Key Master menu.

Keys API

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as fusionauth from "pulumi-fusionauth";

const adminId = new fusionauth.FusionAuthKey("adminId", {
    algorithm: "RS256",
    length: 2048,
});
Copy
import pulumi
import theogravity_pulumi_fusionauth as fusionauth

admin_id = fusionauth.FusionAuthKey("adminId",
    algorithm="RS256",
    length=2048)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/theogravity/pulumi-fusionauth/sdk/go/fusionauth"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := fusionauth.NewFusionAuthKey(ctx, "adminId", &fusionauth.FusionAuthKeyArgs{
			Algorithm: pulumi.String("RS256"),
			Length:    pulumi.Int(2048),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fusionauth = theogravity.Fusionauth;

return await Deployment.RunAsync(() => 
{
    var adminId = new Fusionauth.FusionAuthKey("adminId", new()
    {
        Algorithm = "RS256",
        Length = 2048,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fusionauth.FusionAuthKey;
import com.pulumi.fusionauth.FusionAuthKeyArgs;
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 adminId = new FusionAuthKey("adminId", FusionAuthKeyArgs.builder()
            .algorithm("RS256")
            .length(2048)
            .build());

    }
}
Copy
resources:
  adminId:
    type: fusionauth:FusionAuthKey
    properties:
      algorithm: RS256
      length: 2048
Copy

Create FusionAuthKey Resource

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

Constructor syntax

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

@overload
def FusionAuthKey(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  algorithm: Optional[str] = None,
                  issuer: Optional[str] = None,
                  key_id: Optional[str] = None,
                  length: Optional[int] = None,
                  name: Optional[str] = None)
func NewFusionAuthKey(ctx *Context, name string, args FusionAuthKeyArgs, opts ...ResourceOption) (*FusionAuthKey, error)
public FusionAuthKey(string name, FusionAuthKeyArgs args, CustomResourceOptions? opts = null)
public FusionAuthKey(String name, FusionAuthKeyArgs args)
public FusionAuthKey(String name, FusionAuthKeyArgs args, CustomResourceOptions options)
type: fusionauth:FusionAuthKey
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. FusionAuthKeyArgs
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. FusionAuthKeyArgs
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. FusionAuthKeyArgs
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. FusionAuthKeyArgs
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. FusionAuthKeyArgs
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 fusionAuthKeyResource = new Fusionauth.FusionAuthKey("fusionAuthKeyResource", new()
{
    Algorithm = "string",
    Issuer = "string",
    KeyId = "string",
    Length = 0,
    Name = "string",
});
Copy
example, err := fusionauth.NewFusionAuthKey(ctx, "fusionAuthKeyResource", &fusionauth.FusionAuthKeyArgs{
	Algorithm: pulumi.String("string"),
	Issuer:    pulumi.String("string"),
	KeyId:     pulumi.String("string"),
	Length:    pulumi.Int(0),
	Name:      pulumi.String("string"),
})
Copy
var fusionAuthKeyResource = new FusionAuthKey("fusionAuthKeyResource", FusionAuthKeyArgs.builder()
    .algorithm("string")
    .issuer("string")
    .keyId("string")
    .length(0)
    .name("string")
    .build());
Copy
fusion_auth_key_resource = fusionauth.FusionAuthKey("fusionAuthKeyResource",
    algorithm="string",
    issuer="string",
    key_id="string",
    length=0,
    name="string")
Copy
const fusionAuthKeyResource = new fusionauth.FusionAuthKey("fusionAuthKeyResource", {
    algorithm: "string",
    issuer: "string",
    keyId: "string",
    length: 0,
    name: "string",
});
Copy
type: fusionauth:FusionAuthKey
properties:
    algorithm: string
    issuer: string
    keyId: string
    length: 0
    name: string
Copy

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

Algorithm
This property is required.
Changes to this property will trigger replacement.
string
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
Issuer Changes to this property will trigger replacement. string
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
KeyId string
The Id to use for the new key. If not specified a secure random UUID will be generated.
Length Changes to this property will trigger replacement. int
The length of the RSA or EC certificate. This field is required when generating RSA key types.
Name string
The name of the Key.
Algorithm
This property is required.
Changes to this property will trigger replacement.
string
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
Issuer Changes to this property will trigger replacement. string
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
KeyId string
The Id to use for the new key. If not specified a secure random UUID will be generated.
Length Changes to this property will trigger replacement. int
The length of the RSA or EC certificate. This field is required when generating RSA key types.
Name string
The name of the Key.
algorithm
This property is required.
Changes to this property will trigger replacement.
String
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. String
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
keyId String
The Id to use for the new key. If not specified a secure random UUID will be generated.
length Changes to this property will trigger replacement. Integer
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name String
The name of the Key.
algorithm
This property is required.
Changes to this property will trigger replacement.
string
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. string
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
keyId string
The Id to use for the new key. If not specified a secure random UUID will be generated.
length Changes to this property will trigger replacement. number
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name string
The name of the Key.
algorithm
This property is required.
Changes to this property will trigger replacement.
str
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. str
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
key_id str
The Id to use for the new key. If not specified a secure random UUID will be generated.
length Changes to this property will trigger replacement. int
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name str
The name of the Key.
algorithm
This property is required.
Changes to this property will trigger replacement.
String
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. String
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
keyId String
The Id to use for the new key. If not specified a secure random UUID will be generated.
length Changes to this property will trigger replacement. Number
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name String
The name of the Key.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Kid string
The id used in the JWT header to identify the key used to generate the signature
Id string
The provider-assigned unique ID for this managed resource.
Kid string
The id used in the JWT header to identify the key used to generate the signature
id String
The provider-assigned unique ID for this managed resource.
kid String
The id used in the JWT header to identify the key used to generate the signature
id string
The provider-assigned unique ID for this managed resource.
kid string
The id used in the JWT header to identify the key used to generate the signature
id str
The provider-assigned unique ID for this managed resource.
kid str
The id used in the JWT header to identify the key used to generate the signature
id String
The provider-assigned unique ID for this managed resource.
kid String
The id used in the JWT header to identify the key used to generate the signature

Look up Existing FusionAuthKey Resource

Get an existing FusionAuthKey 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?: FusionAuthKeyState, opts?: CustomResourceOptions): FusionAuthKey
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        algorithm: Optional[str] = None,
        issuer: Optional[str] = None,
        key_id: Optional[str] = None,
        kid: Optional[str] = None,
        length: Optional[int] = None,
        name: Optional[str] = None) -> FusionAuthKey
func GetFusionAuthKey(ctx *Context, name string, id IDInput, state *FusionAuthKeyState, opts ...ResourceOption) (*FusionAuthKey, error)
public static FusionAuthKey Get(string name, Input<string> id, FusionAuthKeyState? state, CustomResourceOptions? opts = null)
public static FusionAuthKey get(String name, Output<String> id, FusionAuthKeyState state, CustomResourceOptions options)
resources:  _:    type: fusionauth:FusionAuthKey    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:
Algorithm Changes to this property will trigger replacement. string
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
Issuer Changes to this property will trigger replacement. string
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
KeyId string
The Id to use for the new key. If not specified a secure random UUID will be generated.
Kid string
The id used in the JWT header to identify the key used to generate the signature
Length Changes to this property will trigger replacement. int
The length of the RSA or EC certificate. This field is required when generating RSA key types.
Name string
The name of the Key.
Algorithm Changes to this property will trigger replacement. string
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
Issuer Changes to this property will trigger replacement. string
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
KeyId string
The Id to use for the new key. If not specified a secure random UUID will be generated.
Kid string
The id used in the JWT header to identify the key used to generate the signature
Length Changes to this property will trigger replacement. int
The length of the RSA or EC certificate. This field is required when generating RSA key types.
Name string
The name of the Key.
algorithm Changes to this property will trigger replacement. String
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. String
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
keyId String
The Id to use for the new key. If not specified a secure random UUID will be generated.
kid String
The id used in the JWT header to identify the key used to generate the signature
length Changes to this property will trigger replacement. Integer
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name String
The name of the Key.
algorithm Changes to this property will trigger replacement. string
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. string
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
keyId string
The Id to use for the new key. If not specified a secure random UUID will be generated.
kid string
The id used in the JWT header to identify the key used to generate the signature
length Changes to this property will trigger replacement. number
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name string
The name of the Key.
algorithm Changes to this property will trigger replacement. str
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. str
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
key_id str
The Id to use for the new key. If not specified a secure random UUID will be generated.
kid str
The id used in the JWT header to identify the key used to generate the signature
length Changes to this property will trigger replacement. int
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name str
The name of the Key.
algorithm Changes to this property will trigger replacement. String
The algorithm used to encrypt the Key. The following values represent algorithms supported by FusionAuth:

  • ES256 - ECDSA using P-256 curve and SHA-256 hash algorithm
  • ES384 - ECDSA using P-384 curve and SHA-384 hash algorithm
  • ES512 - ECDSA using P-521 curve and SHA-512 hash algorithm
  • RS256 - RSA using SHA-256 hash algorithm
  • RS384 - RSA using SHA-384 hash algorithm
  • RS512 - RSA using SHA-512 hash algorithm
  • HS256 - HMAC using SHA-256 hash algorithm
  • HS384 - HMAC using SHA-384 hash algorithm
  • HS512 - HMAC using SHA-512 hash algorithm
issuer Changes to this property will trigger replacement. String
The issuer of the RSA or EC certificate. If omitted, this value will default to the value of tenant issuer on the default tenant. For HMAC keys, this field does not apply and will be ignored if specified, and no default value will be set.
keyId String
The Id to use for the new key. If not specified a secure random UUID will be generated.
kid String
The id used in the JWT header to identify the key used to generate the signature
length Changes to this property will trigger replacement. Number
The length of the RSA or EC certificate. This field is required when generating RSA key types.
name String
The name of the Key.

Package Details

Repository
fusionauth theogravity/pulumi-fusionauth
License
MIT
Notes
This Pulumi package is based on the fusionauth Terraform Provider.