Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automate provision of cloud infrastructure and application deployment.

NotificationsYou must be signed in to change notification settings

hanchiang/market-data-notification-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Start workflowStop workflow

This project is the infrastructure as code management forMarket data notification using AWS.

Structure

  • images/: Packer files for building AMI
    • image.pkr.hcl: Main packer script
    • scripts/: Scripts to be run when provisioning AMI
  • instances/: Terraform files to provision EC2 in VPC
    • main.tf: Main terraform script
    • ansible/: Ansible scripts to run post-provisioning tasks such as mounting EBS volume, set up file system, copy postgres data, setup SSL for nginx
    • scripts/: Scripts to automate(everything after step 2 of the workflow) start and stop of EC2, DNS, and deployment ofMarket data notification. Calls ansible scripts

Workflow

1. Provision EC2 AMI using packer

Provisions a EBS-backed EC2 AMI, and install the necessary softwares forMarket data notification:

  • redis
  • docker
  • nginx

cd intoimages/
Define variables that are declared inimage.pkr.hcl in a new filevariables.auto.pkrvars.hcl
Build image:packer build -machine-readable -var-file variables.auto.pkrvars.hcl image.pkr.hcl | tee build.log

2. Provision EC2 using terraform

cd intoinstances/
Copy the AMI ID from packer build, update it invariables.tf
Provision infra:terraform apply

Everything from here onwards is handled ininstances/scripts/start.sh

3. Run ansible script

Run post-provisioning configurations such as setting up DNS, configuring nginx SSL

4. Deploy application

Rerun the latest deploy job in github action

Workflow

Workflow


[8]ページ先頭

©2009-2025 Movatter.jp