Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sethbr11/dotnet-serverless-example
A project demonstrating serverless deployment in AWS Fargate for a .NET application using multi-stage terraform deployment and database integration.
https://github.com/sethbr11/dotnet-serverless-example
docker dockerfile dotnet terraform terraform-module
Last synced: 16 days ago
JSON representation
A project demonstrating serverless deployment in AWS Fargate for a .NET application using multi-stage terraform deployment and database integration.
- Host: GitHub
- URL: https://github.com/sethbr11/dotnet-serverless-example
- Owner: sethbr11
- Created: 2024-12-09T23:36:24.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-29T07:04:09.000Z (18 days ago)
- Last Synced: 2024-12-29T07:25:58.879Z (18 days ago)
- Topics: docker, dockerfile, dotnet, terraform, terraform-module
- Language: HCL
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# .NET Application Serverless w/ AWS Fargate
To run the project, enter the main folder and run `docker build -t proj2 .` followed by `docker run -dit -p 80:80 proj2`. To run the Terraform code, run `terraform init`, `terraform plan`, `terraform validate`, and `terraform apply`, then `terraform destroy` to delete your created resources. Automatic deployment can be done by running `./deployinfrastructure.sh` (with custom flags `-sql` to run the SQL code to initialize the database and `-skip-docker` to skip the docker image creation and upload) and subsequent destruction of those created resources is done with `./destroyinfrastructure.sh` (with the `-c` flag to only run the ECR cleanup). Some setup may be needed with installing docker, AWS CLI, terraform, etc, including IAM role creation. You may need to download the latest amazonlinux docker image, which can be done with `docker pull amazonlinux:latest`.
## Setup
Before running the code in this project, you will need Docker and AWS CLI installed and configured. The only thing you will need to do within the project itself is rename the `terraform/variables.tf.base` file to just `terraform/variables.tf` and put in your AWS credentials. These credentials should be configured for an IAM user you've created in AWS for terraform to do its thing. It should be set up with roughly the following permissions: AmazonEC2ContainerRegistryFullAccess, AmazonEC2ContainerRegistryPowerUser, AmazonEC2ContainerServiceRole, AmazonEC2FullAccess, AmazonECS_FullAccess, AmazonRDSFullAccess, CloudWatchLogsFullAccess, IAMFullAccess.
Lastly, the Dockerfile is configured to clone a sample .NET app found [here](https://github.com/sethbr11/pdcdonuts). This should be reconfigured to point to your app, whether you use git clone or whether you use Dockerfile's COPY command.