ApiKeyArgs

data class ApiKeyArgs(val scope: Output<String>? = null, val tokenDomains: Output<List<String>>? = null) : ConvertibleToJava<ApiKeyArgs>

Provides an AWS WAFv2 API Key resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.wafv2.ApiKey("example", {
scope: "REGIONAL",
tokenDomains: ["example&#46;com"],
});
import pulumi
import pulumi_aws as aws
example = aws.wafv2.ApiKey("example",
scope="REGIONAL",
token_domains=["example&#46;com"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.WafV2.ApiKey("example", new()
{
Scope = "REGIONAL",
TokenDomains = new[]
{
"example.com",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/wafv2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := wafv2.NewApiKey(ctx, "example", &wafv2.ApiKeyArgs{
Scope: pulumi.String("REGIONAL"),
TokenDomains: pulumi.StringArray{
pulumi.String("example.com"),
},
})
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.aws.wafv2.ApiKey;
import com.pulumi.aws.wafv2.ApiKeyArgs;
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 example = new ApiKey("example", ApiKeyArgs.builder()
.scope("REGIONAL")
.tokenDomains("example.com")
.build());
}
}
resources:
example:
type: aws:wafv2:ApiKey
properties:
scope: REGIONAL
tokenDomains:
- example.com

Import

Using pulumi import, import WAFv2 API Key using api_key,scope. For example:

$ pulumi import aws:wafv2/apiKey:ApiKey example a1b2c3d4-5678-90ab-cdef-EXAMPLE11111,REGIONAL

Constructors

Link copied to clipboard
constructor(scope: Output<String>? = null, tokenDomains: Output<List<String>>? = null)

Properties

Link copied to clipboard
val scope: Output<String>? = null

Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are CLOUDFRONT or REGIONAL. Changing this forces a new resource to be created. NOTE: WAFv2 API Keys deployed for CLOUDFRONT must be created within the us-east-1 region.

Link copied to clipboard
val tokenDomains: Output<List<String>>? = null

The domains that you want to be able to use the API key with, for example example.com. You can specify up to 5 domains. Changing this forces a new resource to be created.

Functions

Link copied to clipboard
open override fun toJava(): ApiKeyArgs