community-content icon indicating copy to clipboard operation
community-content copied to clipboard

[SUBMIT] Deploy starapi to AWS elastic beanstalk environment using pulumi(IaC)

Open omarkhairy21 opened this issue 3 years ago • 17 comments

My resource

Hello, There are not many tutorials or guides on how to deploy strapi in different cloud providers especially AWS, I have deployed strapi to Heroku, GCP, and AWS. I would say AWS deployment was the hardest because it requires a lot of setups especially if we follow up deployment guide in the documentation so I think I can create a complete tutorial on how can we deploy strapi on AWS using infrastructure as code(IaC) Pulumi.

Outline

  • Introduction
  • Goals
  • Prerequisites
    • AWS account basic knowledge of AWS resources (IAM, EC2 ..etc)
  • Infrastructure as code(IaC) with Pulumi
    • why Pulumi?
    • Setup Pulumi
    • Craete a new pulumi Stack
  • How can we deploy strapi to AWS using elastic beanstalk and docker?!
    • The Different Methods to deploy strapi to AWS
    • Why elastic beanstalk on AWS?
  • Setup Strapi using docker
    • create an app using strapi docker image
  • Provision infrastructure using Pulumi(TypeScript)
    • Create an S3 bucket for elastic beanstalk deployment
    • Setup VPC
    • Create PostgresSQL database instance using RDS
    • Setup IAM Roles
    • Create a new elastic beanstalk application
    • Create a new elastic beanstalk environment
    • Create or Update Infrastructure
    • Destroy the infrastructure
  • Conclusion

My content is

  • [x] A Strapi Tutorial / Guide / How to article
  • [ ] About Headless, CMS, javascript, open source, or jamstack
  • [ ] Other, specify

What do you all think? ❤️ I love it! 🚀 I can help you!

Thank you for submitting your article proposal.

omarkhairy21 avatar Feb 02 '22 05:02 omarkhairy21

@omarkhairy21 I love the outline however docket image is not currently working with strapi v4 therefore it won't be possible unfortunately right now to work on this article

ShadaW11 avatar Feb 08 '22 13:02 ShadaW11

To ensure that we can review and publish articles promptly, we will start closing inactive issues after two weeks of inactivity.

I know it has been a while @omarkhairy21, but I just wanted to follow up with everyone here to see if anyone is still interested in writing this article. If not, we will be closing this issue due to inactivity.

You can now deploy Strapi via Docker https://blog.dehlin.dev/docker-with-strapi-v4

PaulBratslavsky avatar Jul 21 '22 16:07 PaulBratslavsky

hey i am still interested in writing that one i just need the green light to go ahead

omarkhairy21 avatar Jul 21 '22 19:07 omarkhairy21

Hello @omarkhairy21 👋 Yes please go ahead. I am assigning this to you. Please share the draft when it is ready.

dessireugarte avatar Aug 05 '22 12:08 dessireugarte

hey @dessireugarte I just get starting in the draft i will share it whenever it is ready but i noticed you are asking for a similar tutorial in https://github.com/strapi/community-content/issues/918 are you sure there will not be redundant content? also, i can do the same tutorial (i.e this ticket #635) without using pulumi what is your opinion?

omarkhairy21 avatar Aug 06 '22 21:08 omarkhairy21

@omarkhairy21 I agree with you, since it will be very similar. I will make a note in that commit.

PaulBratslavsky avatar Aug 12 '22 16:08 PaulBratslavsky

Thanks @PaulBratslavsky and @omarkhairy21! Yes please go ahead and start writing the article without using pulumi.

You can start writing your draft. We use Dropbox Paper to submit and review drafts. Please duplicate and use this article template.

Once your article is ready, please share the dropbox link to your article in a comment on this GitHub issue.

dessireugarte avatar Aug 17 '22 10:08 dessireugarte

Hey @PaulBratslavsky and @dessireugarte i have updated the outline without using pulumi please confirm to me if it works

  • [ ] Introduction
    • [ ] Different ways to deploy docker images in aws
  • [ ] What is Strapi - A Headless CMS?
  • [ ] Goals
    • [ ] Overview with a diagram (to demonstrate our way of how we are going to deploy strapi on AWS)
  • [ ] Prerequisites
  • [ ] Scaffolding project
  • [ ] Build strapi with docker
  • [ ] Connect strapi to PostgreSQL database container
  • [ ] Put all together strapi and PostgresSQL with docker-compose
  • [ ] Deploy our docker image to AWS Elastic Beanstalk
    • [ ] Push our docker image to AWS ECR
    • [ ] Setup AWS Elastic Beanstalk Environment
    • [ ] Create a new application in Elastic Beanstalk Environment
    • [ ] Connect our application with PostgresSQL instance in AWS Relational Database (RDS)
    • [ ] Set up Load-Balancer with elastic load balancer and why do we need it?
  • [ ] Testing the app live in production
  • [ ] Conclusion.

