class FunctionRuntime
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppSync.FunctionRuntime |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#FunctionRuntime |
Java | software.amazon.awscdk.services.appsync.FunctionRuntime |
Python | aws_cdk.aws_appsync.FunctionRuntime |
TypeScript (source) | aws-cdk-lib » aws_appsync » FunctionRuntime |
Utility class for specifying specific appsync runtime versions.
Example
declare const api: appsync.GraphqlApi;
const myJsFunction = new appsync.AppsyncFunction(this, 'function', {
name: 'my_js_function',
api,
dataSource: api.addNoneDataSource('none'),
code: appsync.Code.fromAsset('directory/function_code.js'),
runtime: appsync.FunctionRuntime.JS_1_0_0,
});
new appsync.Resolver(this, 'PipelineResolver', {
api,
typeName: 'typeName',
fieldName: 'fieldName',
code: appsync.Code.fromInline(`
// The before step
export function request(...args) {
console.log(args);
return {}
}
// The after step
export function response(ctx) {
return ctx.prev.result
}
`),
runtime: appsync.FunctionRuntime.JS_1_0_0,
pipelineConfig: [myJsFunction],
});
Initializer
new FunctionRuntime(family: FunctionRuntimeFamily, version: string)
Parameters
- family
Function
Runtime Family - version
string
Properties
Name | Type | Description |
---|---|---|
name | string | The name of the runtime. |
version | string | The runtime version. |
static JS_1_0_0 | Function | APPSYNC_JS v1.0.0 runtime. |
name
Type:
string
The name of the runtime.
version
Type:
string
The runtime version.
static JS_1_0_0
Type:
Function
APPSYNC_JS v1.0.0 runtime.
Methods
Name | Description |
---|---|
to | Convert to Cfn runtime configuration property format. |
Properties()
topublic toProperties(): RuntimeConfig
Returns
Convert to Cfn runtime configuration property format.