ApiKey
Provides an AppSync API Key.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleGraphQLApi = new Aws.AppSync.GraphQLApi("exampleGraphQLApi", new Aws.AppSync.GraphQLApiArgs
{
AuthenticationType = "API_KEY",
});
var exampleApiKey = new Aws.AppSync.ApiKey("exampleApiKey", new Aws.AppSync.ApiKeyArgs
{
ApiId = exampleGraphQLApi.Id,
Expires = "2018-05-03T04:00:00Z",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/appsync"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleGraphQLApi, err := appsync.NewGraphQLApi(ctx, "exampleGraphQLApi", &appsync.GraphQLApiArgs{
AuthenticationType: pulumi.String("API_KEY"),
})
if err != nil {
return err
}
_, err = appsync.NewApiKey(ctx, "exampleApiKey", &appsync.ApiKeyArgs{
ApiId: exampleGraphQLApi.ID(),
Expires: pulumi.String("2018-05-03T04:00:00Z"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example_graph_ql_api = aws.appsync.GraphQLApi("exampleGraphQLApi", authentication_type="API_KEY")
example_api_key = aws.appsync.ApiKey("exampleApiKey",
api_id=example_graph_ql_api.id,
expires="2018-05-03T04:00:00Z")import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleGraphQLApi = new aws.appsync.GraphQLApi("example", {
authenticationType: "API_KEY",
});
const exampleApiKey = new aws.appsync.ApiKey("example", {
apiId: exampleGraphQLApi.id,
expires: "2018-05-03T04:00:00Z",
});Create a ApiKey Resource
new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);def ApiKey(resource_name, opts=None, api_id=None, description=None, expires=None, __props__=None);func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
ApiKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ApiKey resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:
Look up an Existing ApiKey Resource
Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKeystatic get(resource_name, id, opts=None, api_id=None, description=None, expires=None, key=None, __props__=None);func GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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:
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.