ApiKeyArgs

data class ApiKeyArgs(val apiId: Output<String>? = null, val description: Output<String>? = null, val expires: Output<String>? = null) : ConvertibleToJava<ApiKeyArgs>

Provides an AppSync API Key.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.appsync.GraphQLApi("example", {
authenticationType: "API_KEY",
name: "example",
});
const exampleApiKey = new aws.appsync.ApiKey("example", {
apiId: example.id,
expires: "2018-05-03T04:00:00Z",
});
import pulumi
import pulumi_aws as aws
example = aws.appsync.GraphQLApi("example",
authentication_type="API_KEY",
name="example")
example_api_key = aws.appsync.ApiKey("example",
api_id=example.id,
expires="2018-05-03T04:00:00Z")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.AppSync.GraphQLApi("example", new()
{
AuthenticationType = "API_KEY",
Name = "example",
});
var exampleApiKey = new Aws.AppSync.ApiKey("example", new()
{
ApiId = example.Id,
Expires = "2018-05-03T04:00:00Z",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appsync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := appsync.NewGraphQLApi(ctx, "example", &appsync.GraphQLApiArgs{
AuthenticationType: pulumi.String("API_KEY"),
Name: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = appsync.NewApiKey(ctx, "example", &appsync.ApiKeyArgs{
ApiId: example.ID(),
Expires: pulumi.String("2018-05-03T04:00:00Z"),
})
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.appsync.GraphQLApi;
import com.pulumi.aws.appsync.GraphQLApiArgs;
import com.pulumi.aws.appsync.ApiKey;
import com.pulumi.aws.appsync.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 GraphQLApi("example", GraphQLApiArgs.builder()
.authenticationType("API_KEY")
.name("example")
.build());
var exampleApiKey = new ApiKey("exampleApiKey", ApiKeyArgs.builder()
.apiId(example.id())
.expires("2018-05-03T04:00:00Z")
.build());
}
}
resources:
example:
type: aws:appsync:GraphQLApi
properties:
authenticationType: API_KEY
name: example
exampleApiKey:
type: aws:appsync:ApiKey
name: example
properties:
apiId: ${example.id}
expires: 2018-05-03T04:00:00Z

Import

Using pulumi import, import aws_appsync_api_key using the AppSync API ID and key separated by :. For example:

$ pulumi import aws:appsync/apiKey:ApiKey example xxxxx:yyyyy

Constructors

Link copied to clipboard
constructor(apiId: Output<String>? = null, description: Output<String>? = null, expires: Output<String>? = null)

Properties

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

ID of the associated AppSync API

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

API key description. Defaults to "Managed by Pulumi".

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

RFC3339 string representation of the expiry date. Rounded down to nearest hour. By default, it is 7 days from the date of creation.

Functions

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