Giter Site home page Giter Site logo

souryamishra / terraformservicebusqueues Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guisesterheim/terraformservicebusqueues

0.0 0.0 0.0 53 KB

Terraform creation of Azure Service Bus and two Queues within it

License: MIT License

HCL 100.00%

terraformservicebusqueues's Introduction

Azure Service Bus + Queues Infrastructure

This repo is a Terraform template for provisioning the infrastructure of a Service Bus and two Queues inside it

In this README you will find:

  1. Current state of infrastructure
  2. How the information is intended to flow
  3. How to make changes to this infrastructure
  4. How to retrieve connection strings to send/retrieve messages from the queue

1 - Current state

At the present moment (14/09/2020) THE GRAY AREA of the following infrastructure is created by this repository:

To update this diagram go to https://online.visual-paradigm.com/pt/diagrams/features/azure-architecture-diagram-tool/ and use the file in readme_artifacts/Service Bus Diagram.vpd

2 - How the information flows

According to the diagram we have:

  1. Microservice 1 generates messages and post it to the messagesQueue.
  2. Microservice 2 listens to messages from the Queue and process them. If it fails to process, post back to the same queue (for up to 5 times).
  3. If it fails for more than 5 times, post the message to the Error Messages Queue.
  4. The Error Messages Queue automatically posts back the errored messages to the regular queue after one hour (this parameter can be changed on file modules/queue/variables.tf)
  5. Whether there's an error or success, Microservice 2 should always post log information to Logging Microservice

3 - How to make changes to this infrastructure

  1. After making your changes, apply to the environment using the commands below.

  2. Terraform init: terraform init -backend-config "container_name=tfstatefiles" -backend-config "storage_account_name=yourStorageAccount" -backend-config "key=<environment>-tfstate.tfstate" -backend-config "subscription_id=<subscription id>" -backend-config "client_id=<client id>" -backend-config "client_secret=<client secret>" -backend-config "tenant_id=<tenant id>" -backend-config "resource_group_name=yourResourceGroupName"

  3. Terraform plan: terraform plan -var 'client_id=<client id>' -var 'client_secret=<client secret>' -var 'subscription_id=<subscription id>' -var 'tenant_id=<tenant id>' -var-file="rootVars.tfvars" -var-file="rootVars-<environment>.tfvars" -out tfout.log

  4. Terraform apply: terraform apply tfout.log

4 - How to retrieve connection strings to send/retrieve messages from the queue

  1. Perform terraform init pointing to the desired environment (using instructions of item 3.2 above)
  2. Perform terraform refresh using the same parameters of terraform plan above (except "-out tfout.log"). It will print all the available parameters:
  • Messages queue:
    • messages_queue_name
    • messages_queue_reader_connection_string
    • messages_queue_writer_connection_string
  • Error queue:
    • error_message_queue_name
    • error_messages_queue_writer_connection_string
  • Others:
    • resource_group_name

PS: should you have any error printing variables, it might mean different states between terraform state files and the actual infrastructure. To solve this run terraform plan as shown on step 3.3. Be aware that if you go ahead with these changes, you will discard anything done manually to the infrastructure

terraformservicebusqueues's People

Contributors

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