Giter Site home page Giter Site logo

wlamir / aws-pfsense-ami Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aoktox/aws-pfsense-ami

0.0 1.0 0.0 14 KB

Create & import AWS EC2 image from pfSense CE edition. Reference : https://github.com/hargut/aws-packer-pfsense

Shell 18.26% HCL 81.74%

aws-pfsense-ami's Introduction

Description

Build and import a pfSense image for usage on AWS using Hashicorp Packer with Virtualbox backend.

Components

Tools used when writing this repo

  • Packer 1.4.3
  • Terraform v0.11.14
    • provider.aws v2.40.0
    • provider.random v2.2.1
  • VirtualBox 6.0.12 r133076 (Qt5.6.3)
  • aws-cli/1.16.193 Python/2.7.10 Darwin/18.7.0 botocore/1.12.183

pfsense configuration

pfSense config.xml contains the following modifications in config/config.xml (you can adjust this file before running packer command):

  • disabled LAN interface (single NIC mode)
  • Webinterface listens on port 8080
  • enabled OpenSSH on port 22
  • allow Webinterface and OpenSSH traffic on WAN interface from ANY source
  • disable HTTP_REFERERCHECK on Webinterface

How to use

  • Clone this repo
  • Set your AWS cli credential (you can use awsudo)
  • run terraform apply in repo root directory
    • get s3 bucket name from bucket_name terraform output
      • e.g : bucket_name = vmimport-input-xxx
  • run packer build packer.json
    • Do not manually press keys inside virtualbox console.
  • Created images are placed in the output directory.
    • Copy vmdk file from output directory to vmimport s3 bucket
      • e.g : aws s3 sync output s3://vmimport-input-xxx
  • Make some adjustment on import.json file
    • BUCKET_PLACEHOLDER should be replaced by s3 bucket name
    • KEY_PLACEHOLDER should be replaced by vmdk file name from output directory
  • Run aws ec2 import-snapshot --disk-container file://import.json
    • You will see json output contains import-task-id
    • To view import progress, you can use aws ec2 describe-import-snapshot-tasks --import-task-id import-snap-XXXXX
  • DONE. You have successfully import virtualbox vm into aws snapshot.
    • Wait, isn’t this a repo about creating ec2 image, not snapshot?
      • It is indeed. Actually, packer provide Amazon Import Post-Processor that can automatically create ec2 AMI from packer artifact, and I implemented it in 3fffc0d but somehow it gave me "ClientError: No valid partitions. Not a valid volume." and i have no time to debug that part.
  • To create AMI from snapshot, please refer to this documentation

aws-pfsense-ami's People

Contributors

aoktox avatar

Watchers

James Cloos 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.