-
Notifications
You must be signed in to change notification settings - Fork 11
feat(pulumi): add AWS infrastructure code and deployment guide #1052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bhagyashreewagh
wants to merge
66
commits into
RolnickLab:main
Choose a base branch
from
bhagyashreewagh:feat/aws-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
4dbdd47
docs(infra): add aws-infra folder with initial pipeline documentation
bhagyashreewagh e91ea76
docs(infra): add Elastic Beanstalk PassRole policy under aws-infra/po…
bhagyashreewagh 176badd
Delete aws-infra/aws-infra/policies directory
bhagyashreewagh daebb37
Create iam_elastic_beanstalk_policy.json
bhagyashreewagh 1fa6843
docs(readme): add complete AWS deployment and infrastructure document…
bhagyashreewagh e449df2
docs: add full AWS deployment and infrastructure guide to README
bhagyashreewagh 68fdadb
Update README.md
bhagyashreewagh 9cd267c
Update README.md
bhagyashreewagh 31fc8b4
Update README.md
bhagyashreewagh 217e619
docs(readme): update deployment guide with clearer examples and confi…
bhagyashreewagh 87c8b92
Correct grammatical error in README.md
bhagyashreewagh 2e41a6d
Update README.md
bhagyashreewagh 4c02615
Update README.md
bhagyashreewagh 68b8002
Create aws-architecture.png
bhagyashreewagh 44c10a2
Add files via upload
bhagyashreewagh cf6c84f
Rename White Beige Minimal Flowchart Diagram Graph (1).png to aws_arc…
bhagyashreewagh e546840
Delete aws-infra/images/aws-architecture.png
bhagyashreewagh 366a7dd
Update README.md
bhagyashreewagh 7e75828
Add files via upload
bhagyashreewagh b754870
Delete aws-infra/images/aws_architecture.png
bhagyashreewagh eac6e24
Rename White Beige Minimal Flowchart Diagram Graph (2).png to aws_arc…
bhagyashreewagh a0cbebe
Update README.md
bhagyashreewagh c30fe43
Add files via upload
bhagyashreewagh c5dd9fc
Rename White Beige Minimal Flowchart Diagram Graph.svg to aws_archite…
bhagyashreewagh 1b0e8eb
Delete aws-infra/images/aws_architecture.png
bhagyashreewagh 68003e4
Update README.md
bhagyashreewagh 20afc50
Rename aws_architecture.svg to aws_architecture_backend.svg
bhagyashreewagh cb7947c
Add files via upload
bhagyashreewagh ea75cf1
Delete aws-infra/images/2.svg
bhagyashreewagh 46bfdbd
Add files via upload
bhagyashreewagh c2fe428
Add Antenna UI deployment guide to README
bhagyashreewagh 91494df
Revise Antenna deployment documentation
bhagyashreewagh e67b5b4
Fix header formatting in README.md
bhagyashreewagh d606342
Revise README for backend services and security notes
bhagyashreewagh 03a3ba3
Add Elastic Beanstalk configuration template
bhagyashreewagh 9b6bd3a
Add Dockerrun.aws.json_template for AWS deployment
bhagyashreewagh f9fab02
Create storage.py
bhagyashreewagh 9803c04
Merge branch 'RolnickLab:main' into feat/aws-pipeline
bhagyashreewagh 35fb523
Refactor AWS S3 and MinIO configuration logic
bhagyashreewagh fca0e89
Add experimental warning to AWS deployment README
bhagyashreewagh 6658ea1
Update storage.py
bhagyashreewagh ade4e95
Update storage.py
bhagyashreewagh c3bfea5
Add secrets manager implementation for AWS
bhagyashreewagh 1fbe45a
Add dependencies to requirements.txt for AWS infra
bhagyashreewagh 2d4a3e2
Add Redis ElastiCache configuration with Pulumi
bhagyashreewagh f1fc02d
Add RDS instance configuration with monitoring
bhagyashreewagh 70cc82c
Add Docker image build and push logic for AWS ECR
bhagyashreewagh bc3aaa9
Add IAM roles and policies for ECS and EB
bhagyashreewagh 3f2e14f
Add script to create AWS ECR repositories
bhagyashreewagh 7c89e94
Add AWS Elastic Beanstalk infrastructure setup
bhagyashreewagh 31c6e6d
Add CloudFront configuration and S3 bucket setup
bhagyashreewagh 791f493
Initialize AWS infrastructure deployment script
bhagyashreewagh efe3363
Delete aws-infra/policies directory
bhagyashreewagh ba59265
Add S3 bucket configuration with ownership and encryption
bhagyashreewagh 9f5a568
Import S3 modules in storage init file
bhagyashreewagh 7b341ff
Add S3 bucket policies and public access settings
bhagyashreewagh b756454
Add installation guide for Pulumi on AWS
bhagyashreewagh 639b482
Add VPC configuration using AWS default VPC
bhagyashreewagh 880066a
Implement AWS subnets for Redis and RDS
bhagyashreewagh a7ebde5
Add security groups for EB, RDS, and Redis
bhagyashreewagh 7f89036
Remove specific IPs from security group rules
bhagyashreewagh 69d260c
Create private route table for RDS subnets
bhagyashreewagh 671d254
Update installation.md
bhagyashreewagh bc3de5e
Update eb.py
bhagyashreewagh 22aa1cc
Update s3.py
bhagyashreewagh d5930d4
Rename security_groups.py to security_group.py
bhagyashreewagh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import pulumi | ||
|
|
||
| # --------------------------------------------------------- | ||
| # Optional deploy flags | ||
| # --------------------------------------------------------- | ||
| config = pulumi.Config() | ||
| DEPLOY_EB = config.get_bool("deployEb") or False | ||
| BUILD_IMAGES = config.get_bool("buildImages") or False | ||
| DEPLOY_FRONTEND = config.get_bool("deployFrontend") or False | ||
|
|
||
|
|
||
| # ========================================================= | ||
| # CREATE BASE INFRA | ||
| # (networking, storage, IAM, ECR, Redis, RDS) | ||
| # ========================================================= | ||
|
|
||
| # --- Networking --- | ||
| from networking.vpc import default_vpc | ||
| from networking import subnets | ||
| from networking import routes | ||
| from networking.security_group import * | ||
|
|
||
| # --- Storage (S3 + policies) --- | ||
| from storage import * | ||
|
|
||
| # --- IAM Roles --- | ||
| import iam_roles | ||
|
|
||
| # --- ECR repos (needed by images build + EB dockerrun) --- | ||
| import ecr | ||
|
|
||
| # --- Redis + RDS --- | ||
| import redis | ||
| import rds | ||
|
|
||
|
|
||
| # ========================================================= | ||
| # 1) BUILD DOCKER IMAGES (ONLY IF REQUESTED) | ||
| # ========================================================= | ||
| if BUILD_IMAGES: | ||
| import images | ||
bhagyashreewagh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| # ========================================================= | ||
| # 2) DEPLOY EB (ONLY IF REQUESTED) | ||
| # ========================================================= | ||
| if DEPLOY_EB: | ||
| # EB requires Dockerrun/zip generation code, | ||
| # so always import images when deploying EB | ||
| if not BUILD_IMAGES: | ||
| import images | ||
|
|
||
| # Secrets Manager: | ||
| # - creates manual secrets (django key, sendgrid, sentry) | ||
| # - exports AWS-generated RDS master secret arn | ||
| # - constructs EB_ENV map | ||
| import secrets_manager | ||
|
|
||
| # Elastic Beanstalk environment | ||
| import eb | ||
|
|
||
| # ========================================================= | ||
| # 3) DEPLOY FRONTEND (ONLY IF REQUESTED) | ||
| # IMPORTANT: must come AFTER EB import, because cloudfront.py | ||
| # imports env_pulumi from eb.py for backend origin. | ||
| # ========================================================= | ||
| if DEPLOY_FRONTEND: | ||
| import cloudfront | ||
|
|
||
| else: | ||
| # If EB is not deployed in this run, we cannot deploy frontend proxying to EB | ||
| # because cloudfront.py expects env_pulumi from eb.py. | ||
| if DEPLOY_FRONTEND: | ||
| raise Exception("deployFrontend=true requires deployEb=true in the same run (CloudFront backend origin uses EB env URL).") | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.