Git Product home page Git Product logo

armrest's Introduction

Armrest

BoltOps Badge

Gem Version

A very lightweight Azure library that works with the Azure REST API, it is not meant to be exhaustive.

This was built because there doesn't seem to be a good library out there with the Azure features that Terraspace and Terraspace Plugin Azurerm wanted to use:

  • Auth Chain Provider: env vars -> MSI -> CLI creds. #6
  • KeyVault secrets via the REST API

Also, the Microsoft Azure SDK for Ruby library was deprecated as of Feb 2021 and was officially retired. It's core library ms_rest_azure.gemspec have pinned versions of gems like faraday < 2, which causes gem dependency resolution issues.

This library also only makes use of the Ruby standard builtin net/http library so there's no dependency on faraday.

Again, this library has no goals of being extensive. Code generated SDKs is the approach that would take for that, but not dedicating the time to do that for this library.

Usage: Ruby

Resource group:

require "armrest"
resource_group = Armrest::Services::ResourceGroup.new
resource_group.create_or_update(
  name: "my-resource-group",
  location: "eastus",
  tags: {key1: "value1"},
)

Refer to the boltops-tools/terraspace_plugin_azurer for more examples.

Usage: CLI

The main purpose of gem is to be a Ruby library that Terraspace can interact with. The CLI interface was only built to help quickly test the code with live resources. It's essentially a way to QA. Here are some examples:

Auth:

armrest auth app
armrest auth msi
armrest auth cli

The auth chain is: app -> msi -> cli

armrest auth

You can disable MSI with ARMREST_DISABLE_MSI=1.

Resource Group:

armrest resource_group check_existence demo

Storage Account:

armrest storage_account create demofoobar123v3 --tags name:bob age:8

Blob Service:

armrest blob_service set_properties --storage-account demofoobar123 --delete-retention-policy days:9 enabled:true --container-delete-retention-policy days:10 enabled:true --is-versioning-enabled

Secret:

$ export ARMREST_VAULT=demo-dev-vault-test1
$ armrest secret show demo-dev-pass
secret1
$

Installation

Add to your Gemfile

Gemfile

gem "armrest"

armrest's People

Contributors

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