简体   繁体   中英

Start a Kinesis data analytics application with cloudformation

Is there a way to start a kinesis data analytics application via cloudformation?

In these instructions , under the Start the Application section, there are instructions for how to start a Kinesis Data Analytics application through the console or through aws cli.

Is there any way to start the application using cloudformation, instead of the cli or console?

Thank you in advance.

There is a way, but unfortunately, its not that straightforward.

The first way would involve create a custom resource in CloudFormation. The resource would be a lambda, which you would write to start the Kinesis App from the CloudFormation.

The second would be through a non-elegant substitute for a custom resource, but much easier to setup. This is done by using smallest instance possible (eg t2.nano) with instance shutdown behaviour set to terminate. So your template creates that instances, in UserData you start the Kinesis app, and shutdown the instance ( shutdown -h now ). This will terminate the instance after the start of the Kinesis due to shutdown behavior.

Other ways would involve setting up notification when your cloudformation successfully deploys, and the notification would trigger a lambda which would start the Kinesis.

Hope this helps.

If Serverless framework is used to deploy the Kinesis Data Analytics CloudFormation resource, a custom plugin is another option. The advantage of going with a plugin is that there is no need for a custom resource, ec2s or lambdas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM