TypeArgs

data class TypeArgs(val apiId: Output<String>? = null, val definition: Output<String>? = null, val format: Output<String>? = null) : ConvertibleToJava<TypeArgs>

Provides an AppSync Type.

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 exampleType = new aws.appsync.Type("example", {
apiId: example.id,
format: "SDL",
definition: `type Mutation
{
putPost(id: ID!,title: String! ): Post
}
`,
});
import pulumi
import pulumi_aws as aws
example = aws.appsync.GraphQLApi("example",
authentication_type="API_KEY",
name="example")
example_type = aws.appsync.Type("example",
api_id=example.id,
format="SDL",
definition="""type Mutation
{
putPost(id: ID!,title: String! ): Post
}
""")
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 exampleType = new Aws.AppSync.Type("example", new()
{
ApiId = example.Id,
Format = "SDL",
Definition = @"type Mutation
{
putPost(id: ID!,title: String! ): Post
}
",
});
});
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.NewType(ctx, "example", &appsync.TypeArgs{
ApiId: example.ID(),
Format: pulumi.String("SDL"),
Definition: pulumi.String(`type Mutation
{
putPost(id: ID!,title: String! ): Post
}
`),
})
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.Type;
import com.pulumi.aws.appsync.TypeArgs;
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 exampleType = new Type("exampleType", TypeArgs.builder()
.apiId(example.id())
.format("SDL")
.definition("""
type Mutation
{
putPost(id: ID!,title: String! ): Post
}
""")
.build());
}
}
resources:
example:
type: aws:appsync:GraphQLApi
properties:
authenticationType: API_KEY
name: example
exampleType:
type: aws:appsync:Type
name: example
properties:
apiId: ${example.id}
format: SDL
definition: |
type Mutation
{
putPost(id: ID!,title: String! ): Post
}

Import

Using pulumi import, import Appsync Types using the id. For example:

$ pulumi import aws:appsync/type:Type example api-id:format:name

Constructors

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

Properties

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

GraphQL API ID.

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

The type definition.

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

The type format: SDL or JSON.

Functions

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