Giter Site home page Giter Site logo

matheusfarias03 / terraformchallenge Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 22.28 MB

Terraform file to create the infrastructure on Huawei Cloud and deploy "Hello, World!" website written in Python

HCL 83.31% Python 4.03% HTML 12.65%
docker huaweicloud python terraform

terraformchallenge's Introduction

Terraform Configuration for Provisioning Infrastructure on HUAWEI CLOUD

This Terraform configuration automates the provisioning of infrastructure resources on HUAWEI CLOUD. It creates a Virtual Private Cloud (VPC), subnet, Elastic IP (EIP), Elastic Cloud Server (ECS) instance, and associates the EIP with the ECS instance. Additionally, it sets up an organization in Huawei's SWR (Software Image Repository), pushes a Docker image to the SWR repository, installs Docker on the ECS instance, and runs the image on it.

Prerequisites

Before running this Terraform configuration, ensure the following:

  1. HUAWEI CLOUD Account: You must have a HUAWEI CLOUD account with appropriate permissions to create and manage resources.

  2. Access Key and Secret Key: Obtain the Access Key and Secret Key of your HUAWEI CLOUD account.

  3. Terraform Installation: Install Terraform on your local machine. You can download it from here and follow the installation instructions.

  4. Docker Installation: Ensure Docker is installed and running on your local computer. You can download Docker Desktop from here.

Configuration

  1. Variables: Update the variables.tf file with your HUAWEI CLOUD access key, secret key, region, availability zone, passwords, and Docker-related configurations.

  2. Security Group: Ensure that port 5000 is open on the security group associated with your ECS instance on HUAWEI CLOUD. This is necessary for accessing the Docker image running on the ECS instance.

Usage

  1. Initialize Terraform: Run terraform init in the directory containing the Terraform configuration files to initialize the working directory.

  2. Plan: Run terraform plan to see the execution plan. It will show you what actions Terraform will take when you apply the configuration.

  3. Apply: Run terraform apply to apply the Terraform configuration and provision the infrastructure resources on HUAWEI CLOUD.

Important Note

  • Ensure that Docker is up and running before executing the Terraform configuration.

Additional Resources

  • Terraform Documentation: Refer to the official Terraform documentation for more information on Terraform usage and features.

  • HUAWEI CLOUD Documentation: Explore the HUAWEI CLOUD documentation for specific details on using HUAWEI CLOUD services.

  • HUAWEI CLOUD Terraform Documentation: HUAWEI CLOUD documentation specific for it's use with terraform.

  • For any issues or questions related to this Terraform configuration, please open an issue in this repository.

terraformchallenge's People

Contributors

matheusfarias03 avatar

Watchers

 avatar

Forkers

rodecarv

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.