Home > Net >  AWS CloudFormation - How to upload some python/flask code
AWS CloudFormation - How to upload some python/flask code

Time:03-03

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.

CodePudding user response:

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)

CodePudding user response:

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.

  • Related