Question regarding .net core publishing option on AWS

0

I don’t want to publish my (asp.net core app) all source code on aws, only the locally published / compiled dll files i want to push to aws.

Means, I want to publish my app locally first (.net core 7) and then I want to move the “published-app1” directory to AWS environment.

Will it work if I manually move the “published-app1-zip” zip file to S3, like I publish application from my visual studio console to AWS directly using “AWS Elastic Beanstalk” to S3 server ?

Or can I move the same way, the locally published files to AWS ?

profile picture
asked 16 days ago112 views
2 Answers
1
Accepted Answer

Theoretically [1], you can do it. Once the zip file is uploaded to an S3 bucket, you can create a new Elastic Beanstalk environment or update an existing one by pointing it to this S3 location.

ℹ️ For more information, you can refer to the section about the contents of the Elastic Beanstalk Amazon S3 bucket in the AWS documentation here.

Similarly, you can move your locally published files to AWS by manually uploading them to S3 and then deploying through Elastic Beanstalk. After packaging your application into a zip file post-local publication, uploading this file to S3 allows you to maintain control over the deployment process and versioning of your application.


[1] ⚠️ I haven't tried it myself, but the process is well-detailed in the AWS documentation on creating an application source bundle.

profile picture
EXPERT
answered 16 days ago
profile picture
EXPERT
reviewed 16 days ago
0

Just so you know, if you use the AWS Toolkit for Visual Studio (which is an extension), you can publish directly from Visual Studio to Elastic Beanstalk. This does not copy your source code, it actually does a local publish first, then zips the files for you into a .zip file, uploads them to the Elastic Beanstalk service, configures the Elastic Beanstalk environment, and launches it, all automatically. The publishing wizard actually shows you all the commands it is using, so you can see what it's doing.

If your ASP.NET Core application does not have any Windows OS dependencies, I would encourage you to also consider publishing it as a Linux container to Amazon ECS (Elastic Container Service). The toolkit will create the Dockerfile for you automatically (if you haven't already added one using Visual Studio), build the container locally on your computer, and deploy it for you. And the AWS AppRunner service is even easier - you can just give it the location of your source code (in GitHub, or AWS CodeCommit), and it will build the container in the AWS cloud, and deploy for you, without even needing Docker on your own computer.

profile pictureAWS
Kirk_D
answered 14 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions