amplify-backend
amplify-backend copied to clipboard
Question about availability of Amplify Gen2 for gen1 user and comparison to AWS CDK
Environment information
Hello,
I am currently using Amplify Gen1 and eagerly awaiting the Gen2 option for Gen1 users. Is there a date or any details available?
What are the advantages of Amplify gen2 compared to AWS CDK? I could also directly learn CDK and thus move away from the CLI. Why was an extra framework necessary? What makes Amplify better for me in the future?
Thanks in advance for the information!
### Description
Update sheet / comparison with cdk in the docs
a short answer would be helpful here. Thanks :)
So i guess there is no Timeline dir the rls? And its Not possible to simple answer the question?
Hey @biller-aivy :wave: apologies for the delay here! We are actively investigating a migration path for Gen 1 customers 🙂 Gen 2 provides similar abstractions as Gen 1, however is closer to CDK and focused on code first. Gen 2 is built atop CDK and creates resources using underlying L3 constructs, which are instantiated in amplify/backend.ts when you set those to defineBackend()
Given its been almost 4 months since the last comment, a fresh update would be helpful here. I was in no rush to migrate but am now hitting limitations of gen1 and find myself with the need for gen2's async function handlers.
Hey @charlieforward9 we are actively working towards a smooth migration path, however in the meantime to adopt async invocation types in Gen 1 you can specify an invocationType on the @function directive in your schema https://github.com/aws-amplify/amplify-category-api/blob/main/packages/amplify-graphql-function-transformer/src/graphql-function-transformer.ts#L33C3-L33C26
@josefaidt could you please be more specific here? I see that invocationType can be a string, but I'm not clear on what the string should be.
Is it EventInvocationResponse? What are the other options?
Hey @charlieforward9 apologies, the string would be "Event" https://github.com/aws-amplify/amplify-category-api/blob/b8771c1f782b19f653f310f0a29528dae08035dc/packages/amplify-graphql-function-transformer/src/graphql-function-transformer.ts#L272-L288
# Valid
type Mutation {
doStuff(msg: String): String
@function(name: "foo", invocationType: Event)
@function(name: "bar") # defaults to RequestResponse
}
# Valid
type Mutation {
doStuff(msg: String): EventInvocationResponse
@function(name: "bar")
@function(name: "foo", invocationType: Event)
}
@josefaidt any updates on when the migration tool will be ready for gen 1 customers?