armkit
所属分类:虚拟/增强现实-VR/AR
开发工具:TypeScript
文件大小:1217KB
下载次数:0
上传日期:2023-05-09 04:53:47
上 传 者:
sh-1993
说明: 使用编程构造定义基础设施资源,并使用Azure ARM模板提供这些资源
(Define infrastructure resources using programming constructs and provision them using Azure ARM templates)
文件列表:
.dockerignore (57, 2021-05-20)
.vsls.json (135, 2021-05-20)
CODE_OF_CONDUCT.md (352, 2021-05-20)
CONTRIBUTING.md (1898, 2021-05-20)
Dockerfile (183, 2021-05-20)
LICENSE (11390, 2021-05-20)
ROADMAP.md (0, 2021-05-20)
azure-pipelines.yml (1277, 2021-05-20)
examples (0, 2021-05-20)
examples\basic (0, 2021-05-20)
examples\basic\index.ts (2069, 2021-05-20)
examples\basic\package-lock.json (11462, 2021-05-20)
examples\basic\package.json (623, 2021-05-20)
examples\basic\tsconfig.json (717, 2021-05-20)
examples\basic\yarn.lock (22650, 2021-05-20)
lerna.json (191, 2021-05-20)
package.json (944, 2021-05-20)
packages (0, 2021-05-20)
packages\@armkit (0, 2021-05-20)
packages\@armkit\core (0, 2021-05-20)
packages\@armkit\core\.npmignore (40, 2021-05-20)
packages\@armkit\core\lib (0, 2021-05-20)
packages\@armkit\core\lib\app.ts (1155, 2021-05-20)
packages\@armkit\core\lib\arm-element.ts (130, 2021-05-20)
packages\@armkit\core\lib\arm-resource.ts (658, 2021-05-20)
packages\@armkit\core\lib\arm-stack.ts (1494, 2021-05-20)
packages\@armkit\core\lib\index.ts (111, 2021-05-20)
... ...
# Armkit (Azure Cloud Development Kit)
- [Armkit (Azure Cloud Development Kit)](https://github.com/Yetics/armkit/blob/master/#armkit-azure-cloud-development-kit)
- [Badges](https://github.com/Yetics/armkit/blob/master/#badges)
- [Contributing and Feedback](https://github.com/Yetics/armkit/blob/master/#contributing-and-feedback)
- [Summary](https://github.com/Yetics/armkit/blob/master/#summary)
- [Background](https://github.com/Yetics/armkit/blob/master/#background)
- [Examples](https://github.com/Yetics/armkit/blob/master/#examples)
- [**`helloArmkit.ts`**](https://github.com/Yetics/armkit/blob/master/#helloarmkitts)
- [Building](https://github.com/Yetics/armkit/blob/master/#building)
- [Roadmap](https://github.com/Yetics/armkit/blob/master/#roadmap)
- [License](https://github.com/Yetics/armkit/blob/master/#license)
## Badges
[![Build](https://github.com/Yetics/armkit/blob/master/https://github.com/Yetics/armkit/actions/workflows/test-build.yml/badge.svg)](https://github.com/Yetics/armkit/blob/master/https://github.com/Yetics/armkit/actions/workflows/test-build.yml)
[![npm version](https://github.com/Yetics/armkit/blob/master/https://badge.fury.io/js/%40yetics%2Farmkit-core.svg)](https://github.com/Yetics/armkit/blob/master/https://badge.fury.io/js/%40yetics%2Farmkit-core)
## Contributing and Feedback
CDK for Azure is an early experimental project and the development folks would love your feedback to help guide the project.
- Report a [bug](https://github.com/Yetics/armkit/blob/master/https://github.com/yetics/armkit/issues/new?assignees=&labels=bug&template=bug-report.md&title=)
- Request a new [feature](https://github.com/Yetics/armkit/blob/master/https://github.com/yetics/armkit/issues/new?assignees=&labels=enhancement&template=feature-request.md&title=).
- Browse all [open issues](https://github.com/Yetics/armkit/blob/master/https://github.com/yetics/armkit/issues).
- Public [roadmap](https://github.com/Yetics/armkit/blob/master/https://github.com/yetics/armkit/projects/1).
- Ask a question on [Stack Overflow](https://github.com/Yetics/armkit/blob/master/https://stackoverflow.com/questions/tagged/armkit) and tag it with `armkit`
- Come join the Armkit community on [Slack](https://github.com/Yetics/armkit/blob/master/https://cdk-dev.slack.com/archives/C01QBE1A3RC)
We welcome community contributions and pull requests. See [CONTRIBUTING](https://github.com/Yetics/armkit/blob/master/./CONTRIBUTING.md) 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:
- JavaScript/TypeScript ([Node.js ‰ 12.17.0](https://github.com/Yetics/armkit/blob/master/https://nodejs.org/download/release/latest-v12.x/))
## 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](https://github.com/Yetics/armkit/blob/master/packages/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](https://github.com/Yetics/armkit/blob/master/packages/@armkit/core) 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](https://github.com/Yetics/armkit/blob/master/https://www.npmjs.com/package/@yetics/armkit-core) - A library that allows users to build Azure applications contructs.
- [armkit-resources](https://github.com/Yetics/armkit/blob/master/https://www.npmjs.com/package/@yetics/armkit-resources) - A library for defining Azure resources using programming constructs.
- [armkit-cli](https://github.com/Yetics/armkit/blob/master/https://www.npmjs.com/package/@yetics/armkit-cli) - A CLI that allows users to run commands to initialize, import, and synthesize `Armkit` applications.
## Examples
Some sample `constructs` are in [examples](https://github.com/Yetics/armkit/blob/master/./examples/basic/README.md). This could look like this:
### **`helloArmkit.ts`**
```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](https://github.com/Yetics/armkit/blob/master/./CONTRIBUTING.md).
## Building
Clone the project repository
```bash
git clone https://github.com/Yetics/armkit.git
```
Download dependencies and build node.js
```bash
cd armkit/
yarn install
yarn build
```
Build the `examples/basic` package:
Go to `examples/basic`:
```bash
cd /examples/basic
```
Generate the `armkit cdk` libs:
```bash
yarn generate
```
Translate `typescript` to `node.js`:
```bash
yarn build
```
Render ARM template from CDK:
```bash
node index.js
```
Check out the results:
```bash
az deployment group create --resource-group --template-file @cdk-out/helloarmkit.json
```
## Roadmap
The [Armkit Roadmap project board](https://github.com/Yetics/armkit/blob/master/https://github.com/Yetics/armkit/projects) lets developers know about our upcoming
features and priorities to help them plan how to best leverage `Armkit`and identify opportunities to contribute to the project. See [ROADMAP](https://github.com/Yetics/armkit/blob/master/./ROADMAP.md) for more information and FAQs.
- `Armkit` Roadmap project board: https://github.com/Armkit/armkit/projects/1
- Roadmap: https://github.com/Armkit/armkit/ROADMAP.md
## License
`Armkit` is distributed under the [Apache License, Version 2.0](https://github.com/Yetics/armkit/blob/master/https://www.apache.org/licenses/LICENSE-2.0).
See [LICENSE](https://github.com/Yetics/armkit/blob/master/./LICENSE) and [NOTICE](https://github.com/Yetics/armkit/blob/master/./NOTICE) for more information.
近期下载者:
相关文件:
收藏者: