'AWS CloudFormation - How to upload some python/flask code
I have writen a python/flask code which I succesfully uploaded to an EBS (elastic beanstalk) enviroment and everything works fine. I have also written a yaml script creating a cloudformation (CF) stack which succesfully launches a custom VPC/subnets/security group/application load balancer with target group and autoscaling group with EC2 instances. Now, I would like to upload my Python/Flask code in the above CF stack so it works exactly like the EBS application.
Would you please point me in the right direction?
Thank you in advance.
PS. I have not included the CF template since it is over 300 lines long. I dont need anybody to actually solve the problem for me. Just a nudge it the correct direction.
Solution 1:[1]
See AWS::Lambda::Function.Code and Code Definitions
You can either point it @ a zip file in S3 or if not too long, embed it in the template (see ZipFile)
Solution 2:[2]
The proper way is to create a CI/CD pipeline using AWS CodePipeline. It integrates natively with ElasticBeanstalk and even with CloudFormation to allow for automated deployments of new EB application versions and/or CF stacks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tim Bassett |
| Solution 2 | Marcin |
