We recommend new projects start with resources from the AWS provider.
published on Monday, Sep 21, 2026 by Pulumi
We recommend new projects start with resources from the AWS provider.
published on Monday, Sep 21, 2026 by Pulumi
Resource Type definition for AWS::AppSync::ApiKey
Example Usage
Example
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AwsNative = Pulumi.AwsNative;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var graphQlApiId = config.Require("graphQlApiId");
var apiKeyDescription = config.Require("apiKeyDescription");
var apiKeyExpires = config.RequireDouble("apiKeyExpires");
var apiKey = new AwsNative.AppSync.ApiKey("apiKey", new()
{
ApiId = graphQlApiId,
Description = apiKeyDescription,
Expires = apiKeyExpires,
});
});
package main
import (
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/appsync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
graphQlApiId := cfg.Require("graphQlApiId")
apiKeyDescription := cfg.Require("apiKeyDescription")
apiKeyExpires := cfg.RequireFloat64("apiKeyExpires")
_, err := appsync.NewApiKey(ctx, "apiKey", &appsync.ApiKeyArgs{
ApiId: pulumi.String(graphQlApiId),
Description: pulumi.String(apiKeyDescription),
Expires: pulumi.Float64(apiKeyExpires),
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";
const config = new pulumi.Config();
const graphQlApiId = config.require("graphQlApiId");
const apiKeyDescription = config.require("apiKeyDescription");
const apiKeyExpires = config.requireNumber("apiKeyExpires");
const apiKey = new aws_native.appsync.ApiKey("apiKey", {
apiId: graphQlApiId,
description: apiKeyDescription,
expires: apiKeyExpires,
});
import pulumi
import pulumi_aws_native as aws_native
config = pulumi.Config()
graph_ql_api_id = config.require("graphQlApiId")
api_key_description = config.require("apiKeyDescription")
api_key_expires = config.require_float("apiKeyExpires")
api_key = aws_native.appsync.ApiKey("apiKey",
api_id=graph_ql_api_id,
description=api_key_description,
expires=api_key_expires)
Example coming soon!
Create ApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);@overload
def ApiKey(resource_name: str,
args: ApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_id: Optional[str] = None,
description: Optional[str] = None,
expires: Optional[float] = None)func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: aws-native:appsync:ApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws-native_appsync_api_key" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ApiKeyArgs
- 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 ApiKeyArgs
- 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 ApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApiKey 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 ApiKey resource accepts the following input properties:
- Api
Id string - Unique AWS AppSync GraphQL API ID for this API key.
- Description string
- Unique description of your API key.
- Expires double
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- Api
Id string - Unique AWS AppSync GraphQL API ID for this API key.
- Description string
- Unique description of your API key.
- Expires float64
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- api_
id string - Unique AWS AppSync GraphQL API ID for this API key.
- description string
- Unique description of your API key.
- expires number
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- api
Id String - Unique AWS AppSync GraphQL API ID for this API key.
- description String
- Unique description of your API key.
- expires Double
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- api
Id string - Unique AWS AppSync GraphQL API ID for this API key.
- description string
- Unique description of your API key.
- expires number
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- api_
id str - Unique AWS AppSync GraphQL API ID for this API key.
- description str
- Unique description of your API key.
- expires float
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
- api
Id String - Unique AWS AppSync GraphQL API ID for this API key.
- description String
- Unique description of your API key.
- expires Number
- The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:
- Api
Key stringId - The API key ID.
- Api
Key stringValue - The API key.
- Arn string
- The Amazon Resource Name (ARN) of the API key.
- Id string
- The provider-assigned unique ID for this managed resource.
- api_
key string - The API key.
- api_
key_ stringid - The API key ID.
- arn string
- The Amazon Resource Name (ARN) of the API key.
- id string
- The provider-assigned unique ID for this managed resource.
- api_
key str - The API key.
- api_
key_ strid - The API key ID.
- arn str
- The Amazon Resource Name (ARN) of the API key.
- id str
- The provider-assigned unique ID for this managed resource.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.
published on Monday, Sep 21, 2026 by Pulumi