Git Product home page Git Product logo

deopinc-terraformazureprojects's Introduction

Azure Resource Deployment with Terraform

This repository contains a project of how to use Terraform to create a Linux VM in Azure.

The configuration deploys the following resources in Azure:

  • A resource group
  • A virtual network
  • A subnet
  • Public IPs
  • A Network Security Group with an inbound rule for SSH access
  • A network interface
  • A storage account for boot diagnostics
  • An SSH key

Prerequisites

  • An Azure account
  • The Azure CLI installed and configured
  • Terraform installed and configured

Insiders

This project is using the random_pet resource to create a random string to be used as the name of the resource group. The prefix variable is passed in from a variable file and is used to define the beginning of the random string.

It also creates a virtual network and a subnet within that virtual network. The virtual network uses the 10.0.0.0/16 address space, which allows for 65534 unique IP addresses. The subnet uses the 10.0.1.0/24 address space, which allows for 254 unique IP addresses.

Then it creates a public IP address, which allows resources in the virtual network to be accessed from the internet. It also creates a network security group and adds a security rule to allow inbound traffic over port 22 (SSH) from any source IP address.

A network interface is then created and associated with the subnet and public IP address. The network interface allows resources in the virtual network to communicate with the internet.

It also creates a storage account for storing boot diagnostic data and generates an SSH key for securely accessing virtual machines.

Deployment

  1. Clone this repository.
  2. Open main.tf and set the following variables:
    • resource_group_name_prefix: the prefix for the name of the resource group
    • resource_group_location: the location for the resource group
  3. Run terraform init to initialize the working directory.
  4. Run terraform plan to create an execution plan.
  5. Run terraform apply to deploy the resources to Azure.

Cleanup

To remove the resources created by this Terraform configuration, run terraform destroy.

terraform destroy

Notes

  • The resource group name is randomly generated using the random_pet resource.
  • The storage account name is randomly generated using the random_id resource.
  • An SSH key is generated using the tls_private_key resource.

deopinc-terraformazureprojects's People

Contributors

staun8621 avatar

Watchers

 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.