Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhankarunhale authored Aug 2, 2024
1 parent ae5dc51 commit 370543f
Showing 1 changed file with 51 additions and 48 deletions.
99 changes: 51 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# AWS-S3-Secure-File-Manager-Starter
# AWS CDK Serverless S3 File Manager

**AWS-S3-Secure-File-Manager-Starter** is a serverless file management application that leverages AWS services to provide a secure and efficient file upload solution. The standout feature of this app is its **dynamic CORS and frontend configuration**, which happens at runtime, setting it apart from existing alternatives.
Securely manage and upload files with dynamic CORS configuration, powered by AWS services and adhering to the least privilege principle.

## Key Feature
## Quick Start

### **Dynamic CORS and Frontend Configuration**

The most important and unique aspect of this application is its ability to dynamically handle CORS and frontend configuration at runtime:

- **Dynamic CORS Configuration**: Automatically configures CORS settings as new roles are created. This ensures that the S3 bucket’s access policies are updated dynamically, with no manual intervention required.
### AWS Account Permissions

- **Secure Access Policies**: Dynamically generates access policies to ensure that only requests from the React frontend are accepted, keeping the bucket secure out of the box.
Ensure the AWS account you're using has the necessary permissions to access and manage the required services. This includes permissions for:

* S3
* Lambda
* API Gateway
* CloudFormation
* IAM
* Systems Manager (SSM)
* Elastic Container Registry (ECR)
* Simple Notification Service (SNS)
* Simple Queue Service (SQS)
* CloudFront

## Getting Started
To configure the AWS account with the necessary permissions, use the AWS Management Console or AWS CLI to attach the appropriate policies to your user or role.

### Prerequisites
It is recommended to create a custom policy with the least privilege principle.

- Node.js (v20 or later)
- AWS CLI
- AWS CDK (v2)
- GitHub account
You can use AWS-managed policies such as `AdministratorAccess` for full permissions to start, and debug permssion related issues.

### AWS Account Permissions
With the correct setup, you'll have your full stack serverless app up and running in minutes!

Ensure the AWS account you're using has the necessary permissions to access and manage the required services. This includes permissions for:
### Deployment Options

* S3
* Lambda
* API Gateway
* CloudFormation
* IAM
There are two ways to deploy this application:

To configure the AWS account with the necessary permissions, use the AWS Management Console or AWS CLI to attach the appropriate policies to your user or role. You can use AWS-managed policies such as `AdministratorAccess` for full permissions or create a custom policy with the least privilege principle.
1. **Deploy Using GitHub Actions**: This method requires no prerequisite installations other than a GitHub account. It handles deployment automatically through GitHub Actions.

2. **Run Locally**: Requires certain prerequisites to be installed locally.

### Deploy Using GitHub Actions
### 1. Deploy Using GitHub Actions

1. **Fork the Repository:**
Fork this repository to your GitHub account.
Expand All @@ -49,9 +49,15 @@ To configure the AWS account with the necessary permissions, use the AWS Managem

3. **Push Changes:**
Push any changes to your forked repository. This will trigger the GitHub Actions workflow to deploy your application.
To access the deployment "run logs>Get Deployment Url step" to get the deployment url

### Run Locally

### 2. Run Locally

#### Prerequisites
- Node.js (v20 or later)
- AWS CLI
- AWS CDK (v2)
- GitHub account

1. **Clone the Repository:**
```sh
Expand All @@ -63,24 +69,25 @@ To configure the AWS account with the necessary permissions, use the AWS Managem
```
./deploy.sh
```


## Key Features

## Features
### **Dynamic CORS and Frontend Configuration**

* Automatically configures CORS settings and access policies at runtime, ensuring secure and seamless operation.

### **Secure File Operations**

- **Secure File Uploads**:
- **Least Privilege Principle**: Presigned URLs act like temporary keys that grant limited access for file uploads, minimizing risk and exposure.
- **No Lambda Permissions Needed**: Uploads are handled directly by S3, reducing Lambda's role and associated security risks.
* Utilizes presigned URLs for both uploads and downloads, adhering to the least privilege principle to maintain security.

- **Scalable Architecture**:
- **Direct Upload to S3**: Clients upload files directly to S3, bypassing Lambda, which is like having a direct express lane for faster and more scalable uploads.
### **Efficient and Scalable Architecture**

- **Performance Optimization**:
- **Faster Uploads**: By avoiding Lambda for uploads, the app reduces latency and speeds up the process, similar to cutting out the middleman in a transaction.
* Directly manages file operations through S3, bypassing Lambda to enhance performance and scalability while reducing costs.

- **Cost Efficiency**:
- **Reduced Lambda Execution Time**: Handling uploads directly through S3 minimizes compute resource usage and costs, much like saving on fees by avoiding unnecessary services.
### **Easy Integration**

- **Simplicity and Flexibility**:
- **Client-Side Control**: Provides customizable upload parameters directly from the client application, allowing for tailored upload experiences.
* Seamlessly integrate into other applications by updating the frontend URL, with automated network configurations handled by the app.

## How It Works

Expand All @@ -93,16 +100,12 @@ To configure the AWS account with the necessary permissions, use the AWS Managem
3. **Security and Validation**:
- AWS validates the presigned URL parameters, ensuring that only authorized uploads are accepted, like checking IDs before entry.

## Example Use Case
**Scenario**: Uploading user-generated files to an S3 bucket.
**Implementation**: Lambda functions generate presigned URLs for each upload request.
**Advantages**:
- Simplified architecture
- Reduced Lambda execution time and costs
- Enhanced security with temporary, scoped access
## Integration Possibilities:
**Seamlessly incorporate into major platforms like:**

- **Content Management Systems (CMS)**: Perfect for handling media assets (e.g., WordPress).
- **E-Commerce Platforms**: Ideal for managing product images and customer reviews (e.g., Shopify).
- **Social Media Platforms**: Great for user-uploaded content such as photos and videos (e.g., Instagram).


## License
Expand Down

0 comments on commit 370543f

Please sign in to comment.