i also i did a progress in writing but i have not completed

omarkhairy21 avatar Aug 31 '22 17:08 omarkhairy21

@omarkhairy21 thanks for updating the outline it looks good.

PaulBratslavsky avatar Aug 31 '22 18:08 PaulBratslavsky

Just wanted to add that when it comes with Docker you could use the tool I built for it. I would also love to see this guide as I could use some of this parts and Pulumi for Deploify etc.

Eventyret avatar Aug 31 '22 20:08 Eventyret

Hey @Eventyret thanks for pointing out your tool, actually your article was excellent and I will mention it in my article but when it comes to the tool I did not get when and where should I use it. I am open to hearing and learning from you and if is there a chance to introduce it i will.

omarkhairy21 avatar Aug 31 '22 21:08 omarkhairy21

So this is the tool https://github.com/strapi-community/strapi-tool-dockerize @omarkhairy21

Might simplify the whole setup docker as it's like 3-5 questions and you ha have the docker file 😊

Eventyret avatar Aug 31 '22 22:08 Eventyret

Thanks @Eventyret it is a cool tool I would like to introduce it in my article I was confused becuase the readme file missing keywords that explain it generates docker files

omarkhairy21 avatar Sep 04 '22 17:09 omarkhairy21

Thanks @Eventyret it is a cool tool I would like to introduce it in my article I was confused becuase the readme file missing keywords that explain it generates docker files

Yeah it generates docker file for production and also docker compose for local development. 😊

Eventyret avatar Sep 04 '22 17:09 Eventyret

Hello @omarkhairy21 👋 How are you? I'd like to know what is the status of this article?

dessireugarte avatar Oct 04 '22 13:10 dessireugarte

Hi @dessireugarte thanks for following up I completed over 70% with +1000 words so i expect to be ready for reading the next Sunday

omarkhairy21 avatar Oct 04 '22 14:10 omarkhairy21

Hey, @dessireugarte and @PaulBratslavsky I would like to take your opinions about setting up suitable closure for the article, there are some possible closures: 1- Fix the Https problem with the setup of AWS Loadbalancer it would require an extra section for setting up SSL and adding a custom domain but I do think most users not going to get the benefit of load balancer because its price is very high and it helps in particular cases to distribute thousands of requests. 2- Fix the Https by using Nginx as a docker container in front of the strapi instance, it would require also extra sections 2- Simple articulation of how to automate the build and deployment process in CI/CD like GitHub actions

Also, how about splitting the tutorials into two parts?

omarkhairy21 avatar Oct 11 '22 01:10 omarkhairy21

Sorry for the late reply @omarkhairy21 🙏 I can't answer you this question but let me check with the team and I'll get back to you

dessireugarte avatar Oct 18 '22 10:10 dessireugarte

I think adding the additional section should be fine since it is related to this article. Probably would go with this option 2- Simple articulation of how to automate the build and deployment process in CI/CD like GitHub actions

PaulBratslavsky avatar Oct 19 '22 12:10 PaulBratslavsky

Hey @dessireugarte and @PaulBratslavsky the article is ready for review https://www.dropbox.com/scl/fi/men12f6jhervcg196at31/Deploy-Strapi-Docker-Container-On-Aws-Elastic-Beanstalk.paper?dl=0&rlkey=vb7jbzzidmsuuz1ap8dg0trvn

omarkhairy21 avatar Oct 30 '22 00:10 omarkhairy21

Thank @omarkhairy21. We will get back to you when it is reviewed 👍

dessireugarte avatar Oct 31 '22 15:10 dessireugarte

@dessireugarte or @PaulBratslavsky do you confirm this article has been reviewed / scheduled?

vcoisne avatar Nov 17 '22 06:11 vcoisne

Hello @omarkhairy21 👋  Your article is live! 🎉 Please register to our forum by clicking on the discussion at the bottom of your post, so you automatically receive notifications when someone adds comments. Also, please follow the guidelines to issue and submit an invoice.

You should register yourself once as an "Individual Vendor" in this form, please let me know if you have any questions about the form. Just be aware that in the W-8BEN form:

  • 5 is not mandatory
  • 6a & 6b are only necessary if you have a tax number in your own country.

Then you can submit your invoice here for $250, since the tutorial is intermediate with > 1300 words, and soon you will receive your payment. If you want to promote your article, here are some ideas and templates that might help you! Please feel free to reach out to me if you have any questions!

dessireugarte avatar Nov 24 '22 09:11 dessireugarte

Hello @omarkhairy21! Thanks for submitting your invoice. Just please remember to fill out the "Vendor form" for us to be able to submit your payment.

dessireugarte avatar Nov 29 '22 15:11 dessireugarte

Hey @dessireugarte I did submit the vendor form but I am not sure if I missed any fields on W-8BEN form please let me know if i did

omarkhairy21 avatar Nov 29 '22 16:11 omarkhairy21