1. Registry
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. appsync
  6. ApiKey

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.80.0
published on Monday, Sep 21, 2026 by Pulumi
aws-native logo aws-native logo

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.80.0
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:

    ApiId 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.
    ApiId 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.
    apiId 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.
    apiId 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.
    apiId 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:

    ApiKeyId string
    The API key ID.
    ApiKeyValue string
    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.
    ApiKey string
    The API key.
    ApiKeyId string
    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 string
    The API key.
    api_key_id string
    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.
    apiKey String
    The API key.
    apiKeyId String
    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.
    apiKey string
    The API key.
    apiKeyId string
    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_id str
    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.
    apiKey String
    The API key.
    apiKeyId String
    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.

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo aws-native logo

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.80.0
    published on Monday, Sep 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial