Can someone please point me in the direction of where the documentation is and examples are for creating an appsync backend in AWS with Lambda’s. This is something i can easily do using AWS CDK and their documentation is outstanding. But I am not finding the same for CDkTF. I am hoping someone can point me in the right direction ?
Also, I can create the basic appsync service, but am having difficulty in understanding how to use CDKTF to tie this to the resolver’s and corresponding lambda’s and set the schema:
const graphQL = new AppsyncGraphqlApi(this, “backEndAPI”, { schema: “./graphql/schema.graphql”, name: “TestAlanAppsync”, authenticationType: “API_KEY” });
In the above that I did, it creates the basic service, but cannot find the schema. I’d really love to see examples for good documentation. Thanks!
Ok, I was able to now pull in the schema by doing this:
const schemafile = readFileSync(‘./graphql/schema.graphql’, ‘utf-8’);
console.log(" File is: " + schemafile);
const graphQL = new AppsyncGraphqlApi(this, "backEndAPI", { schema: schemafile, name: "TestAlanAppsync", authenticationType: "API_KEY" });
So, I am reading the file and then inserting the entire contents in. I don’t prefer that as with AWS’s CDK, I could do this:
const api = new appsync.GraphqlApi(this, “Api”, {
name: env.env_builder.graph_ql_name,
schema: appsync.Schema.fromAsset(“graphql/schema.graphql”),
and have it read the file automatically. Much cleaner an approach. I am really looking to see if the same level of maturity is built into this CDKTF as already exists in AWS CDK but so far am not seeing it.