Giter Site home page Giter Site logo

yetics / armkit Goto Github PK

View Code? Open in Web Editor NEW
53.0 5.0 13.0 4.49 MB

Define infrastructure resources using programming constructs and provision them using Azure ARM templates

License: Apache License 2.0

JavaScript 0.01% TypeScript 99.98% Dockerfile 0.01% Shell 0.01%
azure arm-templates azure-arm-template infrastructure azure-services deploy-stacks cloud-development-kit

armkit's Introduction

Armkit (Azure Cloud Development Kit)

Badges

Build npm version

Contributing and Feedback

CDK for Azure is an early experimental project and the development folks would love your feedback to help guide the project.

We welcome community contributions and pull requests. See CONTRIBUTING for information on how to set up a development environment and submit code.

Summary

Armkit, Azure Cloud Development Kit (CDK), is an open source software development framework to define cloud Infrastructure as Code (IaC) and provision it through Azure ARM Templates.

It offers a high-level object-oriented abstraction to define Azure resources imperatively using the power of modern programming languages. Using the Armkit library of infrastructure constructs, you can easily encapsulate Azure best practices in your infrastructure definition and share it without worrying about boilerplate logic.

Armkit is available in the following languages:

Background

Developers use the Armkit framework in one of the supported programming languages to define reusable cloud components called constructs, which are composed together into stacks, forming an "Armkit app".

They then use the Armkit CLI to interact with their Armkit app. The CLI allows developers to synthesize artifacts such as Azure ARM Templates, deploy stacks to development Azure accounts and diff against a deployed stack to understand the impact of a code change.

The Armkit Construct Library includes a module for each Azure service with constructs that offer rich APIs that encapsulate the details of how to use Azure. The Armkit Construct Library aims to reduce the complexity and glue-logic required when integrating various Azure services to achieve your goals on Azure.

Armkit packages:

  • @armkit/core - A library that allows users to build Azure applications contructs.
  • armkit-resources - A library for defining Azure resources using programming constructs.
  • armkit-cli - A CLI that allows users to run commands to initialize, import, and synthesize Armkit applications.

Examples

Some sample constructs are in examples. This could look like this:

helloArmkit.ts

import { Construct } from "constructs";
import { App, ArmStack } from "@yetics/armkit-core";
import {
  ContainerGroups,
  ContainerGroupPropertiesOsType,
  MicrosoftContainerInstanceContainerGroupsType,
  MicrosoftContainerInstanceContainerGroupsApiVersion,
} from "./.generated/ContainerInstance-2021-03-01";
import {
  Registries,
  MicrosoftContainerRegistryRegistriesApiVersion,
  MicrosoftContainerRegistryRegistriesType,
  SkuName,
} from "./.generated/ContainerRegistry-2019-05-01";

export class HelloArmkit extends ArmStack {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    new ContainerGroups(this, "MyContainerGroup", {
      name: "azurecdktest",
      location: "westeurope",
      apiVersion:
        MicrosoftContainerInstanceContainerGroupsApiVersion["2021_03_01"],
      type:
        MicrosoftContainerInstanceContainerGroupsType.MICROSOFT_CONTAINER_INSTANCE_CONTAINER_GROUPS,
      properties: {
        containers: [
          {
            name: "ubuntu-server",
            properties: {
              image: "ubuntu:18.04",
              command: ["sleep infinity"],
              resources: {
                requests: {
                  cpu: 1,
                  memoryInGB: 2,
                },
                limits: {
                  cpu: 1,
                  memoryInGB: 2,
                },
              },
            },
          },
        ],
        osType: ContainerGroupPropertiesOsType.LINUX,
      },
    });

    new Registries(this, "azurecdktest", {
      name: "azurecdktest",
      location: "westeurope",
      apiVersion: MicrosoftContainerRegistryRegistriesApiVersion["2019_05_01"],
      type:
        MicrosoftContainerRegistryRegistriesType.MICROSOFT_CONTAINER_REGISTRY_REGISTRIES,
      sku: {
        name: SkuName.BASIC,
      },
      properties: {
        adminUserEnabled: false,
      },
    });
  }
}

const app = new App({ outdir: "cdk.out" });
new HelloArmkit(app, "hello-armkit");
app.synth();

For a detailed walk through, see the Armkit Developer Guide.

Building

Clone the project repository

git clone https://github.com/Yetics/armkit.git

Download dependencies and build node.js

cd armkit/
yarn install
yarn build

Build the examples/basic package:

Go to examples/basic:

cd /examples/basic

Generate the armkit cdk libs:

yarn generate

Translate typescript to node.js:

yarn build

Render ARM template from CDK:

node index.js

Check out the results:

az deployment group create --resource-group <resource-group-name> --template-file @cdk-out/helloarmkit.json

Roadmap

The Armkit Roadmap project board lets developers know about our upcoming features and priorities to help them plan how to best leverage Armkitand identify opportunities to contribute to the project. See ROADMAP for more information and FAQs.

License

Armkit is distributed under the Apache License, Version 2.0.

See LICENSE and NOTICE for more information.

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.