aws.appsync.Function
Explore with Pulumi AI
Provides an AppSync Function.
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",
schema: `type Mutation {
putPost(id: ID!, title: String!): Post
}
type Post {
id: ID!
title: String!
}
type Query {
singlePost(id: ID!): Post
}
schema {
query: Query
mutation: Mutation
}
`,
});
const exampleDataSource = new aws.appsync.DataSource("example", {
apiId: example.id,
name: "example",
type: "HTTP",
httpConfig: {
endpoint: "http://example.com",
},
});
const exampleFunction = new aws.appsync.Function("example", {
apiId: example.id,
dataSource: exampleDataSource.name,
name: "example",
requestMappingTemplate: `{
"version": "2018-05-29",
"method": "GET",
"resourcePath": "/",
"params":{
"headers": utils.http.copyheaders(ctx.request.headers)
}
}
`,
responseMappingTemplate: `#if(ctx.result.statusCode == 200)
ctx.result.body
#else
utils.appendError(ctx.result.body, ctx.result.statusCode)
#end
`,
});
import pulumi
import pulumi_aws as aws
example = aws.appsync.GraphQLApi("example",
authentication_type="API_KEY",
name="example",
schema="""type Mutation {
putPost(id: ID!, title: String!): Post
}
type Post {
id: ID!
title: String!
}
type Query {
singlePost(id: ID!): Post
}
schema {
query: Query
mutation: Mutation
}
""")
example_data_source = aws.appsync.DataSource("example",
api_id=example.id,
name="example",
type="HTTP",
http_config={
"endpoint": "http://example.com",
})
example_function = aws.appsync.Function("example",
api_id=example.id,
data_source=example_data_source.name,
name="example",
request_mapping_template="""{
"version": "2018-05-29",
"method": "GET",
"resourcePath": "/",
"params":{
"headers": $utils.http.copyheaders($ctx.request.headers)
}
}
""",
response_mapping_template="""#if($ctx.result.statusCode == 200)
$ctx.result.body
#else
$utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
""")
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"),
Schema: pulumi.String(`type Mutation {
putPost(id: ID!, title: String!): Post
}
type Post {
id: ID!
title: String!
}
type Query {
singlePost(id: ID!): Post
}
schema {
query: Query
mutation: Mutation
}
`),
})
if err != nil {
return err
}
exampleDataSource, err := appsync.NewDataSource(ctx, "example", &appsync.DataSourceArgs{
ApiId: example.ID(),
Name: pulumi.String("example"),
Type: pulumi.String("HTTP"),
HttpConfig: &appsync.DataSourceHttpConfigArgs{
Endpoint: pulumi.String("http://example.com"),
},
})
if err != nil {
return err
}
_, err = appsync.NewFunction(ctx, "example", &appsync.FunctionArgs{
ApiId: example.ID(),
DataSource: exampleDataSource.Name,
Name: pulumi.String("example"),
RequestMappingTemplate: pulumi.String(`{
"version": "2018-05-29",
"method": "GET",
"resourcePath": "/",
"params":{
"headers": $utils.http.copyheaders($ctx.request.headers)
}
}
`),
ResponseMappingTemplate: pulumi.String(`#if($ctx.result.statusCode == 200)
$ctx.result.body
#else
$utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
`),
})
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",
Schema = @"type Mutation {
putPost(id: ID!, title: String!): Post
}
type Post {
id: ID!
title: String!
}
type Query {
singlePost(id: ID!): Post
}
schema {
query: Query
mutation: Mutation
}
",
});
var exampleDataSource = new Aws.AppSync.DataSource("example", new()
{
ApiId = example.Id,
Name = "example",
Type = "HTTP",
HttpConfig = new Aws.AppSync.Inputs.DataSourceHttpConfigArgs
{
Endpoint = "http://example.com",
},
});
var exampleFunction = new Aws.AppSync.Function("example", new()
{
ApiId = example.Id,
DataSource = exampleDataSource.Name,
Name = "example",
RequestMappingTemplate = @"{
""version"": ""2018-05-29"",
""method"": ""GET"",
""resourcePath"": ""/"",
""params"":{
""headers"": $utils.http.copyheaders($ctx.request.headers)
}
}
",
ResponseMappingTemplate = @"#if($ctx.result.statusCode == 200)
$ctx.result.body
#else
$utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
",
});
});
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.DataSource;
import com.pulumi.aws.appsync.DataSourceArgs;
import com.pulumi.aws.appsync.inputs.DataSourceHttpConfigArgs;
import com.pulumi.aws.appsync.Function;
import com.pulumi.aws.appsync.FunctionArgs;
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")
.schema("""
type Mutation {
putPost(id: ID!, title: String!): Post
}
type Post {
id: ID!
title: String!
}
type Query {
singlePost(id: ID!): Post
}
schema {
query: Query
mutation: Mutation
}
""")
.build());
var exampleDataSource = new DataSource("exampleDataSource", DataSourceArgs.builder()
.apiId(example.id())
.name("example")
.type("HTTP")
.httpConfig(DataSourceHttpConfigArgs.builder()
.endpoint("http://example.com")
.build())
.build());
var exampleFunction = new Function("exampleFunction", FunctionArgs.builder()
.apiId(example.id())
.dataSource(exampleDataSource.name())
.name("example")
.requestMappingTemplate("""
{
"version": "2018-05-29",
"method": "GET",
"resourcePath": "/",
"params":{
"headers": $utils.http.copyheaders($ctx.request.headers)
}
}
""")
.responseMappingTemplate("""
#if($ctx.result.statusCode == 200)
$ctx.result.body
#else
$utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
""")
.build());
}
}
resources:
example:
type: aws:appsync:GraphQLApi
properties:
authenticationType: API_KEY
name: example
schema: |
type Mutation {
putPost(id: ID!, title: String!): Post
}
type Post {
id: ID!
title: String!
}
type Query {
singlePost(id: ID!): Post
}
schema {
query: Query
mutation: Mutation
}
exampleDataSource:
type: aws:appsync:DataSource
name: example
properties:
apiId: ${example.id}
name: example
type: HTTP
httpConfig:
endpoint: http://example.com
exampleFunction:
type: aws:appsync:Function
name: example
properties:
apiId: ${example.id}
dataSource: ${exampleDataSource.name}
name: example
requestMappingTemplate: |
{
"version": "2018-05-29",
"method": "GET",
"resourcePath": "/",
"params":{
"headers": $utils.http.copyheaders($ctx.request.headers)
}
}
responseMappingTemplate: |
#if($ctx.result.statusCode == 200)
$ctx.result.body
#else
$utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
With Code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";
const example = new aws.appsync.Function("example", {
apiId: exampleAwsAppsyncGraphqlApi.id,
dataSource: exampleAwsAppsyncDatasource.name,
name: "example",
code: std.file({
input: "some-code-dir",
}).then(invoke => invoke.result),
runtime: {
name: "APPSYNC_JS",
runtimeVersion: "1.0.0",
},
});
import pulumi
import pulumi_aws as aws
import pulumi_std as std
example = aws.appsync.Function("example",
api_id=example_aws_appsync_graphql_api["id"],
data_source=example_aws_appsync_datasource["name"],
name="example",
code=std.file(input="some-code-dir").result,
runtime={
"name": "APPSYNC_JS",
"runtime_version": "1.0.0",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appsync"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "some-code-dir",
}, nil)
if err != nil {
return err
}
_, err = appsync.NewFunction(ctx, "example", &appsync.FunctionArgs{
ApiId: pulumi.Any(exampleAwsAppsyncGraphqlApi.Id),
DataSource: pulumi.Any(exampleAwsAppsyncDatasource.Name),
Name: pulumi.String("example"),
Code: pulumi.String(invokeFile.Result),
Runtime: &appsync.FunctionRuntimeArgs{
Name: pulumi.String("APPSYNC_JS"),
RuntimeVersion: pulumi.String("1.0.0"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Aws.AppSync.Function("example", new()
{
ApiId = exampleAwsAppsyncGraphqlApi.Id,
DataSource = exampleAwsAppsyncDatasource.Name,
Name = "example",
Code = Std.File.Invoke(new()
{
Input = "some-code-dir",
}).Apply(invoke => invoke.Result),
Runtime = new Aws.AppSync.Inputs.FunctionRuntimeArgs
{
Name = "APPSYNC_JS",
RuntimeVersion = "1.0.0",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appsync.Function;
import com.pulumi.aws.appsync.FunctionArgs;
import com.pulumi.aws.appsync.inputs.FunctionRuntimeArgs;
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 Function("example", FunctionArgs.builder()
.apiId(exampleAwsAppsyncGraphqlApi.id())
.dataSource(exampleAwsAppsyncDatasource.name())
.name("example")
.code(StdFunctions.file(FileArgs.builder()
.input("some-code-dir")
.build()).result())
.runtime(FunctionRuntimeArgs.builder()
.name("APPSYNC_JS")
.runtimeVersion("1.0.0")
.build())
.build());
}
}
resources:
example:
type: aws:appsync:Function
properties:
apiId: ${exampleAwsAppsyncGraphqlApi.id}
dataSource: ${exampleAwsAppsyncDatasource.name}
name: example
code:
fn::invoke:
Function: std:file
Arguments:
input: some-code-dir
Return: result
runtime:
name: APPSYNC_JS
runtimeVersion: 1.0.0
Create Function Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Function(name: string, args: FunctionArgs, opts?: CustomResourceOptions);
@overload
def Function(resource_name: str,
args: FunctionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Function(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_id: Optional[str] = None,
data_source: Optional[str] = None,
code: Optional[str] = None,
description: Optional[str] = None,
function_version: Optional[str] = None,
max_batch_size: Optional[int] = None,
name: Optional[str] = None,
request_mapping_template: Optional[str] = None,
response_mapping_template: Optional[str] = None,
runtime: Optional[FunctionRuntimeArgs] = None,
sync_config: Optional[FunctionSyncConfigArgs] = None)
func NewFunction(ctx *Context, name string, args FunctionArgs, opts ...ResourceOption) (*Function, error)
public Function(string name, FunctionArgs args, CustomResourceOptions? opts = null)
public Function(String name, FunctionArgs args)
public Function(String name, FunctionArgs args, CustomResourceOptions options)
type: aws:appsync:Function
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 FunctionArgs
- 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 FunctionArgs
- 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 FunctionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FunctionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FunctionArgs
- 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 functionResource = new Aws.AppSync.Function("functionResource", new()
{
ApiId = "string",
DataSource = "string",
Code = "string",
Description = "string",
FunctionVersion = "string",
MaxBatchSize = 0,
Name = "string",
RequestMappingTemplate = "string",
ResponseMappingTemplate = "string",
Runtime = new Aws.AppSync.Inputs.FunctionRuntimeArgs
{
Name = "string",
RuntimeVersion = "string",
},
SyncConfig = new Aws.AppSync.Inputs.FunctionSyncConfigArgs
{
ConflictDetection = "string",
ConflictHandler = "string",
LambdaConflictHandlerConfig = new Aws.AppSync.Inputs.FunctionSyncConfigLambdaConflictHandlerConfigArgs
{
LambdaConflictHandlerArn = "string",
},
},
});
example, err := appsync.NewFunction(ctx, "functionResource", &appsync.FunctionArgs{
ApiId: pulumi.String("string"),
DataSource: pulumi.String("string"),
Code: pulumi.String("string"),
Description: pulumi.String("string"),
FunctionVersion: pulumi.String("string"),
MaxBatchSize: pulumi.Int(0),
Name: pulumi.String("string"),
RequestMappingTemplate: pulumi.String("string"),
ResponseMappingTemplate: pulumi.String("string"),
Runtime: &appsync.FunctionRuntimeArgs{
Name: pulumi.String("string"),
RuntimeVersion: pulumi.String("string"),
},
SyncConfig: &appsync.FunctionSyncConfigArgs{
ConflictDetection: pulumi.String("string"),
ConflictHandler: pulumi.String("string"),
LambdaConflictHandlerConfig: &appsync.FunctionSyncConfigLambdaConflictHandlerConfigArgs{
LambdaConflictHandlerArn: pulumi.String("string"),
},
},
})
var functionResource = new Function("functionResource", FunctionArgs.builder()
.apiId("string")
.dataSource("string")
.code("string")
.description("string")
.functionVersion("string")
.maxBatchSize(0)
.name("string")
.requestMappingTemplate("string")
.responseMappingTemplate("string")
.runtime(FunctionRuntimeArgs.builder()
.name("string")
.runtimeVersion("string")
.build())
.syncConfig(FunctionSyncConfigArgs.builder()
.conflictDetection("string")
.conflictHandler("string")
.lambdaConflictHandlerConfig(FunctionSyncConfigLambdaConflictHandlerConfigArgs.builder()
.lambdaConflictHandlerArn("string")
.build())
.build())
.build());
function_resource = aws.appsync.Function("functionResource",
api_id="string",
data_source="string",
code="string",
description="string",
function_version="string",
max_batch_size=0,
name="string",
request_mapping_template="string",
response_mapping_template="string",
runtime={
"name": "string",
"runtimeVersion": "string",
},
sync_config={
"conflictDetection": "string",
"conflictHandler": "string",
"lambdaConflictHandlerConfig": {
"lambdaConflictHandlerArn": "string",
},
})
const functionResource = new aws.appsync.Function("functionResource", {
apiId: "string",
dataSource: "string",
code: "string",
description: "string",
functionVersion: "string",
maxBatchSize: 0,
name: "string",
requestMappingTemplate: "string",
responseMappingTemplate: "string",
runtime: {
name: "string",
runtimeVersion: "string",
},
syncConfig: {
conflictDetection: "string",
conflictHandler: "string",
lambdaConflictHandlerConfig: {
lambdaConflictHandlerArn: "string",
},
},
});
type: aws:appsync:Function
properties:
apiId: string
code: string
dataSource: string
description: string
functionVersion: string
maxBatchSize: 0
name: string
requestMappingTemplate: string
responseMappingTemplate: string
runtime:
name: string
runtimeVersion: string
syncConfig:
conflictDetection: string
conflictHandler: string
lambdaConflictHandlerConfig:
lambdaConflictHandlerArn: string
Function Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Function resource accepts the following input properties:
- Api
Id string - ID of the associated AppSync API.
- Data
Source string - Function data source name.
- Code string
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- Description string
- Function description.
- Function
Version string - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - Max
Batch intSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - Name string
- Function name. The function name does not have to be unique.
- Request
Mapping stringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- Response
Mapping stringTemplate - Function response mapping template.
- Runtime
Function
Runtime - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - Sync
Config FunctionSync Config - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- Api
Id string - ID of the associated AppSync API.
- Data
Source string - Function data source name.
- Code string
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- Description string
- Function description.
- Function
Version string - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - Max
Batch intSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - Name string
- Function name. The function name does not have to be unique.
- Request
Mapping stringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- Response
Mapping stringTemplate - Function response mapping template.
- Runtime
Function
Runtime Args - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - Sync
Config FunctionSync Config Args - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api
Id String - ID of the associated AppSync API.
- data
Source String - Function data source name.
- code String
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- description String
- Function description.
- function
Version String - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max
Batch IntegerSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name String
- Function name. The function name does not have to be unique.
- request
Mapping StringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response
Mapping StringTemplate - Function response mapping template.
- runtime
Function
Runtime - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync
Config FunctionSync Config - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api
Id string - ID of the associated AppSync API.
- data
Source string - Function data source name.
- code string
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- description string
- Function description.
- function
Version string - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max
Batch numberSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name string
- Function name. The function name does not have to be unique.
- request
Mapping stringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response
Mapping stringTemplate - Function response mapping template.
- runtime
Function
Runtime - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync
Config FunctionSync Config - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api_
id str - ID of the associated AppSync API.
- data_
source str - Function data source name.
- code str
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- description str
- Function description.
- function_
version str - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max_
batch_ intsize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name str
- Function name. The function name does not have to be unique.
- request_
mapping_ strtemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response_
mapping_ strtemplate - Function response mapping template.
- runtime
Function
Runtime Args - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync_
config FunctionSync Config Args - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api
Id String - ID of the associated AppSync API.
- data
Source String - Function data source name.
- code String
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- description String
- Function description.
- function
Version String - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max
Batch NumberSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name String
- Function name. The function name does not have to be unique.
- request
Mapping StringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response
Mapping StringTemplate - Function response mapping template.
- runtime Property Map
- Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync
Config Property Map - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
Outputs
All input properties are implicitly available as output properties. Additionally, the Function resource produces the following output properties:
- Arn string
- ARN of the Function object.
- Function
Id string - Unique ID representing the Function object.
- Id string
- The provider-assigned unique ID for this managed resource.
- Arn string
- ARN of the Function object.
- Function
Id string - Unique ID representing the Function object.
- Id string
- The provider-assigned unique ID for this managed resource.
- arn String
- ARN of the Function object.
- function
Id String - Unique ID representing the Function object.
- id String
- The provider-assigned unique ID for this managed resource.
- arn string
- ARN of the Function object.
- function
Id string - Unique ID representing the Function object.
- id string
- The provider-assigned unique ID for this managed resource.
- arn str
- ARN of the Function object.
- function_
id str - Unique ID representing the Function object.
- id str
- The provider-assigned unique ID for this managed resource.
- arn String
- ARN of the Function object.
- function
Id String - Unique ID representing the Function object.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Function Resource
Get an existing Function 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?: FunctionState, opts?: CustomResourceOptions): Function
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_id: Optional[str] = None,
arn: Optional[str] = None,
code: Optional[str] = None,
data_source: Optional[str] = None,
description: Optional[str] = None,
function_id: Optional[str] = None,
function_version: Optional[str] = None,
max_batch_size: Optional[int] = None,
name: Optional[str] = None,
request_mapping_template: Optional[str] = None,
response_mapping_template: Optional[str] = None,
runtime: Optional[FunctionRuntimeArgs] = None,
sync_config: Optional[FunctionSyncConfigArgs] = None) -> Function
func GetFunction(ctx *Context, name string, id IDInput, state *FunctionState, opts ...ResourceOption) (*Function, error)
public static Function Get(string name, Input<string> id, FunctionState? state, CustomResourceOptions? opts = null)
public static Function get(String name, Output<String> id, FunctionState 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.
- Api
Id string - ID of the associated AppSync API.
- Arn string
- ARN of the Function object.
- Code string
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- Data
Source string - Function data source name.
- Description string
- Function description.
- Function
Id string - Unique ID representing the Function object.
- Function
Version string - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - Max
Batch intSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - Name string
- Function name. The function name does not have to be unique.
- Request
Mapping stringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- Response
Mapping stringTemplate - Function response mapping template.
- Runtime
Function
Runtime - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - Sync
Config FunctionSync Config - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- Api
Id string - ID of the associated AppSync API.
- Arn string
- ARN of the Function object.
- Code string
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- Data
Source string - Function data source name.
- Description string
- Function description.
- Function
Id string - Unique ID representing the Function object.
- Function
Version string - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - Max
Batch intSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - Name string
- Function name. The function name does not have to be unique.
- Request
Mapping stringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- Response
Mapping stringTemplate - Function response mapping template.
- Runtime
Function
Runtime Args - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - Sync
Config FunctionSync Config Args - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api
Id String - ID of the associated AppSync API.
- arn String
- ARN of the Function object.
- code String
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- data
Source String - Function data source name.
- description String
- Function description.
- function
Id String - Unique ID representing the Function object.
- function
Version String - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max
Batch IntegerSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name String
- Function name. The function name does not have to be unique.
- request
Mapping StringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response
Mapping StringTemplate - Function response mapping template.
- runtime
Function
Runtime - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync
Config FunctionSync Config - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api
Id string - ID of the associated AppSync API.
- arn string
- ARN of the Function object.
- code string
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- data
Source string - Function data source name.
- description string
- Function description.
- function
Id string - Unique ID representing the Function object.
- function
Version string - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max
Batch numberSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name string
- Function name. The function name does not have to be unique.
- request
Mapping stringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response
Mapping stringTemplate - Function response mapping template.
- runtime
Function
Runtime - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync
Config FunctionSync Config - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api_
id str - ID of the associated AppSync API.
- arn str
- ARN of the Function object.
- code str
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- data_
source str - Function data source name.
- description str
- Function description.
- function_
id str - Unique ID representing the Function object.
- function_
version str - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max_
batch_ intsize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name str
- Function name. The function name does not have to be unique.
- request_
mapping_ strtemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response_
mapping_ strtemplate - Function response mapping template.
- runtime
Function
Runtime Args - Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync_
config FunctionSync Config Args - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
- api
Id String - ID of the associated AppSync API.
- arn String
- ARN of the Function object.
- code String
- The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
- data
Source String - Function data source name.
- description String
- Function description.
- function
Id String - Unique ID representing the Function object.
- function
Version String - Version of the request mapping template. Currently the supported value is
2018-05-29
. Does not apply when specifyingcode
. - max
Batch NumberSize - Maximum batching size for a resolver. Valid values are between
0
and2000
. - name String
- Function name. The function name does not have to be unique.
- request
Mapping StringTemplate - Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
- response
Mapping StringTemplate - Function response mapping template.
- runtime Property Map
- Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See
runtime
Block for details. - sync
Config Property Map - Describes a Sync configuration for a resolver. See
sync_config
Block for details.
Supporting Types
FunctionRuntime, FunctionRuntimeArgs
- Name string
- The name of the runtime to use. Currently, the only allowed value is
APPSYNC_JS
. - Runtime
Version string - The version of the runtime to use. Currently, the only allowed version is
1.0.0
.
- Name string
- The name of the runtime to use. Currently, the only allowed value is
APPSYNC_JS
. - Runtime
Version string - The version of the runtime to use. Currently, the only allowed version is
1.0.0
.
- name String
- The name of the runtime to use. Currently, the only allowed value is
APPSYNC_JS
. - runtime
Version String - The version of the runtime to use. Currently, the only allowed version is
1.0.0
.
- name string
- The name of the runtime to use. Currently, the only allowed value is
APPSYNC_JS
. - runtime
Version string - The version of the runtime to use. Currently, the only allowed version is
1.0.0
.
- name str
- The name of the runtime to use. Currently, the only allowed value is
APPSYNC_JS
. - runtime_
version str - The version of the runtime to use. Currently, the only allowed version is
1.0.0
.
- name String
- The name of the runtime to use. Currently, the only allowed value is
APPSYNC_JS
. - runtime
Version String - The version of the runtime to use. Currently, the only allowed version is
1.0.0
.
FunctionSyncConfig, FunctionSyncConfigArgs
- Conflict
Detection string - Conflict Detection strategy to use. Valid values are
NONE
andVERSION
. - Conflict
Handler string - Conflict Resolution strategy to perform in the event of a conflict. Valid values are
NONE
,OPTIMISTIC_CONCURRENCY
,AUTOMERGE
, andLAMBDA
. - Lambda
Conflict FunctionHandler Config Sync Config Lambda Conflict Handler Config - Lambda Conflict Handler Config when configuring
LAMBDA
as the Conflict Handler. Seelambda_conflict_handler_config
Block for details.
- Conflict
Detection string - Conflict Detection strategy to use. Valid values are
NONE
andVERSION
. - Conflict
Handler string - Conflict Resolution strategy to perform in the event of a conflict. Valid values are
NONE
,OPTIMISTIC_CONCURRENCY
,AUTOMERGE
, andLAMBDA
. - Lambda
Conflict FunctionHandler Config Sync Config Lambda Conflict Handler Config - Lambda Conflict Handler Config when configuring
LAMBDA
as the Conflict Handler. Seelambda_conflict_handler_config
Block for details.
- conflict
Detection String - Conflict Detection strategy to use. Valid values are
NONE
andVERSION
. - conflict
Handler String - Conflict Resolution strategy to perform in the event of a conflict. Valid values are
NONE
,OPTIMISTIC_CONCURRENCY
,AUTOMERGE
, andLAMBDA
. - lambda
Conflict FunctionHandler Config Sync Config Lambda Conflict Handler Config - Lambda Conflict Handler Config when configuring
LAMBDA
as the Conflict Handler. Seelambda_conflict_handler_config
Block for details.
- conflict
Detection string - Conflict Detection strategy to use. Valid values are
NONE
andVERSION
. - conflict
Handler string - Conflict Resolution strategy to perform in the event of a conflict. Valid values are
NONE
,OPTIMISTIC_CONCURRENCY
,AUTOMERGE
, andLAMBDA
. - lambda
Conflict FunctionHandler Config Sync Config Lambda Conflict Handler Config - Lambda Conflict Handler Config when configuring
LAMBDA
as the Conflict Handler. Seelambda_conflict_handler_config
Block for details.
- conflict_
detection str - Conflict Detection strategy to use. Valid values are
NONE
andVERSION
. - conflict_
handler str - Conflict Resolution strategy to perform in the event of a conflict. Valid values are
NONE
,OPTIMISTIC_CONCURRENCY
,AUTOMERGE
, andLAMBDA
. - lambda_
conflict_ Functionhandler_ config Sync Config Lambda Conflict Handler Config - Lambda Conflict Handler Config when configuring
LAMBDA
as the Conflict Handler. Seelambda_conflict_handler_config
Block for details.
- conflict
Detection String - Conflict Detection strategy to use. Valid values are
NONE
andVERSION
. - conflict
Handler String - Conflict Resolution strategy to perform in the event of a conflict. Valid values are
NONE
,OPTIMISTIC_CONCURRENCY
,AUTOMERGE
, andLAMBDA
. - lambda
Conflict Property MapHandler Config - Lambda Conflict Handler Config when configuring
LAMBDA
as the Conflict Handler. Seelambda_conflict_handler_config
Block for details.
FunctionSyncConfigLambdaConflictHandlerConfig, FunctionSyncConfigLambdaConflictHandlerConfigArgs
- Lambda
Conflict stringHandler Arn - ARN for the Lambda function to use as the Conflict Handler.
- Lambda
Conflict stringHandler Arn - ARN for the Lambda function to use as the Conflict Handler.
- lambda
Conflict StringHandler Arn - ARN for the Lambda function to use as the Conflict Handler.
- lambda
Conflict stringHandler Arn - ARN for the Lambda function to use as the Conflict Handler.
- lambda_
conflict_ strhandler_ arn - ARN for the Lambda function to use as the Conflict Handler.
- lambda
Conflict StringHandler Arn - ARN for the Lambda function to use as the Conflict Handler.
Import
Using pulumi import
, import aws_appsync_function
using the AppSync API ID and Function ID separated by -
. For example:
$ pulumi import aws:appsync/function:Function example xxxxx-yyyyy
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.