Git Product home page Git Product logo

udacity_devops's Introduction

Azure Infrastructure Operations Project: Deploying a scalable IaaS web server in Azure

Introduction

For this project, you will write a Packer template and a Terraform template to deploy a customizable, scalable web server in Azure.

Getting Started

  1. Clone this repository

  2. Create your infrastructure as code

  3. Update this README to reflect how someone would use your code.

Dependencies

  1. Create an Azure Account
  2. Install the Azure command line interface
  3. Install Packer
  4. Install Terraform

Instructions

After cloning this project

1. Deploying Policy

Enter the Policy_folder using cd Udacity_Azure_Devops_Lab1/Policy_folder

You first have to create the policy using the command

az policy definition create --name tagging-policy --display-name 'Allow Tags' --description 'This policy makes sure that the indexed resources are not created without a tag --mode Indexed' --rules tagging-policy.json

Apply the policy to the subscription using az policy assignment create --name tagging-policy --policy tagging-policy --scope /subscriptions/XXXX-XXXX-XXXX-XXXX

Note: Use your subscription id on the area marked XXXX-XXXX-XXXX-XXXX to apply the policy to your subscription

You should have a similar view as shown below

image info

2. Create a Linux image using Packer

First, determine your service principle credentials by entering the following command to get your client_id and client_secret

az ad sp create-for-rbac --query "{ client_id: appId, client_secret: password }"

To get your subscription Id use:

az account show --query "{ subscription_id: id }"

Persist the values in the environment variable using:

export ARM_CLIENT_ID=XXXX-XXXX-XXXX-XXXX 
export ARM_CLIENT_SECRET=XXXXXXXXXXXXXXXX 
export ARM_SUBSCRIPTION_ID=XXXX-XXXX-XXXX-XXXX 

To create a linux image using packer run the following command

packer build server.json

If your image creation was successful, you should have a simlar output as shown below.

image info

3. Create and deploy Resources using terraform

  • To create the resources, enter the terraform folder containing the main.tf and vars.tf.

cd Udacity_Azure_Devops_Lab1/Terraform_folder

  • Plan the Terraform resource deployment with
terraform plan init
terraform plan -out solution.plan 

From the vars.tf, the variables are defined to implement DRY. But also you have the option of entering the Prefix name for your resources and the number of VMs you want. the number of VMs is set to be at most 5. The prompt output is as shown below.

image info

  • create your resources with the command terraform apply solution.plan

Output

When the resources are created, you should have a similar view as shown below.

image info

udacity_devops's People

Contributors

dumken1 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.