Translating an existing three-tier application into Infrastructure as Code (IaC).
Go to file
2023-10-23 15:11:46 -04:00
images Upload a photo of the architecture. 2023-06-19 12:30:33 -04:00
terraform Utilize list comprehension to output EC2 ARNs. 2023-10-23 15:11:46 -04:00
.gitignore Initial commit 2023-06-19 15:59:38 +00:00
LICENSE Initial commit 2023-06-19 15:59:38 +00:00
README.md Documentation Genesis 2023-06-19 16:24:36 +00:00

tf-cf-aws-3tier-dev (WIP NOT COMPLETE)

Abstract

In this project we attempt to automate infrastructure provisioning in Amazon Web Services. The infrastructure includes the services essential for a customer managed three-tier-app. An attempt is made to convert as many services or resources into Terraform plans as possible. The project is intended as a MVP and to be tested in a non-production AWS account.

Architecture

Three Tier AWS Architecture

Requirements

The author(s) assumes the reader has access to Amazon Web Services with sufficient IAM permissions. Access to provisioned GNU+Linux compute requires a personal SSH key. Access to Windows Server compute requires a local or domain account.

IaC

Experience handling infrastructure as code and Terraform is very helpful as well. Consider reading Terraform Up and Running for the fundamentals.

Tooling

  • Terraform >= 1.4.XYZ
  • Provider: hashicorp/aws >= v5.3.0

Usage

  1. Install requirements
  2. Configure AWS Account Credentials
  3. Clone repository
  4. Generate a .tfvars file using the template tfvars.skel
  5. terraform init
  6. terraform plan
  7. terraform apply
  8. Confirm SSH and RDP access is available
  9. Apply desired application tests

DO NOT STORE SSH KEYS, API KEYS, OR TERRAFORM STATE FILES REMOTELY. PLEASE KEEP THEM SECURE ON YOUR LOCAL MACHINE

Testing and Debugging

Terraform provides simple linting and validation functionality. Keep in mind validation or linting does not guarantee a successful deployment.

Terraform

Quickly check your plans: terraform fmt && terraform validate

Bugs

The current IaC implementation will fail to provision. There improvements in use of the for_each meta-argument to be made. Lastly, the implementation is not resilient to failures and requires an overhaul. Future plans will consider serverless and auto-scaling cloud services to bolster resiliency.

Attribution

Warning

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TL;DR: Not my problem

License

The GPL V2 license applies to this project. All copyrights belong to their respective copyright holders and all trademarks belong to their trademark holders.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.)