1. Packages
  2. AWS
  3. API Docs
  4. appsync
  5. Type
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.appsync.Type

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    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
    
    }
    """)
    
    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
    	})
    }
    
    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 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
    
            }        
    

    Create Type Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Type(name: string, args: TypeArgs, opts?: CustomResourceOptions);
    @overload
    def Type(resource_name: str,
             args: TypeArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Type(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             api_id: Optional[str] = None,
             definition: Optional[str] = None,
             format: Optional[str] = None)
    func NewType(ctx *Context, name string, args TypeArgs, opts ...ResourceOption) (*Type, error)
    public Type(string name, TypeArgs args, CustomResourceOptions? opts = null)
    public Type(String name, TypeArgs args)
    public Type(String name, TypeArgs args, CustomResourceOptions options)
    
    type: aws:appsync:Type
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TypeArgs
    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 TypeArgs
    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 TypeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var typeResource = new Aws.AppSync.Type("typeResource", new()
    {
        ApiId = "string",
        Definition = "string",
        Format = "string",
    });
    
    example, err := appsync.NewType(ctx, "typeResource", &appsync.TypeArgs{
    	ApiId:      pulumi.String("string"),
    	Definition: pulumi.String("string"),
    	Format:     pulumi.String("string"),
    })
    
    var typeResource = new Type("typeResource", TypeArgs.builder()
        .apiId("string")
        .definition("string")
        .format("string")
        .build());
    
    type_resource = aws.appsync.Type("typeResource",
        api_id="string",
        definition="string",
        format="string")
    
    const typeResource = new aws.appsync.Type("typeResource", {
        apiId: "string",
        definition: "string",
        format: "string",
    });
    
    type: aws:appsync:Type
    properties:
        apiId: string
        definition: string
        format: string
    

    Type 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 Type resource accepts the following input properties:

    ApiId string
    GraphQL API ID.
    Definition string
    The type definition.
    Format string
    The type format: SDL or JSON.
    ApiId string
    GraphQL API ID.
    Definition string
    The type definition.
    Format string
    The type format: SDL or JSON.
    apiId String
    GraphQL API ID.
    definition String
    The type definition.
    format String
    The type format: SDL or JSON.
    apiId string
    GraphQL API ID.
    definition string
    The type definition.
    format string
    The type format: SDL or JSON.
    api_id str
    GraphQL API ID.
    definition str
    The type definition.
    format str
    The type format: SDL or JSON.
    apiId String
    GraphQL API ID.
    definition String
    The type definition.
    format String
    The type format: SDL or JSON.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Type resource produces the following output properties:

    Arn string
    The ARN of the type.
    Description string
    The type description.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The type name.
    Arn string
    The ARN of the type.
    Description string
    The type description.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The type name.
    arn String
    The ARN of the type.
    description String
    The type description.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The type name.
    arn string
    The ARN of the type.
    description string
    The type description.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The type name.
    arn str
    The ARN of the type.
    description str
    The type description.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The type name.
    arn String
    The ARN of the type.
    description String
    The type description.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The type name.

    Look up Existing Type Resource

    Get an existing Type 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?: TypeState, opts?: CustomResourceOptions): Type
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_id: Optional[str] = None,
            arn: Optional[str] = None,
            definition: Optional[str] = None,
            description: Optional[str] = None,
            format: Optional[str] = None,
            name: Optional[str] = None) -> Type
    func GetType(ctx *Context, name string, id IDInput, state *TypeState, opts ...ResourceOption) (*Type, error)
    public static Type Get(string name, Input<string> id, TypeState? state, CustomResourceOptions? opts = null)
    public static Type get(String name, Output<String> id, TypeState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    ApiId string
    GraphQL API ID.
    Arn string
    The ARN of the type.
    Definition string
    The type definition.
    Description string
    The type description.
    Format string
    The type format: SDL or JSON.
    Name string
    The type name.
    ApiId string
    GraphQL API ID.
    Arn string
    The ARN of the type.
    Definition string
    The type definition.
    Description string
    The type description.
    Format string
    The type format: SDL or JSON.
    Name string
    The type name.
    apiId String
    GraphQL API ID.
    arn String
    The ARN of the type.
    definition String
    The type definition.
    description String
    The type description.
    format String
    The type format: SDL or JSON.
    name String
    The type name.
    apiId string
    GraphQL API ID.
    arn string
    The ARN of the type.
    definition string
    The type definition.
    description string
    The type description.
    format string
    The type format: SDL or JSON.
    name string
    The type name.
    api_id str
    GraphQL API ID.
    arn str
    The ARN of the type.
    definition str
    The type definition.
    description str
    The type description.
    format str
    The type format: SDL or JSON.
    name str
    The type name.
    apiId String
    GraphQL API ID.
    arn String
    The ARN of the type.
    definition String
    The type definition.
    description String
    The type description.
    format String
    The type format: SDL or JSON.
    name String
    The type name.

    Import

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

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi