eLinkin

Host your media in the cloud in minutes!

The AWS Serverless boilerplate with all you need to quickly host your media in the cloud practically for free using AWS S3 Buckets and Cloudfront.

Key Features

Step-by-step setup

When deploying this template, the sequence of steps is important. Follow the steps below in order to get up and running.

Quick Start

To successfully deploy the project, you will need to create an AWS account.

AWS Sign Up

IMPORTANT: When creating AWS users/accounts, NEVER give out your access keys to anyone or upload them to any public repository. Bad actors can abuse your keys and spin up AWS resources without your immediate knowledge!

Setting Multi-Factor Authentication (MFA) on your AWS account is highly recommended!

Creating An IAM User

Creating an IAM User for AWS Access

When setting up a new AWS account, you'll encounter a variety of features. While it might seem complex, we'll take care of most of it for you! We do need to first configure access keys, which allow external applications (like ours) to interact with your AWS resources. These keys are managed through IAM (Identity and Access Management) users.

Setup an IAM User Guide for eLinkin

  1. Create API Access Keys:

    • Open the IAM Console.
    • Make sure you are logged into your AWS account.
    • Navigate to Users under Access management
    • Click on Create user. They do not need access to AWS Management Console.
    • Select Attach policies directly
    • *Under Permissions policies select AdministratorAccess and check it. Alternatively, you can provide scoped permissions by looking under the requirements in /deployment/lib.
    • Press Next then Create User
    • Now that your user is created, select the user.
    • Go to "Security Credentials".
    • Scroll down to "Access Keys".
    • Click "Create access key".
    • Select "Local Code", check the checkbox, and continue.
    • You don't need a description. Select Create access key.
    • Continue to get your Access Key ID and Secret Access Key and follow the next stpe.
  2. Update the variables.env File:

    • Place your Access Key ID and Secret Access Key in the variables.env file.
    • Your project should now have the necessary access to AWS resources.

Important Security Note (I know we already had one up there but this is extremely important!)

Setting Up AWS CDK (Cloud Deployment Kit)

  1. Install Node.js and npm AWS CDK is a Node.js application, so you need Node.js and npm (Node.js package manager) installed. You can download and install Node.js and npm.

  2. Install AWS CDK With Node.js and npm installed, you can now install AWS CDK. Run the following command in your terminal:

npm install -g aws-cdk

This installs the AWS CDK globally on your machine, allowing you to use it in any project.

  1. Verify CDK Installation After installation, verify that the CDK has been installed correctly by running:
cdk --version

This command will display the installed version of the CDK, confirming that it is ready to use.

Pre-Deployment

Installing Node Modules

Now that your environment is configured, the next step is to install the required Node.js modules. These modules are necessary for the AWS CDK and other project dependencies to function correctly.

  1. Navigate to the 'Deployment' Folder: Open your terminal and navigate to the project folder. Use the cd command to change directories:

    cd path/to/your/project
    

    Replace path/to/your/project with the actual path to your project's root directory.

  2. Run npm Install: In the your project directory, run the following command to install the required Node.js modules:

    npm install
    

    If you encounter any permission issues, you may need to prefix the command with sudo:

    sudo npm install
    

    This command reads the package.json file in your 'deployment' folder and installs all the dependencies listed there, which is required for eLinkin to work.

One Thing To Do...

Okay great! You've got your AWS credentials, environment, and CDK set up.

We did all the heavy lifting for you. There's only one more thing you need to do before deploying!

Deployment

Now that we have all the setup, deployment is easy.

  1. Prep AWS for CDK deployment by running the following in your project directory:

    cdk bootstrap
    
  2. Once your AWS environment is prepped, run the following command to begin deployment:

    node main.js
    

    After running the script for the first time, you may be presented with a table of IAM Policy Changes in which you will be prompted. Simply type y for "yes":

    y
    

That's It! Navigate to your media content!

After deployment finishes (it may take a couple minutes the first time) your content should be ready to go!

  1. Visit Your Media:
    • Visit your deployed media in your browser. The terminal logs should provide direct links to your content!
    • Alternatively, you can construct links to your content by simply pairing the CloudFrontDistributionDomainName value in your cdk-outputs.json file and path to your media. For example, xxxxxxxxxx.cloudfront.net/example-media.mp4

That's it

Not bad! Your media is now accessible and you can use it in your websites or wherever you need to access it.

Anytime you need to remove or upload new media, simply add/remove content from the media folder, then redeploy in your project directory with node main.js. The syncing will happen automatically!

Questions

If you have any questions, feel free to reach out to me on my X handle @realHenryOuang or email admin@enteleca.com!

Enjoy eLinkin!

eLinkin logo
eLinkin is the go-to infrastructure template with all you need to deploy your media to the cloud in minutes.
LINKS
LEGAL
FOLLOW US
Copyright © 2024. Made with ♥ by MemoryMaps. Powered by Suparepos!