Class AppsyncFunction

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.appsync.AppsyncFunction
All Implemented Interfaces:
IResource, IAppsyncFunction, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.99.0 (build 8f757e4)", date="2024-06-13T18:49:14.583Z") @Stability(Stable) public class AppsyncFunction extends Resource implements IAppsyncFunction
AppSync Functions are local functions that perform certain operations onto a backend data source.

Developers can compose operations (Functions) and execute them in sequence with Pipeline Resolvers.

Example:

 GraphqlApi api;
 AppsyncFunction appsyncFunction = AppsyncFunction.Builder.create(this, "function")
         .name("appsync_function")
         .api(api)
         .dataSource(api.addNoneDataSource("none"))
         .requestMappingTemplate(MappingTemplate.fromFile("request.vtl"))
         .responseMappingTemplate(MappingTemplate.fromFile("response.vtl"))
         .build();
 
  • Constructor Details

    • AppsyncFunction

      protected AppsyncFunction(software.amazon.jsii.JsiiObjectRef objRef)
    • AppsyncFunction

      protected AppsyncFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • AppsyncFunction

      @Stability(Stable) public AppsyncFunction(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AppsyncFunctionProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromAppsyncFunctionAttributes

      @Stability(Stable) @NotNull public static IAppsyncFunction fromAppsyncFunctionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull AppsyncFunctionAttributes attrs)
      Import Appsync Function from arn.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • getDataSource

      @Stability(Stable) @NotNull public BaseDataSource getDataSource()
      the data source of this AppSync Function.
    • getFunctionArn

      @Stability(Stable) @NotNull public String getFunctionArn()
      the ARN of the AppSync function.
      Specified by:
      getFunctionArn in interface IAppsyncFunction
    • getFunctionId

      @Stability(Stable) @NotNull public String getFunctionId()
      the ID of the AppSync function.
      Specified by:
      getFunctionId in interface IAppsyncFunction
    • getFunctionName

      @Stability(Stable) @NotNull public String getFunctionName()
      the name of this AppSync Function.