Important: This tutorial assume you already has installed and know how to use, aws cli, kubectl and eksctl
eksctl create cluster --region us-west-1 --name express-api --version 1.25 --fargate
Note: This command create a stack in cloudformation
| const dns = require('dns'); | |
| const ips = ["XX.XX.XX.XX", "XX.XX.XX.XX"]; | |
| exports.handler = (event, context, callback) => { | |
| // context.callbackWaitsForEmptyEventLoop = false; | |
| let body = JSON.parse(event.body); | |
| var done = function(code, message) { | |
| let response = { | |
| "statusCode": code, | |
| "body": JSON.stringify(message) | |
| }; |
Important: This tutorial assume you already has installed and know how to use, aws cli, kubectl and eksctl
eksctl create cluster --region us-west-1 --name express-api --version 1.25 --fargate
Note: This command create a stack in cloudformation
| #======================# | |
| # Without dependencies # | |
| #======================# | |
| #!/bin/bash | |
| # This script will export all SSM parameters under a given path as environment variables | |
| # It will also append the export statements to the ~/.bashrc file so that they are available on future logins | |
| # Set some parameters |
| # Build stage | |
| from node:18-alpine3.17 as build | |
| WORKDIR /app | |
| # Copy whole project | |
| COPY ../../ . | |
| # Install dependencies | |
| RUN yarn install |
| # Base image | |
| FROM alpine:3.18.4 as base | |
| RUN apk update && apk upgrade | |
| RUN apk add --no-cache make yasm binutils git nodejs npm | |
| RUN npm install -g yarn | |
| # Compile asmttpd http server | |
| from base as build-asmttpd | |
| RUN git clone --depth 1 https://github.com/nemasu/asmttpd |
| #! /bin/bash | |
| CLOUDCLUSTERS_HOME="/cloudclusters" | |
| LOG_FILE="$CLOUDCLUSTERS_HOME/logs/db-backup.log" | |
| SCRIPT_DIR="$CLOUDCLUSTERS_HOME/scripts" | |
| BACKUP_DIR="$CLOUDCLUSTERS_HOME/backups" | |
| S3_BUCKET="s3://<bucket_name>" | |
| DB_NAME="<dbname>" | |
| DB_USER="<dbuser>" |
This script automates the setup of a Redis container with secure access via stunnel. It generates a unique ID for the Redis instance, a secure password, and finds free ports for Redis and stunnel.
sudo nano /etc/systemd/system/my-service.serviceNOTE: And add the following content from section Service File Examples
| name: Deploy to S3 and Invalidate CloudFront Cache | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| jobs: | |
| build-and-deploy: |