-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from novekm/novekm/add-initial-module-code
Novekm/add initial module code
- Loading branch information
Showing
50 changed files
with
2,694 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,22 @@ | ||
{ | ||
"minimum_severity": "MEDIUM" | ||
} | ||
"minimum_severity": "MEDIUM", | ||
"exclude": [ | ||
"aws-elb-http-not-used", | ||
"aws-ecr-enable-image-scans", | ||
"aws-ecr-enforce-immutable-repository", | ||
"aws-elb-alb-not-public", | ||
"aws-cloudfront-enable-waf", | ||
"aws-cloudfront-use-secure-tls-policy", | ||
"aws-cloudfront-enable-logging", | ||
"aws-ec2-require-vpc-flow-logs-for-all-vpcs", | ||
"aws-iam-no-policy-wildcards", | ||
"aws-s3-block-public-acls", | ||
"aws-s3-ignore-public-acls", | ||
"aws-s3-block-public-policy", | ||
"aws-s3-enable-bucket-encryption", | ||
"aws-s3-no-public-buckets", | ||
"aws-s3-encryption-customer-key", | ||
"aws-s3-enable-bucket-logging", | ||
"aws-s3-enable-versioning", | ||
], | ||
} |
This file contains 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 |
---|---|---|
@@ -1,6 +1,14 @@ | ||
#!/bin/bash | ||
## NOTE: this script runs at the start of functional test | ||
## use this to load any configuration before the functional test | ||
## use this to load any configuration before the functional test | ||
## TIPS: avoid modifying the .project_automation/functional_test/entrypoint.sh | ||
## migrate any customization you did on entrypoint.sh to this helper script | ||
echo "Executing Pre-Entrypoint Helpers" | ||
echo "Executing Pre-Entrypoint Helpers" | ||
|
||
#********** Project Path ************* | ||
PROJECT_PATH=${BASE_PATH}/project | ||
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype | ||
cd ${PROJECT_PATH} | ||
|
||
#********** AWS Region Export ************* | ||
export AWS_DEFAULT_REGION=us-east-1 |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,53 @@ | ||
# Terraform Module Project | ||
# AWS Serverless Streamlit App Terraform Module | ||
|
||
:no_entry_sign: Do not edit this readme.md file. To learn how to change this content and work with this repository, refer to CONTRIBUTING.md | ||
## Features | ||
|
||
## Readme Content | ||
- Serverless deployment using ECS, Application Load Balancer, and CloudFront | ||
- Ability to reference existing VPCs, Subnets, Security Groups, and IAM Roles/Policies | ||
- Automated build of Docker Images | ||
- Automated push of Docker Images to Amazon Elastic Container Registry (ECR) | ||
- Configurable automated CloudFront Invalidations | ||
- Dynamic rollback to previous app versions via image tag | ||
|
||
This file will contain any instructional information about this module. | ||
## Architecture | ||
|
||
### Streamlit App Hosting | ||
|
||
![Streamlit App Hosting Arch](architecture/terraform-module-serverless-streamlit-app-hosting-arch.png) | ||
|
||
### Streamlit App Deployment Pipeline | ||
|
||
![Streamlit App Deployment Pipeline Arch](architecture/terraform-module-serverless-streamlit-app-deployment-pipeline-arch-with-key.png) | ||
|
||
## Basic Usage - Simple deployment of sample Streamlit app with default configuration | ||
|
||
### Important | ||
|
||
**Note:** The basic deployment will create necessary networking and security services for you with the default values defined in the module variables. If you need to reference existing security and networking resources (VPCs, Subnets, Security Groups, IAM Roles/Policies), please visit review the example for existing resources in the `examples` directory. | ||
|
||
**Note**: Ensure the architecture of your ECS Task matches your CodeBuild project. For example, if your CodeBuild project uses an ARM environment such as `BUILD_GENERAL1_SMALL` and an ARM image such as `aws/codebuild/amazonlinux2-aarch64-standard:3.0`, you must also set the architecture of your ECS task to be `ARM64`. | ||
|
||
The module provides variables named `ecs_cpu_architecture` `codebuild_compute_type`, and `codebuild_image` which can be modified to your desired values. The default values are using ARM. | ||
|
||
**Relevant docs**: | ||
|
||
- [CodeBuild - Docker images provided by CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html) | ||
- [CodeBuild - Build environment compute modes and types](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) | ||
|
||
```hcl | ||
// This is a template file for a basic deployment. | ||
// Modify the parameters below with your desired values | ||
module "serverless-streamlit-app" { | ||
source = "../.." # local example | ||
# source = "aws-ia/serverless-streamlit-app/aws" # remote example | ||
app_name = "streamlit-app" | ||
environment = "dev" | ||
app_version = "v0.0.1" # used as one of the tags for Docker image. Update this when you wish to push new changes to ECR. | ||
} | ||
``` | ||
|
||
## Contributing | ||
|
||
See the `CONTRIBUTING.md` file for information on how to contribute. |
This file contains 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
Oops, something went wrong.