Amplify-cli: How to integrate a python lambda using aws-amplify

Created on 20 Mar 2019  路  9Comments  路  Source: aws-amplify/amplify-cli

Im currently using cra with amplify-cli for aws backend services like cognito, appsync, lambda and storage.
I have a requirement to integrate a flask app (maybe using lambda) to my existing application.

Can you guide me on how to process using already existing cloudformation script initialized by amplify, so that it could be used in CI/CD using amplify service also.

Thanks
Shubham Gupta

enhancement functions

Most helpful comment

No, we do not support. But I'll add this as a feature request.

All 9 comments

@artista7 You could use the Amplify Console for your CI/CD needs. Please take a look at https://aws.amazon.com/amplify/console/

cc @swaminator

I am using amplify console for CI/CD. My main issue is is it possible to configure lambda written in python using existing amplify project? As of now i am able write lambdas in js only

No, we do not support. But I'll add this as a feature request.

Hey @kaustavghosh06, that would be awesome if you do!

Hi @kaustavghosh06, how soon can we expect this functionality?

@kaustavghosh06, Any updates?

@artista7: what you can do now is the following.

Enable @http directive which is not yet available in release version of amplify-cli.
https://github.com/aws-amplify/amplify-cli/issues/84#issuecomment-483737268

Then if you have an available flask endpoint you can hit it via a following declaration in you graphql schema:

Type Query {
    myFlaskAPI(route: String!): [ExpectedResponse] @http(url:"https://yourflaskawesomeapp/:route")
}

My main issue is is it possible to configure lambda written in python using existing amplify project?

For flask app in lambda one reasonable option to go with https://github.com/Miserlou/Zappa for deployment, it can smoothly integrate with your CI as you can use a single command to update your deployment based on your configuration defined in zappa_settings.json. In you CI it can look just like:

zappa update prod 
./node_modules/.bin/amplify publish --yes

@ambientlight I will have a look at Zappa. Thanks

Closing, since this is a duplicate of #156

Was this page helpful?
0 / 5 - 0 ratings