1. Packages
  2. Propelauth Provider
  3. API Docs
  4. ApiKeyAlert
propelauth 0.4.1 published on Friday, Mar 7, 2025 by propelauth

propelauth.ApiKeyAlert

Explore with Pulumi AI

API Key Alerting. This sets up alerting for end users emailing them when their API key is about to expire. Note: API key alerts are only available on some pricing plans. These alerts are only sent for users in production environments and can only be set up if you have a production environment.

Example Usage

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

// Create a PropelAuth API key alert.
const example = new propelauth.ApiKeyAlert("example", {advanceNoticeDays: 30}, {
    dependsOn: [propelauth_custom_domain_verification.my_prod_domain_verification],
});
Copy
import pulumi
import pulumi_propelauth as propelauth

# Create a PropelAuth API key alert.
example = propelauth.ApiKeyAlert("example", advance_notice_days=30,
opts = pulumi.ResourceOptions(depends_on=[propelauth_custom_domain_verification["my_prod_domain_verification"]]))
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/propelauth/propelauth"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a PropelAuth API key alert.
		_, err := propelauth.NewApiKeyAlert(ctx, "example", &propelauth.ApiKeyAlertArgs{
			AdvanceNoticeDays: pulumi.Float64(30),
		}, pulumi.DependsOn([]pulumi.Resource{
			propelauth_custom_domain_verification.My_prod_domain_verification,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Propelauth = Pulumi.Propelauth;

return await Deployment.RunAsync(() => 
{
    // Create a PropelAuth API key alert.
    var example = new Propelauth.ApiKeyAlert("example", new()
    {
        AdvanceNoticeDays = 30,
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            propelauth_custom_domain_verification.My_prod_domain_verification,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.propelauth.ApiKeyAlert;
import com.pulumi.propelauth.ApiKeyAlertArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
        // Create a PropelAuth API key alert.
        var example = new ApiKeyAlert("example", ApiKeyAlertArgs.builder()
            .advanceNoticeDays(30)
            .build(), CustomResourceOptions.builder()
                .dependsOn(propelauth_custom_domain_verification.my_prod_domain_verification())
                .build());

    }
}
Copy
resources:
  # Create a PropelAuth API key alert.
  example:
    type: propelauth:ApiKeyAlert
    properties:
      advanceNoticeDays: 30
    options:
      dependsOn:
        - ${propelauth_custom_domain_verification.my_prod_domain_verification}
Copy

Create ApiKeyAlert Resource

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

Constructor syntax

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

@overload
def ApiKeyAlert(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                advance_notice_days: Optional[float] = None)
func NewApiKeyAlert(ctx *Context, name string, args ApiKeyAlertArgs, opts ...ResourceOption) (*ApiKeyAlert, error)
public ApiKeyAlert(string name, ApiKeyAlertArgs args, CustomResourceOptions? opts = null)
public ApiKeyAlert(String name, ApiKeyAlertArgs args)
public ApiKeyAlert(String name, ApiKeyAlertArgs args, CustomResourceOptions options)
type: propelauth:ApiKeyAlert
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. ApiKeyAlertArgs
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. ApiKeyAlertArgs
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. ApiKeyAlertArgs
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. ApiKeyAlertArgs
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. ApiKeyAlertArgs
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 apiKeyAlertResource = new Propelauth.ApiKeyAlert("apiKeyAlertResource", new()
{
    AdvanceNoticeDays = 0,
});
Copy
example, err := propelauth.NewApiKeyAlert(ctx, "apiKeyAlertResource", &propelauth.ApiKeyAlertArgs{
	AdvanceNoticeDays: pulumi.Float64(0),
})
Copy
var apiKeyAlertResource = new ApiKeyAlert("apiKeyAlertResource", ApiKeyAlertArgs.builder()
    .advanceNoticeDays(0)
    .build());
Copy
api_key_alert_resource = propelauth.ApiKeyAlert("apiKeyAlertResource", advance_notice_days=0)
Copy
const apiKeyAlertResource = new propelauth.ApiKeyAlert("apiKeyAlertResource", {advanceNoticeDays: 0});
Copy
type: propelauth:ApiKeyAlert
properties:
    advanceNoticeDays: 0
Copy

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

AdvanceNoticeDays This property is required. double
The number of days before an API key expires by which time end users will receive an email alert.
AdvanceNoticeDays This property is required. float64
The number of days before an API key expires by which time end users will receive an email alert.
advanceNoticeDays This property is required. Double
The number of days before an API key expires by which time end users will receive an email alert.
advanceNoticeDays This property is required. number
The number of days before an API key expires by which time end users will receive an email alert.
advance_notice_days This property is required. float
The number of days before an API key expires by which time end users will receive an email alert.
advanceNoticeDays This property is required. Number
The number of days before an API key expires by which time end users will receive an email alert.

Outputs

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

Get an existing ApiKeyAlert 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?: ApiKeyAlertState, opts?: CustomResourceOptions): ApiKeyAlert
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        advance_notice_days: Optional[float] = None) -> ApiKeyAlert
func GetApiKeyAlert(ctx *Context, name string, id IDInput, state *ApiKeyAlertState, opts ...ResourceOption) (*ApiKeyAlert, error)
public static ApiKeyAlert Get(string name, Input<string> id, ApiKeyAlertState? state, CustomResourceOptions? opts = null)
public static ApiKeyAlert get(String name, Output<String> id, ApiKeyAlertState state, CustomResourceOptions options)
resources:  _:    type: propelauth:ApiKeyAlert    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:
AdvanceNoticeDays double
The number of days before an API key expires by which time end users will receive an email alert.
AdvanceNoticeDays float64
The number of days before an API key expires by which time end users will receive an email alert.
advanceNoticeDays Double
The number of days before an API key expires by which time end users will receive an email alert.
advanceNoticeDays number
The number of days before an API key expires by which time end users will receive an email alert.
advance_notice_days float
The number of days before an API key expires by which time end users will receive an email alert.
advanceNoticeDays Number
The number of days before an API key expires by which time end users will receive an email alert.

Import

As there is only one api_key_alert per project there’s no need to specify the id,

$ pulumi import propelauth:index/apiKeyAlert:ApiKeyAlert but requires an id to be specified, so we can use an arbitrary string here.
Copy
$ pulumi import propelauth:index/apiKeyAlert:ApiKeyAlert example arbitrary_string_here
Copy

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

Package Details

Repository
propelauth propelauth/terraform-provider-propelauth
License
Notes
This Pulumi package is based on the propelauth Terraform Provider.