Coder Social home page Coder Social logo

rcybersec / terraform-aws-vpc-ec2-s3 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 30 KB

This module shows an example of how you might deploy an Ubuntu instance with a simple VPC, an S3 bucket pre-configured with a user and policy in IAM, the auth key and secret uploaded as an encrypted text file directly to the S3 bucket, and S3FS and AWSCli pre-installed through cloud-init to mount the S3 bucket.

Home Page: https://github.com/rcsfc/Terraform-Instance-VPC-S3-Bucket-Example

License: Other

HCL 93.20% Shell 6.80%
cloud cloud-architecture cloud-computing iam iam-policy iam-users s3-bucket terraform ubuntu vpc

terraform-aws-vpc-ec2-s3's Introduction

Terraform Instance-VPC-S3-Bucket Example

This repo is used to show an example of how you might deploy an Ubuntu instance with a simple VPC, an S3 bucket pre-configured with a user and policy in IAM, and the auth key and secret uploaded as an encrypted text file directly to the S3 bucket when the deployment is complete. The idea behind this repo was to provide the user with a usable environment that is a bit more feature complete and secure than the typical barebones deployment of "just getting it to work". I also wanted to whitelist the user's IP address by default in SSH to avoid exposing the instance to the entire internet.

Read my 3 part series on Terraform starting with Part 1 here: https://www.linkedin.com/pulse/journey-towards-push-button-cloud-deployments-terraform-ronald-craft/

Deploys the following:

  • VPC
  • Security Group with SSH for your current public IP as the only allowed ingress access
  • Ubuntu t2.micro EC2 instance that will always pull the latest Ubuntu AMI
  • S3 bucket with the private ACL setting and a new user created that has read, put and delete permissions (adjust to your needs)
  • Versioning is enabled by default on the bucket to protect against accidental file deletion and overwriting. This is meant more for a production environment, so feel free to disable this feature if you don't want it.
  • Force delete is disabled so that the S3 bucket won't be deleted if it has files in it
  • An auth key and secret are generated and are uploaded to the S3 bucket with AES256 encryption and can be found in the file "access_keys.txt"

How to use this repo

  1. git clone https://github.com/rcsfc/Terraform-Instance-VPC-S3-Bucket-Example.git
  2. Run "terraform init"
  3. Run "terraform apply" and type "yes" at the prompt

Destroying the deployment

  1. To wipe the slate clean and destroy all of the resources you deployed run the following: "terraform destroy" and type "yes" at the prompt

ToDo

  • Clean up code and introduce more variables

terraform-aws-vpc-ec2-s3's People

Contributors

rcybersec avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

aoi-ue

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.