Git Product home page Git Product logo

aws-botkit's Introduction

aws-botkit

Botkit running on AWS ECS Fargate

Before You Begin

Make sure you have the following in place

Note: We will be using "us-east-1" for this example. If you would like to use a different region, make sure Fargate is available in the region.

Deployment

Setup all of your variables

# Set the region variable
export AWS_DEFAULT_REGION=us-east-1

# Set your Account ID variable
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')

# Set your repo name / bot name
export IMAGE_REPO_NAME=yourBotNameGoesHere

# Set your tag for the repo (ie. 1.0.0)
export IMAGE_TAG=yourTagGoesHere

# Set your Stack Name
export STACK_NAME=yourStackNameGoesHere

Amazon Secrets Manager

  • Create a secrets.json file for use with AWS Secrets Manager
{
    "slackToken": "yourTokenGoesHere"
}
  • Create a new secret in the AWS Secret Manager
aws secretsmanager --region $AWS_DEFAULT_REGION create-secret --name $IMAGE_REPO_NAME \
    --description $IMAGE_REPO_NAME" Secrets" \
    --secret-string file://secrets.json
  • Verify that the secret was created successfully
aws secretsmanager --region $AWS_DEFAULT_REGION get-secret-value --secret-id $IMAGE_REPO_NAME

Amazon Elastic Container Registry

  • Create an Amazon Elastic Container Registry (ECR)
aws ecr create-repository --repository-name $IMAGE_REPO_NAME
  • Build your Docker Image
docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG .
  • Tag your image
docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
  • Log into Amazon ECR
export AWS_ECR_LOGIN=$(aws ecr get-login --no-include-email) && $AWS_ECR_LOGIN
  • Now you can push your image to Amazon ECR
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG

Amazon Elastic Container Service

  • Deploy our basic stack using a CloudFormation template
aws cloudformation deploy --stack-name=$STACK_NAME --template-file=aws/chatops-stack.yml --parameter-overrides 
ServiceName=$IMAGE_REPO_NAME ImageTag=$IMAGE_TAG --capabilities=CAPABILITY_IAM

Testing Locally

docker run -it -e slackToken=yourTokenGoesHere $IMAGE_REPO_NAME:$IMAGE_TAG bash
npm start

# NOTES:
#/root/.local/bin/aws --version
#/root/.local/bin/aws configure

aws-botkit's People

Contributors

kmart2234 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.