├── ROADMAP.md ├── packages ├── armkit-cli │ ├── bin │ │ ├── armkit │ │ ├── armkit.ts │ │ └── cmds │ │ │ └── import.ts │ ├── .npmignore │ ├── package.sh │ ├── jest.config.js │ ├── tsconfig.json │ ├── test │ │ └── schema.test.ts │ ├── lib │ │ ├── util.ts │ │ ├── base.ts │ │ └── import.ts │ ├── package.json │ └── schema-config.json ├── schema-generator │ ├── lib │ │ ├── example.env │ │ ├── schemas-repo.ts │ │ ├── schemas-deployment-template.ts │ │ └── schema-config-repo.json │ ├── README.md │ ├── package.json │ └── tsconfig.json ├── @armkit │ └── core │ │ ├── .npmignore │ │ ├── lib │ │ ├── index.ts │ │ ├── arm-element.ts │ │ ├── util.ts │ │ ├── arm-resource.ts │ │ ├── app.ts │ │ └── arm-stack.ts │ │ ├── package.sh │ │ ├── tsconfig.json │ │ └── package.json └── armkit-resources │ ├── .npmignore │ ├── package.sh │ ├── lib │ ├── Aadiam-2017-04-01.ts │ ├── Addons-2018-03-01.ts │ ├── Billing-2020-05-01.ts │ ├── Capacity-2020-10-25.ts │ ├── Consumption-2021-05-01.ts │ ├── GuestConfiguration-2021-01-25.ts │ ├── Management-2021-04-01.ts │ ├── Marketplace-2020-12-01.ts │ ├── KubernetesConfiguration-2021-03-01.ts │ ├── ManagementPartner-2018-02-01.ts │ ├── Support-2020-04-01.ts │ ├── SecurityInsights-2020-01-01.ts │ ├── SerialConsole-2018-05-01.ts │ ├── SoftwarePlan-2019-12-01.ts │ ├── Subscription-2020-09-01.ts │ ├── KeyVaultSecrets-2015-06-01.ts │ ├── ManagedIdentity-2018-11-30.ts │ ├── DBforMySQL-2020-01-01.ts │ ├── DBforPostgreSQL-2020-01-01.ts │ ├── PowerBI-2016-01-29.ts │ ├── HealthBot-2020-12-08.ts │ ├── Email-2015-01-01.ts │ ├── DevSpaces-2019-04-01.ts │ ├── IotCentral-2018-09-01.ts │ ├── MachineLearning-2019-10-01.ts │ ├── DataCatalog-2016-03-30.ts │ ├── WindowsIoT-2019-06-01.ts │ ├── EnterpriseKnowledgeGraph-2018-12-03.ts │ ├── Kubernetes-2021-03-01.ts │ ├── Communication-2020-08-20.ts │ ├── Confluent-2020-03-01.ts │ ├── Logic-2017-07-01.ts │ ├── PolicyInsights-2021-01-01.ts │ ├── AlertsManagement-2021-04-01.ts │ ├── Advisor-2020-01-01.ts │ ├── AzureStack-2017-06-01.ts │ ├── AnalysisServices-2017-08-01.ts │ ├── Maintenance-2021-05-01.ts │ └── ManagedServices-2019-06-01.ts │ ├── tsconfig.json │ ├── package.json │ └── package-lock.json ├── .dockerignore ├── .vsls.json ├── Dockerfile ├── lerna.json ├── CODE_OF_CONDUCT.md ├── examples ├── README.md └── basic │ ├── package.json │ ├── tsconfig.json │ ├── README.md │ └── index.ts ├── .github ├── workflows │ ├── stale.yml │ ├── test-build.yml │ └── release.yaml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── package.json ├── azure-pipelines.yml ├── CONTRIBUTING.md ├── .gitignore └── README.md /ROADMAP.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/armkit-cli/bin/armkit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./armkit.js'); -------------------------------------------------------------------------------- /packages/schema-generator/lib/example.env: -------------------------------------------------------------------------------- 1 | GITHUB_ACCESS_TOKEN= -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | **/.generated 3 | **/*.d.ts 4 | **/*.js 5 | **/node_modules 6 | -------------------------------------------------------------------------------- /packages/armkit-cli/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | 3 | !*.d.ts 4 | !*.js 5 | 6 | test 7 | 8 | dist 9 | coverage -------------------------------------------------------------------------------- /packages/@armkit/core/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | 3 | !*.d.ts 4 | !*.js 5 | 6 | test 7 | 8 | dist 9 | coverage -------------------------------------------------------------------------------- /packages/armkit-resources/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | 3 | !*.d.ts 4 | !*.js 5 | 6 | test 7 | 8 | dist 9 | coverage -------------------------------------------------------------------------------- /packages/armkit-cli/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | bundle=$(npm pack) 5 | rm -rf dist 6 | mkdir -p dist/js 7 | mv ${bundle} dist/js 8 | -------------------------------------------------------------------------------- /packages/@armkit/core/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./app" 2 | export * from "./arm-element" 3 | export * from "./arm-resource" 4 | export * from "./arm-stack" 5 | -------------------------------------------------------------------------------- /packages/@armkit/core/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | bundle=$(npm pack) 5 | rm -rf dist 6 | mkdir -p dist/js 7 | mv ${bundle} dist/js 8 | -------------------------------------------------------------------------------- /packages/armkit-cli/bin/armkit.ts: -------------------------------------------------------------------------------- 1 | import * as yargs from 'yargs'; 2 | 3 | yargs 4 | .commandDir('cmds') 5 | .demandCommand() 6 | .help() 7 | .argv; 8 | -------------------------------------------------------------------------------- /packages/armkit-resources/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | bundle=$(npm pack) 5 | rm -rf dist 6 | mkdir -p dist/js 7 | mv ${bundle} dist/js 8 | -------------------------------------------------------------------------------- /.vsls.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/vsls", 3 | "gitignore":"exclude", 4 | "excludeFiles":[ 5 | ], 6 | "hideFiles": [ 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Aadiam-2017-04-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Addons-2018-03-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/@armkit/core/lib/arm-element.ts: -------------------------------------------------------------------------------- 1 | import { Construct } from "constructs"; 2 | 3 | export class ArmElement extends Construct { 4 | public toArm(): any { 5 | return { }; 6 | } 7 | } -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Billing-2020-05-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Capacity-2020-10-25.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Consumption-2021-05-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/GuestConfiguration-2021-01-25.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Management-2021-04-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Marketplace-2020-12-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/KubernetesConfiguration-2021-03-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/ManagementPartner-2018-02-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Support-2020-04-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/SecurityInsights-2020-01-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/SerialConsole-2018-05-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/SoftwarePlan-2019-12-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Subscription-2020-09-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # specify the node base image with your desired version node: 2 | FROM node:12 3 | 4 | COPY . /app 5 | WORKDIR /app 6 | 7 | RUN yarn install 8 | RUN yarn build 9 | 10 | RUN cd examples/basic && yarn generate 11 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "examples/*", 4 | "packages/*", 5 | "packages/@armkit/*", 6 | "packages/schema-generator/*" 7 | ], 8 | "npmClient": "yarn", 9 | "useWorkspaces": true, 10 | "version": "0.15.0" 11 | } 12 | -------------------------------------------------------------------------------- /packages/armkit-cli/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "roots": [ 3 | "/test" 4 | ], 5 | testMatch: ['**/*.test.ts', '**/*.test.tsx'], 6 | "transform": { 7 | "^.+\\.tsx?$": "ts-jest" 8 | }, 9 | moduleFileExtensions: [ 10 | "js", 11 | "ts", 12 | "tsx" 13 | ], 14 | } 15 | -------------------------------------------------------------------------------- /packages/schema-generator/README.md: -------------------------------------------------------------------------------- 1 | # How-to 2 | 3 | To run the generator: 4 | 5 | 1. Build the package 6 | 7 | ```shell 8 | cd lib 9 | yarn build 10 | ``` 11 | 12 | 2. Run the generated `schemas-repo.js` script passing the output file name as a parameter, for example: 13 | 14 | ```shell 15 | node schemas-repo.js schema-config-repo.js 16 | ``` 17 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of 4 | Conduct](https://opensource.microsoft.com/codeofconduct/). 5 | For more information see the [Code of Conduct 6 | FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 7 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) 8 | with any additional questions or comments. 9 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Armkit Examples 2 | 3 | 4 | ## Building a sample 5 | 6 | - Go to `~/armkit/examples/basic` 7 | - Generate cdk libs with `yarn generate` 8 | - Translate to node.js: `yarn build` 9 | - Create the template `node index.js` 10 | - You are ready to deploy: 11 | 12 | ```shell 13 | ~/armkit$ az deployment group create --resource-group rg-your-resourcegroup --template-file cdk.out/helloarmkit.json 14 | ``` 15 | -------------------------------------------------------------------------------- /packages/schema-generator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "armkit-schema-generator", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "lib/schemas-repo.js", 6 | "scripts": { 7 | "build": "tsc", 8 | "watch": "tsc -w", 9 | "lint": "eslint . --ext .ts", 10 | "test": "jest --passWithNoTests", 11 | "package": "./package.sh" 12 | }, 13 | "license": "Apache-2.0", 14 | "dependencies": { 15 | "dotenv": "^9.0.2", 16 | "octonode": "^0.10.2" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Mark stale issues and pull requests 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | 7 | jobs: 8 | stale: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/stale@v1 14 | with: 15 | repo-token: ${{ secrets.GITHUB_TOKEN }} 16 | stale-issue-message: 'Stale issue message' 17 | stale-pr-message: 'Stale pull request message' 18 | stale-issue-label: 'no-issue-activity' 19 | stale-pr-label: 'no-pr-activity' 20 | days-before-stale: 30 21 | days-before-close: 5 22 | -------------------------------------------------------------------------------- /packages/@armkit/core/lib/util.ts: -------------------------------------------------------------------------------- 1 | function isObject(item: any) { 2 | return (item && typeof item === 'object' && !Array.isArray(item)); 3 | } 4 | 5 | export function deepMerge(target: any, ...sources: any[]): any { 6 | if (!sources.length) return target; 7 | const source = sources.shift(); 8 | 9 | if (isObject(target) && isObject(source)) { 10 | for (const key in source) { 11 | if (isObject(source[key])) { 12 | if (!target[key]) Object.assign(target, { [key]: {} }); 13 | deepMerge(target[key], source[key]); 14 | } else { 15 | Object.assign(target, { [key]: source[key] }); 16 | } 17 | } 18 | } 19 | 20 | return deepMerge(target, ...sources); 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /packages/armkit-resources/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "alwaysStrict": true, 4 | "charset": "utf8", 5 | "declaration": true, 6 | "experimentalDecorators": true, 7 | "inlineSourceMap": true, 8 | "inlineSources": true, 9 | "lib": [ 10 | "es2018" 11 | ], 12 | "module": "CommonJS", 13 | "noEmitOnError": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "resolveJsonModule": true, 18 | "stripInternal": true, 19 | "target": "ES2018" 20 | }, 21 | "include": [ 22 | "**/*.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules" 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /packages/schema-generator/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "alwaysStrict": true, 4 | "charset": "utf8", 5 | "declaration": true, 6 | "experimentalDecorators": true, 7 | "inlineSourceMap": true, 8 | "inlineSources": true, 9 | "lib": [ 10 | "es2018" 11 | ], 12 | "module": "CommonJS", 13 | "noEmitOnError": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitReturns": true, 16 | "noImplicitThis": true, 17 | "resolveJsonModule": true, 18 | "stripInternal": true, 19 | "target": "ES2018" 20 | }, 21 | "include": [ 22 | "**/*.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules" 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /examples/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@examples/basic", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "if [ -d .generated ]; then tsc; fi", 8 | "watch": "tsc -w", 9 | "lint": "eslint . --ext .ts", 10 | "test": "yarn lint && echo \"Error: no test specified\" && exit 1", 11 | "generate": "armkit generate", 12 | "fullchain": "yarn generate && yarn build && node index.js" 13 | }, 14 | "keywords": [], 15 | "author": "", 16 | "license": "Apache-2.0", 17 | "dependencies": { 18 | "@yetics/armkit-core": "0.0.0", 19 | "tslint": "^6.1.3", 20 | "typescript": "^3.8.3" 21 | }, 22 | "devDependencies": { 23 | "armkit-cli": "0.0.0" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/@armkit/core/lib/arm-resource.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Construct } from 'constructs' 3 | import { ArmElement } from './arm-element'; 4 | 5 | interface ArmResourceProps { 6 | armResourceType: string 7 | } 8 | 9 | export abstract class ArmResource extends ArmElement { 10 | public readonly armResourceType: string; 11 | protected readonly _armProperties: any; 12 | 13 | constructor(scope: Construct, id: string, props: ArmResourceProps) { 14 | super(scope, id) 15 | 16 | this.armResourceType = props.armResourceType; 17 | delete props.armResourceType 18 | this._armProperties = props || {}; 19 | } 20 | 21 | // protected abstract synthesizeAttributes(): { [name: string]: any }; 22 | 23 | public toArm(): any { 24 | return Object.assign({}, this._armProperties) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "compilerOptions": { 4 | "alwaysStrict": true, 5 | "charset": "utf8", 6 | "declaration": true, 7 | "experimentalDecorators": true, 8 | "inlineSourceMap": true, 9 | "inlineSources": true, 10 | "lib": [ 11 | "es2018" 12 | ], 13 | "module": "CommonJS", 14 | "noEmitOnError": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "resolveJsonModule": true, 22 | "strict": true, 23 | "strictNullChecks": true, 24 | "strictPropertyInitialization": true, 25 | "stripInternal": true, 26 | "target": "ES2018" 27 | }, 28 | "include": [ 29 | "**/*.ts" 30 | ], 31 | "exclude": [ 32 | "node_modules" 33 | ] 34 | } -------------------------------------------------------------------------------- /packages/@armkit/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "alwaysStrict": true, 4 | "charset": "utf8", 5 | "declaration": true, 6 | "experimentalDecorators": true, 7 | "inlineSourceMap": true, 8 | "inlineSources": true, 9 | "lib": [ 10 | "es2018" 11 | ], 12 | "module": "CommonJS", 13 | "noEmitOnError": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitAny": true, 16 | "noImplicitReturns": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "resolveJsonModule": true, 21 | "strict": true, 22 | "strictNullChecks": true, 23 | "strictPropertyInitialization": true, 24 | "stripInternal": true, 25 | "target": "ES2018" 26 | }, 27 | "include": [ 28 | "**/*.ts" 29 | ], 30 | "exclude": [ 31 | "node_modules", 32 | "**/*.d.ts" 33 | ], 34 | } 35 | -------------------------------------------------------------------------------- /packages/armkit-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "alwaysStrict": true, 4 | "charset": "utf8", 5 | "declaration": true, 6 | "experimentalDecorators": true, 7 | "inlineSourceMap": true, 8 | "inlineSources": true, 9 | "lib": [ 10 | "es2018" 11 | ], 12 | "module": "CommonJS", 13 | "noEmitOnError": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitAny": true, 16 | "noImplicitReturns": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "resolveJsonModule": true, 21 | "strict": true, 22 | "strictNullChecks": true, 23 | "strictPropertyInitialization": true, 24 | "stripInternal": true, 25 | "target": "ES2018" 26 | }, 27 | "include": [ 28 | "**/*.ts" 29 | ], 30 | "exclude": [ 31 | "node_modules", 32 | "**/*.d.ts" 33 | ], 34 | } 35 | -------------------------------------------------------------------------------- /packages/armkit-cli/bin/cmds/import.ts: -------------------------------------------------------------------------------- 1 | import * as yargs from 'yargs'; 2 | import { ImportArmSchema } from '../../lib/import'; 3 | import { Language } from '../../lib/base'; 4 | 5 | class Command implements yargs.CommandModule { 6 | public readonly command = 'generate'; 7 | public readonly describe = 'Generates typed constructs for ARM templates'; 8 | public readonly aliases = [ 'gen', 'import' ]; 9 | 10 | public readonly builder = (args: yargs.Argv) => args 11 | .option('output', { type: 'string' as 'string', desc: 'output directory', default: '.generated', alias: 'o' }) 12 | .option('input', { type: 'string' as 'string', desc: 'schema input file', alias: 'i' }); 13 | 14 | public async handler(argv: any) { 15 | const importer = new ImportArmSchema() 16 | importer.import({outdir: argv.output, targetLanguage: Language.TYPESCRIPT}) 17 | } 18 | } 19 | 20 | module.exports = new Command(); 21 | -------------------------------------------------------------------------------- /examples/basic/README.md: -------------------------------------------------------------------------------- 1 | # Example for Azure based on Typescript 2 | 3 | This is based on the provided examples for Azure 4 | 5 | ## Usage 6 | 7 | Install project dependencies 8 | 9 | ```shell 10 | yarn install 11 | ``` 12 | 13 | Generate CDK for Azure constructs used in the project. 14 | 15 | ```bash 16 | yarn generate 17 | ``` 18 | 19 | You can now edit the `index.ts` file if you want to modify any code. 20 | 21 | Make sure to run az login on the shell where this will run. Alternatively, put client id and secret in configuration for automation scenarios. 22 | 23 | Generate Azure Temlate configuration 24 | 25 | ```bash 26 | yarn build 27 | node index.js 28 | ``` 29 | 30 | The above command will create a folder called `cdktf.out` that contains all Terraform JSON configuration that was generated. 31 | 32 | See changes `armkit diff` and deploy via `armkit deploy`. 33 | 34 | When you're done run `armkit destroy`. 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@examples/typescript-basic", 3 | "version": "0.0.0", 4 | "main": "index.js", 5 | "types": "index.ts", 6 | "private": true, 7 | "scripts": { 8 | "bump": "tools/bump.sh", 9 | "build": "lerna run --scope armkit* --scope @yetics/* build", 10 | "examples:basic:integration": "lerna run --scope @examples/* fullchain", 11 | "test": "lerna run --scope armkit* test", 12 | "package": "lerna run package", 13 | "release": "tools/release.sh", 14 | "lint": "eslint packages/armkit-cli", 15 | 16 | "dist-clean": "lerna run dist-clean --stream && rm -rf dist" 17 | }, 18 | "engines": { 19 | "node": ">=10.12" 20 | }, 21 | "author": { 22 | "name": "Armkit", 23 | "url": "https://armkit.dev" 24 | }, 25 | "license": "Apache-2.0", 26 | "workspaces": { 27 | "packages": [ 28 | "packages/*", 29 | "packages/@armkit/*", 30 | "examples/*", 31 | "examples/basic/*" 32 | 33 | ] 34 | }, 35 | "devDependencies": { 36 | "jsii-release": "^0.1.5", 37 | "lerna": "^3.20.2", 38 | "standard-version": "^7.1.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /.github/workflows/test-build.yml: -------------------------------------------------------------------------------- 1 | # Starter GH Action 2 | name: Build 3 | on: 4 | # Trigger the workflow on push or pull request, 5 | # but only for the development branch 6 | push: 7 | branches: 8 | - main 9 | - development 10 | pull_request: 11 | branches: 12 | - main 13 | - development 14 | 15 | jobs: 16 | build: 17 | runs-on: ubuntu-latest 18 | 19 | steps: 20 | - uses: actions/checkout@v2 21 | - name: Get yarn cache directory path 22 | id: yarn-cache-dir-path 23 | run: echo "::set-output name=dir::$(yarn cache dir)" 24 | - uses: actions/cache@v2 25 | id: yarn-cache # use this to check for 'cache-hit' 26 | with: 27 | path: ${{ steps.yarn-cache-dir-path.outputs.dir }} 28 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.ock') }} 29 | restore-keys: | 30 | ${{ runner.os }}-yarn- 31 | - name: installing dependencies 32 | run: | 33 | yarn install 34 | - name: compile 35 | run: | 36 | yarn build 37 | - name: test 38 | run: | 39 | yarn test 40 | - name: build_examples 41 | run: | 42 | yarn examples:basic:integration 43 | -------------------------------------------------------------------------------- /packages/armkit-cli/test/schema.test.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as os from 'os'; 3 | import * as path from 'path'; 4 | import { ImportArmSchema } from '../lib/import'; 5 | import { Language } from '../lib/base' 6 | 7 | // Validates the ability to import a given schema into Typescript. 8 | const importerTest = async function (schemaConfig: string) { 9 | const serviceName = getServiceName(schemaConfig) 10 | const version = schemaConfig.split('/').shift() 11 | const workdir = fs.mkdtempSync(path.join(os.tmpdir(), serviceName + '.test')); 12 | 13 | const importer = new ImportArmSchema(`["` + schemaConfig + `"]`); 14 | 15 | await importer.import({ outdir: workdir, targetLanguage: Language.TYPESCRIPT }) 16 | const output = fs.readFileSync(path.join(workdir, serviceName.replace('.', '') + `-` + version + `.ts`), 'utf-8'); 17 | expect(output).toMatchSnapshot(); 18 | } 19 | 20 | function getServiceName(schema: string): string { 21 | const [, fqn] = schema.split('/') 22 | const name = fqn.split('.').slice(1).join('') 23 | return name 24 | } 25 | // Load the list of services from schema-config.json. 26 | const serviceList = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'schema-config.json')).toString()) as string[] 27 | test.each(serviceList)('%s.test', importerTest); 28 | -------------------------------------------------------------------------------- /packages/@armkit/core/lib/app.ts: -------------------------------------------------------------------------------- 1 | import { Construct, Node } from 'constructs'; 2 | import fs = require('fs'); 3 | 4 | export interface AppOptions { 5 | /** 6 | * The directory to output Terraform resources. 7 | * 8 | * @default - ARMKIT_OUTDIR if defined, otherwise "cdk.out" 9 | */ 10 | readonly outdir?: string; 11 | readonly stackTraces?: boolean; 12 | } 13 | /** 14 | * Represents a armkit application. 15 | */ 16 | export class App extends Construct { 17 | /** 18 | * The output directory into which resources will be synthesized. 19 | */ 20 | public readonly outdir: string; 21 | 22 | /** 23 | * The stack which will be synthesized. If not set, all stacks will be synthesized. 24 | */ 25 | public readonly targetStackId: string | undefined 26 | 27 | /** 28 | * Defines an app 29 | * @param options configuration options 30 | */ 31 | constructor(options: AppOptions = {}) { 32 | super(undefined as any, ''); 33 | this.outdir = process.env.ARMKIT_OUTDIR ?? options.outdir ?? 'cdk.out'; 34 | this.targetStackId = process.env.ARMKIT_TARGET_STACK_ID 35 | } 36 | 37 | /** 38 | * Synthesizes all resources to the output directory 39 | */ 40 | public synth(): void { 41 | if (!fs.existsSync(this.outdir)) { 42 | fs.mkdirSync(this.outdir); 43 | } 44 | 45 | Node.of(this).synthesize({ 46 | outdir: this.outdir 47 | }); 48 | } 49 | } -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Package and Publish 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | package_and_publish: 7 | name: Package and Publish 8 | runs-on: ubuntu-latest 9 | permissions: 10 | contents: read 11 | packages: write 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Package 15 | run: | 16 | yarn package 17 | - uses: actions/setup-node@v2 18 | with: 19 | node-version: '12.x' 20 | registry-url: 'https://npm.pkg.github.com' 21 | - name: Publish to GitHub 22 | run: | 23 | version=$(node -p 'require("./package.json").version') 24 | yarn publish --registry=https://npm.pkg.github.com dist/js/yetics-armkit-core-${version}.tgz 25 | working-directory: packages/@armkit/core 26 | env: 27 | NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 | - name: Reset .npmrc 29 | run: rm -f ${RUNNER_TEMP}/.npmrc 30 | - uses: actions/setup-node@v2 31 | with: 32 | node-version: '12.x' 33 | registry-url: 'https://registry.npmjs.org' 34 | - name: Publish to NPM 35 | run: | 36 | version=$(node -p 'require("./package.json").version') 37 | yarn publish --registry=https://registry.npmjs.org dist/js/yetics-armkit-core-${version}.tgz 38 | working-directory: packages/@armkit/core 39 | env: 40 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 41 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Starter pipeline 2 | # Start with a minimal pipeline that you can customize to build and deploy your code. 3 | # Add steps that build, run tests, deploy, and more: 4 | # https://aka.ms/yaml 5 | 6 | trigger: 7 | - development 8 | 9 | jobs: 10 | - job: armkit 11 | timeoutInMinutes: 10 12 | pool: 13 | vmImage: 'ubuntu-18.04' 14 | steps: 15 | # Node.js tool installer 16 | # Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH 17 | - task: NodeTool@0 18 | inputs: 19 | versionSpec: '13.x' 20 | checkLatest: true 21 | 22 | # yarn install, build packages 23 | - bash: | 24 | yarn install 25 | displayName: 'Yarn install' 26 | 27 | # yarn build packages/@armkit/core 28 | - bash: | 29 | yarn build 30 | workingDirectory: packages/@armkit/core 31 | displayName: 'Yarn build @armkit/core' 32 | 33 | # yarn build armkit-cli 34 | - bash: | 35 | yarn build 36 | workingDirectory: packages/armkit-cli 37 | displayName: 'Yarn build armkit-cli' 38 | 39 | # yarn test run for amkit-cli 40 | - bash: | 41 | yarn test 42 | displayName: 'Run yarn test' 43 | workingDirectory: packages/armkit-cli 44 | 45 | # yarn build examples 46 | - bash: | 47 | yarn generate 48 | yarn build 49 | node index.js 50 | workingDirectory: examples/basic 51 | displayName: 'Yarn build examples' 52 | -------------------------------------------------------------------------------- /packages/armkit-cli/lib/util.ts: -------------------------------------------------------------------------------- 1 | import * as https from 'https'; 2 | import { spawn, SpawnOptions } from 'child_process'; 3 | import * as fs from 'fs-extra'; 4 | import * as os from 'os'; 5 | import * as path from 'path'; 6 | 7 | export async function shell(program: string, args: string[] = [], options: SpawnOptions = { }) { 8 | return new Promise((ok, ko) => { 9 | const child = spawn(program, args, { stdio: 'inherit', ...options }); 10 | child.once('error', ko); 11 | child.once('exit', code => { 12 | if (code === 0) { return ok(); } 13 | else { return ko(new Error(`non-zero exit code ${code}`)); } 14 | }); 15 | }); 16 | } 17 | 18 | export async function withTempDir(dirname: string, closure: () => Promise) { 19 | const prevdir = process.cwd(); 20 | const parent = await fs.mkdtemp(path.join(os.tmpdir(), 'cdk8s.')); 21 | const workdir = path.join(parent, dirname); 22 | await fs.mkdirp(workdir); 23 | try { 24 | process.chdir(workdir); 25 | await closure(); 26 | } finally { 27 | process.chdir(prevdir); 28 | await fs.remove(parent); 29 | } 30 | } 31 | 32 | export async function httpsGet(url: string): Promise { 33 | return new Promise((ok, ko) => { 34 | const req = https.get(url, res => { 35 | if (res.statusCode !== 200) { 36 | throw new Error(`${res.statusMessage}: ${url}`); 37 | } 38 | const data = new Array(); 39 | res.on('data', chunk => data.push(chunk)); 40 | res.once('end', () => ok(Buffer.concat(data).toString('utf-8'))); 41 | res.once('error', ko); 42 | }); 43 | 44 | req.once('error', ko); 45 | req.end(); 46 | }); 47 | } 48 | -------------------------------------------------------------------------------- /packages/@armkit/core/lib/arm-stack.ts: -------------------------------------------------------------------------------- 1 | import { Construct, IConstruct, ISynthesisSession, Node } from 'constructs'; 2 | import * as fs from 'fs'; 3 | import * as path from 'path'; 4 | import { ArmElement } from './arm-element'; 5 | // import { deepMerge } from './util'; 6 | 7 | interface TemplateSchema { 8 | "$schema": string; 9 | contentVersion: string; 10 | apiProfile: string; 11 | parameters: { [key: string]: any }; 12 | variables: { [key: string]: any }; 13 | functions: any[]; 14 | resources: any[]; 15 | outputs: { [key: string]: any }; 16 | } 17 | 18 | export class ArmStack extends Construct { 19 | public readonly artifactFile: string; 20 | 21 | constructor(scope: Construct, id: string) { 22 | super(scope, id); 23 | 24 | this.artifactFile = `${Node.of(this).uniqueId}.json`; 25 | } 26 | 27 | public toArm(): any { 28 | const arm: TemplateSchema = { 29 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 30 | "contentVersion": "0.1.0.0", 31 | "apiProfile": "2018-06-01-profile", 32 | "parameters": {}, 33 | "variables": {}, 34 | "functions": [], 35 | "resources": [], 36 | "outputs": {} 37 | }; 38 | 39 | const visit = (node: IConstruct) => { 40 | if (node instanceof ArmElement) { 41 | arm.resources.push(node.toArm()); 42 | } 43 | 44 | for (const child of Node.of(node).children) { 45 | visit(child); 46 | } 47 | } 48 | 49 | visit(this); 50 | 51 | return arm 52 | } 53 | 54 | public onSynthesize(session: ISynthesisSession) { 55 | const output = path.join(session.outdir, this.artifactFile); 56 | fs.writeFileSync(output, JSON.stringify(this.toArm(), undefined, 2)); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /packages/armkit-resources/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@yetics/armkit-resources", 3 | "version": "0.0.0", 4 | "description": "Azure Cloud Development Kit for Azure contruct resources", 5 | "main": "lib/resources.js", 6 | "scripts": { 7 | "build": "tsc", 8 | "watch": "tsc -w", 9 | "watch-preserve-output": "tsc -w --preserveWatchOutput", 10 | "lint": "eslint . --ext .ts", 11 | "lint:fix": "eslint . --ext .ts --fix", 12 | "test": "yarn lint && jest", 13 | "jest-watch": "jest --watch", 14 | "package": "./package.sh", 15 | "dist-clean": "rm -rf dist", 16 | "generate": "armkit generate --output lib" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/Yetics/armkit.git", 21 | "directory": "packages/@yetics/armkit-resources" 22 | }, 23 | "author": { 24 | "name": "Andreas Heumaier", 25 | "url": "https://armkit.dev" 26 | }, 27 | "keywords": [ 28 | "armkit", 29 | "cdk", 30 | "cloud", 31 | "azure" 32 | ], 33 | "license": "Apache-2.0", 34 | "eslintConfig": { 35 | "parser": "@typescript-eslint/parser", 36 | "plugins": [ 37 | "@typescript-eslint" 38 | ], 39 | "extends": [ 40 | "eslint:recommended", 41 | "plugin:@typescript-eslint/eslint-recommended", 42 | "plugin:@typescript-eslint/recommended", 43 | "plugin:react/recommended" 44 | ], 45 | "rules": { 46 | "@typescript-eslint/no-explicit-any": 0, 47 | "@typescript-eslint/explicit-function-return-type": 0, 48 | "@typescript-eslint/no-use-before-define": 0 49 | }, 50 | "ignorePatterns": [ 51 | "node_modules", 52 | "dist", 53 | "coverage" 54 | ] 55 | }, 56 | "dependencies": { 57 | "@types/node": "^13.13.4", 58 | "constructs": "^3.0.2", 59 | "typescript": "^3.8.3", 60 | "@yetics/armkit-core": "0.0.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/KeyVaultSecrets-2015-06-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.KeyVault/vaults/secrets 7 | * 8 | * @schema Microsoft.KeyVault.vaults_secrets 9 | */ 10 | export class VaultsSecrets extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.KeyVault.vaults_secrets" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: VaultsSecretsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'vaults_secrets', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.KeyVault/vaults/secrets 27 | * 28 | * @schema Microsoft.KeyVault.vaults_secrets 29 | */ 30 | export interface VaultsSecretsOptions { 31 | /** 32 | * @schema Microsoft.KeyVault.vaults_secrets#type 33 | */ 34 | readonly type: string; 35 | 36 | /** 37 | * @schema Microsoft.KeyVault.vaults_secrets#apiVersion 38 | */ 39 | readonly apiVersion?: string; 40 | 41 | /** 42 | * @schema Microsoft.KeyVault.vaults_secrets#properties 43 | */ 44 | readonly properties: MicrosoftKeyVaultVaultsSecretsProperties; 45 | 46 | } 47 | 48 | /** 49 | * @schema MicrosoftKeyVaultVaultsSecretsProperties 50 | */ 51 | export interface MicrosoftKeyVaultVaultsSecretsProperties { 52 | /** 53 | * Secret value 54 | * 55 | * @schema MicrosoftKeyVaultVaultsSecretsProperties#value 56 | */ 57 | readonly value: string; 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /packages/@armkit/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@yetics/armkit-core", 3 | "version": "0.0.0", 4 | "description": "Azure Cloud Development Kit for Azure", 5 | "main": "lib/index.js", 6 | "publishConfig": { 7 | "access": "public" 8 | }, 9 | "scripts": { 10 | "build": "tsc", 11 | "watch": "tsc -w", 12 | "watch-preserve-output": "tsc -w --preserveWatchOutput", 13 | "lint": "eslint . --ext .ts", 14 | "lint:fix": "eslint . --ext .ts --fix", 15 | "test": "yarn lint && jest", 16 | "jest-watch": "jest --watch", 17 | "package": "./package.sh", 18 | "dist-clean": "rm -rf dist" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git://github.com/Yetics/armkit.git", 23 | "directory": "packages/@yetics/armkit-core" 24 | }, 25 | "author": { 26 | "name": "Andreas Heumaier", 27 | "url": "https://armkit.dev" 28 | }, 29 | "keywords": [ 30 | "armkit", 31 | "cdk", 32 | "cloud", 33 | "azure" 34 | ], 35 | "license": "Apache-2.0", 36 | "jest": { 37 | "collectCoverage": true, 38 | "moduleFileExtensions": [ 39 | "js" 40 | ] 41 | }, 42 | "eslintConfig": { 43 | "parser": "@typescript-eslint/parser", 44 | "plugins": [ 45 | "@typescript-eslint" 46 | ], 47 | "extends": [ 48 | "eslint:recommended", 49 | "plugin:@typescript-eslint/eslint-recommended", 50 | "plugin:@typescript-eslint/recommended", 51 | "plugin:react/recommended" 52 | ], 53 | "rules": { 54 | "@typescript-eslint/no-explicit-any": 0, 55 | "@typescript-eslint/explicit-function-return-type": 0, 56 | "@typescript-eslint/no-use-before-define": 0 57 | }, 58 | "ignorePatterns": [ 59 | "node_modules", 60 | "dist", 61 | "coverage" 62 | ] 63 | }, 64 | "dependencies": { 65 | "@types/node": "^13.13.4", 66 | "constructs": "^3.0.2", 67 | "typescript": "^3.8.3", 68 | "yargs": "^15.1.0" 69 | }, 70 | "devDependencies": { 71 | "@typescript-eslint/eslint-plugin": "^2.22.0", 72 | "@typescript-eslint/parser": "^2.22.0", 73 | "jest": "^25.1.0" 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to the Azure Cloud Development Kit (CDK) 2 | 3 | # Contributing to the Azure Cloud Development Kit (CDK) 4 | 5 | - [Contributing to the Azure Cloud Development Kit (CDK)](#contributing-to-the-azure-cloud-development-kit-cdk) 6 | - [Summary](#summary) 7 | - [Requirements](#requirements) 8 | - [Building](#building) 9 | - [Building a sample](#building-a-sample) 10 | - [Running tests](#running-tests) 11 | 12 | ## Summary 13 | Thanks for your interest in contributing to the AZURE CDK! ❤️ 14 | 15 | This document describes how to set up a development environment and submit your contributions. Please read it carefully 16 | and let us know if it's not up-to-date (even better, submit a PR with your corrections ;-)). 17 | 18 | ## Requirements 19 | 20 | - NodeJS >= 12.17.0 21 | - Yarn 22 | - Lerna 23 | 24 | ## Building 25 | 26 | Clone the project repository 27 | 28 | ```bash 29 | git clone https://github.com/Yetics/armkit.git 30 | ``` 31 | 32 | Download dependencies and build `node.js`: 33 | 34 | ```bash 35 | cd armkit/ 36 | yarn install 37 | yarn build 38 | ``` 39 | 40 | ## Building a sample 41 | 42 | `armkit` is a typescript core that translates the JSON Azure API schema definition to typescript code. 43 | 44 | To define which API we going to translate we use either the `SCHEMA_DEFINITION_URL` or `packages/armkit-cli/schema-config.json` to specify targets. 45 | 46 | Here is an example: 47 | 48 | ```shell 49 | ~/armkit/packages/armkit-cli$ SCHEMA_DEFINITION_URL=https://schema.management.azure.com/schemas/2018-06-01/Microsoft.DataFactory.json armkit generate 50 | ``` 51 | 52 | Triggering this process we call a `yarn generate` script section from `packages.json`. So we can call `yarn build && yarn generate` in `packages/armkit-cli` 53 | resulting in a `.generated` folder containing the typescript libraries. 54 | 55 | - Go to `examples/basic` 56 | - Create the template `node index.js` 57 | - You are ready to deploy: 58 | 59 | ```shell 60 | ~/armkit$ az deployment group create --resource-group rg-your-resourcegroup --template-file cdk.out/helloarmkit.json 61 | ``` 62 | 63 | ## Running tests 64 | 65 | ```shell 66 | ~$ yarn test 67 | ``` 68 | -------------------------------------------------------------------------------- /packages/armkit-cli/lib/base.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs-extra'; 2 | import * as path from 'path'; 3 | import { CodeMaker } from 'codemaker'; 4 | 5 | export enum Language { 6 | TYPESCRIPT = 'typescript', 7 | PYTHON = 'python', 8 | DOTNET = 'dotnet', 9 | JAVA = 'java', 10 | } 11 | 12 | export const LANGUAGES = [ Language.TYPESCRIPT, Language.PYTHON ]; 13 | 14 | export interface ImportOptions { 15 | readonly targetLanguage: Language; 16 | readonly outdir: string; 17 | } 18 | 19 | export interface SchemaConfig { 20 | name: string; 21 | version: string; 22 | downloadUrl: string; 23 | } 24 | 25 | export abstract class ImportBase { 26 | protected abstract generateTypeScript(code: CodeMaker, config?: SchemaConfig): Promise; 27 | public readonly schemaConfig: SchemaConfig[]; 28 | 29 | constructor(schemaConfig?: string) { 30 | this.schemaConfig = this.getSchemaConfig(schemaConfig); 31 | } 32 | 33 | public getSchemaConfig(schemaConfig?: string): SchemaConfig[] { 34 | const baseUrl = "https://schema.management.azure.com/schemas" 35 | const config = JSON.parse(schemaConfig || fs.readFileSync(path.join(__dirname, '..', 'schema-config.json')).toString()) as string[] 36 | 37 | return config.map(value => { 38 | const [version, fqn] = value.split('/') 39 | const name = fqn.split('.').slice(1).join('') 40 | const url = `${baseUrl}/${version}/${fqn}.json` 41 | 42 | return { 43 | version, 44 | name, 45 | downloadUrl: url 46 | } as SchemaConfig 47 | }) 48 | } 49 | 50 | public async import(options: ImportOptions) { 51 | const code = new CodeMaker(); 52 | 53 | const outdir = path.resolve(options.outdir); 54 | await fs.mkdirp(outdir); 55 | const isTypescript = options.targetLanguage === Language.TYPESCRIPT 56 | 57 | for (const config of this.schemaConfig) { 58 | const fileName = `${config.name}-${config.version}.ts`; 59 | code.openFile(fileName); 60 | code.indentation = 2; 61 | await this.generateTypeScript(code, config); 62 | code.closeFile(fileName); 63 | 64 | if (isTypescript) { 65 | await code.save(outdir); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /packages/armkit-cli/lib/import.ts: -------------------------------------------------------------------------------- 1 | import { CodeMaker } from 'codemaker'; 2 | import { JSONSchema4 } from 'json-schema'; 3 | import { TypeGenerator } from './type-generator'; 4 | import { ImportBase, SchemaConfig } from './base'; 5 | import { httpsGet } from './util'; 6 | 7 | export class ImportArmSchema extends ImportBase { 8 | protected async generateTypeScript(code: CodeMaker, config: SchemaConfig) { 9 | const schema = await downloadSchema(config.downloadUrl); 10 | this.make(code, schema) 11 | } 12 | 13 | public async make(code: CodeMaker, schema: JSONSchema4) { 14 | code.line(`// generated by armkit`); 15 | code.line(`import { ArmResource } from '@yetics/armkit-core';`); 16 | code.line(`import { Construct } from 'constructs';`); 17 | code.line(); 18 | 19 | const typeGenerator = new TypeGenerator(schema); 20 | const topLevelObjects = findApiObjectDefinitions(schema) 21 | 22 | for (const o of topLevelObjects) { 23 | this.emitConstructForApiObject(typeGenerator, o); 24 | } 25 | 26 | typeGenerator.generate(code); 27 | } 28 | 29 | private emitConstructForApiObject(typeGenerator: TypeGenerator, apidef: DeploymentObjectDefinition) { 30 | typeGenerator.emitConstruct({ 31 | fqn: `${apidef.namespace}.${apidef.name}`, 32 | kind: apidef.name, 33 | schema: apidef.schema 34 | }); 35 | } 36 | } 37 | 38 | export function findApiObjectDefinitions(schema: JSONSchema4): DeploymentObjectDefinition[] { 39 | const list: DeploymentObjectDefinition[] = []; 40 | 41 | for (const [typename, def] of Object.entries(schema.resourceDefinitions as JSONSchema4 || {})) { 42 | list.push({ 43 | namespace: schema.title || 'undefined', 44 | name: typename, 45 | schema: def 46 | }); 47 | } 48 | 49 | return list 50 | } 51 | 52 | interface DeploymentObjectName { 53 | namespace: string; 54 | name: string; 55 | } 56 | 57 | interface DeploymentObjectDefinition extends DeploymentObjectName { 58 | schema: JSONSchema4; 59 | } 60 | 61 | async function downloadSchema(url: string) { 62 | const SCHEMA_URL = process.env.SCHEMA_DEFINITION_URL || url; 63 | const output = await httpsGet(SCHEMA_URL) 64 | return JSON.parse(output.toString()) as JSONSchema4; 65 | } 66 | -------------------------------------------------------------------------------- /examples/basic/index.ts: -------------------------------------------------------------------------------- 1 | import { Construct } from 'constructs'; 2 | import { App, ArmStack } from '@yetics/armkit-core'; 3 | import { 4 | ContainerGroups, ContainerGroupPropertiesOsType, MicrosoftContainerInstanceContainerGroupsType, MicrosoftContainerInstanceContainerGroupsApiVersion 5 | } from './.generated/ContainerInstance-2021-03-01' 6 | import { 7 | Registries, MicrosoftContainerRegistryRegistriesApiVersion, MicrosoftContainerRegistryRegistriesType, SkuName 8 | } from './.generated/ContainerRegistry-2019-05-01' 9 | 10 | export class HelloArmkit extends ArmStack { 11 | constructor(scope: Construct, id: string) { 12 | super(scope, id); 13 | 14 | new ContainerGroups(this, 'MyContainerGroup', { 15 | name: 'azurecdktest', 16 | location: 'westeurope', 17 | apiVersion: MicrosoftContainerInstanceContainerGroupsApiVersion["MicrosoftContainerInstanceContainerGroupsApiVersion_2021_03_01"], 18 | type: MicrosoftContainerInstanceContainerGroupsType.MicrosoftContainerInstanceContainerGroupsType_MICROSOFT_CONTAINER_INSTANCE_CONTAINER_GROUPS, 19 | properties: { 20 | containers: [{ 21 | name: 'ubuntu-server', 22 | properties: { 23 | image: 'ubuntu:18.04', 24 | command: ['sleep infinity'], 25 | resources: { 26 | requests: { 27 | cpu: 1, 28 | memoryInGB: 2 29 | }, 30 | limits: { 31 | cpu: 1, 32 | memoryInGB: 2 33 | } 34 | } 35 | 36 | } 37 | }], 38 | osType: ContainerGroupPropertiesOsType.LINUX, 39 | } 40 | }) 41 | 42 | new Registries(this, 'azurecdktest', { 43 | name: 'azurecdktest', 44 | location: 'westeurope', 45 | apiVersion: MicrosoftContainerRegistryRegistriesApiVersion['MicrosoftContainerRegistryRegistriesApiVersion_2019_05_01'], 46 | type: MicrosoftContainerRegistryRegistriesType.MicrosoftContainerRegistryRegistriesType_MICROSOFT_CONTAINER_REGISTRY_REGISTRIES, 47 | sku: { 48 | name: SkuName.BASIC 49 | }, 50 | properties: { 51 | adminUserEnabled: false 52 | } 53 | }) 54 | } 55 | } 56 | 57 | const app = new App({ outdir: 'cdk.out' }); 58 | new HelloArmkit(app, 'hello-armkit'); 59 | app.synth(); -------------------------------------------------------------------------------- /packages/armkit-cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "armkit-cli", 3 | "version": "0.0.0", 4 | "description": "CDK for Azure CLI", 5 | "bin": { 6 | "armkit": "bin/armkit" 7 | }, 8 | "scripts": { 9 | "build": "tsc", 10 | "watch": "tsc -w", 11 | "watch-preserve-output": "tsc -w --preserveWatchOutput", 12 | "lint": "eslint . --ext .ts", 13 | "lint:fix": "eslint . --ext .ts --fix", 14 | "test": "yarn lint && jest", 15 | "jest-watch": "jest --watch", 16 | "package": "./package.sh", 17 | "dist-clean": "rm -rf dist" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git://github.com/Yetics/armkit.git", 22 | "directory": "packages/armkit-cli" 23 | }, 24 | "author": { 25 | "name": "Andreas Heumaier", 26 | "url": "https://armkit.dev" 27 | }, 28 | "keywords": [ 29 | "armkit", 30 | "cdk", 31 | "cloud", 32 | "azure" 33 | ], 34 | "license": "Apache-2.0", 35 | "eslintConfig": { 36 | "parser": "@typescript-eslint/parser", 37 | "plugins": [ 38 | "@typescript-eslint" 39 | ], 40 | "extends": [ 41 | "eslint:recommended", 42 | "plugin:@typescript-eslint/eslint-recommended", 43 | "plugin:@typescript-eslint/recommended" 44 | ], 45 | "rules": { 46 | "@typescript-eslint/no-explicit-any": 0, 47 | "@typescript-eslint/explicit-function-return-type": 0, 48 | "@typescript-eslint/no-use-before-define": 0 49 | }, 50 | "ignorePatterns": [ 51 | "node_modules", 52 | "dist", 53 | "coverage" 54 | ] 55 | }, 56 | "dependencies": { 57 | "@apidevtools/json-schema-ref-parser": "^8.0.0", 58 | "@types/change-case": "^2.3.1", 59 | "@types/json-schema": "^7.0.4", 60 | "@types/node": "^13.7.7", 61 | "@types/yargs": "^15.0.4", 62 | "async-parallel": "^1.2.3", 63 | "change-case": "^4.1.1", 64 | "codemaker": "^1.0.0", 65 | "eslint": "^7.7.0", 66 | "fs": "^0.0.1-security", 67 | "fs-extra": "^8.1.0", 68 | "json-schema": "^0.2.5", 69 | "path": "^0.12.7", 70 | "typescript": "^3.8.3", 71 | "yargs": "^15.1.0" 72 | }, 73 | "devDependencies": { 74 | "@types/fs-extra": "^8.1.0", 75 | "@types/jest": "^26.0.0", 76 | "@typescript-eslint/eslint-plugin": "^2.22.0", 77 | "@typescript-eslint/parser": "^2.22.0", 78 | "jest": "^26.0.0", 79 | "ts-jest": "^26.4.4" 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.generated 2 | .vscode/ 3 | *.d.ts 4 | *.js 5 | 6 | # Created by https://www.gitignore.io/api/node 7 | # Edit at https://www.gitignore.io/?templates=node 8 | 9 | ### Node ### 10 | # Logs 11 | logs 12 | *.log 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | lerna-debug.log* 17 | 18 | # Diagnostic reports (https://nodejs.org/api/report.html) 19 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 20 | 21 | # Runtime data 22 | pids 23 | *.pid 24 | *.seed 25 | *.pid.lock 26 | 27 | # Directory for instrumented libs generated by jscoverage/JSCover 28 | lib-cov 29 | 30 | # Coverage directory used by tools like istanbul 31 | coverage 32 | *.lcov 33 | 34 | # nyc test coverage 35 | .nyc_output 36 | 37 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 38 | .grunt 39 | 40 | # Bower dependency directory (https://bower.io/) 41 | bower_components 42 | 43 | # node-waf configuration 44 | .lock-wscript 45 | 46 | # Compiled binary addons (https://nodejs.org/api/addons.html) 47 | build/Release 48 | 49 | # Dependency directories 50 | node_modules/ 51 | jspm_packages/ 52 | 53 | # TypeScript v1 declaration files 54 | typings/ 55 | 56 | # TypeScript cache 57 | *.tsbuildinfo 58 | 59 | # Optional npm cache directory 60 | .npm 61 | 62 | # Optional eslint cache 63 | .eslintcache 64 | 65 | # Optional REPL history 66 | .node_repl_history 67 | 68 | # Output of 'npm pack' 69 | *.tgz 70 | 71 | # Yarn Integrity file 72 | .yarn-integrity 73 | 74 | # dotenv environment variables file 75 | .env 76 | .env.test 77 | 78 | # parcel-bundler cache (https://parceljs.org/) 79 | .cache 80 | 81 | # next.js build output 82 | .next 83 | 84 | # nuxt.js build output 85 | .nuxt 86 | 87 | # rollup.js default build output 88 | dist/ 89 | 90 | # Uncomment the public line if your project uses Gatsby 91 | # https://nextjs.org/blog/next-9-1#public-directory-support 92 | # https://create-react-app.dev/docs/using-the-public-folder/#docsNav 93 | # public 94 | 95 | # Storybook build outputs 96 | .out 97 | .storybook-out 98 | 99 | # vuepress build output 100 | .vuepress/dist 101 | 102 | # Serverless directories 103 | .serverless/ 104 | 105 | # FuseBox cache 106 | .fusebox/ 107 | 108 | # DynamoDB Local files 109 | .dynamodb/ 110 | 111 | # Temporary folders 112 | tmp/ 113 | temp/ 114 | 115 | # End of https://www.gitignore.io/api/node 116 | 117 | !**/jest.config.js -------------------------------------------------------------------------------- /packages/schema-generator/lib/schemas-repo.ts: -------------------------------------------------------------------------------- 1 | var github = require('octonode'); 2 | require('dotenv').config(); 3 | 4 | class SchemaItem { 5 | name: string; 6 | path: string; 7 | 8 | version: string; 9 | } 10 | 11 | class SchemaRepo { 12 | constructor (accessToken: string) { 13 | var client = github.client(accessToken); 14 | this.RepoClient = client.repo('Azure/azure-resource-manager-schemas'); 15 | } 16 | 17 | async loadVersions() { 18 | let body = await this.RepoClient.contentsAsync('/schemas'); 19 | this.Schemas = (body[0] as SchemaItem[]) 20 | .filter(item => item.name.startsWith('2') && item.name.indexOf('preview') < 0); 21 | this.Schemas.forEach(item => item.version = item.name); 22 | } 23 | 24 | async loadServices() { 25 | for (let i=0; i item.name.split('.').length > 2); // Service names are in the form Microsoft..xxxx.json 30 | 31 | services.forEach(service => { 32 | service.version = schema.name; 33 | 34 | if (!this.Services.has(service.name) || 35 | this.Services.get(service.name).version < service.version) { 36 | this.Services.set(service.name, service); 37 | } 38 | }); 39 | } 40 | } 41 | 42 | serviceList(): string[] { 43 | let result: string[] = []; 44 | 45 | this.Services.forEach((value: SchemaItem, key: string, map) => { 46 | result.push(`${value.version}/${value.name.substring(0, value.name.length-5)}`); 47 | }) 48 | 49 | return result.sort(function(x: string, y: string) : number { 50 | let xName = x.split('/')[1]; 51 | let yName = y.split('/')[1]; 52 | if (xName < yName) return -1; 53 | if (xName > yName) return 1; 54 | return 0; 55 | }); 56 | } 57 | 58 | RepoClient: any; 59 | Schemas: SchemaItem[]; 60 | Services: Map = new Map(); 61 | } 62 | 63 | function writeOutput(fileName: string, data: any) { 64 | let fs = require('fs'); 65 | fs.writeFile( 66 | fileName, 67 | JSON.stringify(data), 68 | '', 69 | (err) => console.log(err)); 70 | } 71 | 72 | function getOutputFileName() : string { 73 | if (process.argv.length > 2) { 74 | return process.argv[2]; 75 | } 76 | return 'out/schema-config-repo.json'; 77 | } 78 | 79 | async function main() { 80 | let schemaRepo = new SchemaRepo(process.env.GITHUB_ACCESS_TOKEN); 81 | await schemaRepo.loadVersions(); 82 | await schemaRepo.loadServices(); 83 | 84 | writeOutput(getOutputFileName(), schemaRepo.serviceList()); 85 | } 86 | 87 | main(); -------------------------------------------------------------------------------- /packages/armkit-resources/lib/ManagedIdentity-2018-11-30.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.ManagedIdentity/userAssignedIdentities 7 | * 8 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities 9 | */ 10 | export class UserAssignedIdentities extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.ManagedIdentity.userAssignedIdentities" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: UserAssignedIdentitiesOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'userAssignedIdentities', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.ManagedIdentity/userAssignedIdentities 27 | * 28 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities 29 | */ 30 | export interface UserAssignedIdentitiesOptions { 31 | /** 32 | * The name of the identity resource. 33 | * 34 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities#name 35 | */ 36 | readonly name: string; 37 | 38 | /** 39 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities#type 40 | */ 41 | readonly type: MicrosoftManagedIdentityUserAssignedIdentitiesType; 42 | 43 | /** 44 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities#apiVersion 45 | */ 46 | readonly apiVersion?: MicrosoftManagedIdentityUserAssignedIdentitiesApiVersion; 47 | 48 | /** 49 | * The Azure region where the identity lives. 50 | * 51 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities#location 52 | */ 53 | readonly location: string; 54 | 55 | /** 56 | * Resource tags 57 | * 58 | * @schema Microsoft.ManagedIdentity.userAssignedIdentities#tags 59 | */ 60 | readonly tags?: { [key: string]: string }; 61 | 62 | } 63 | 64 | export enum MicrosoftManagedIdentityUserAssignedIdentitiesType { 65 | "MicrosoftManagedIdentityUserAssignedIdentitiesType_MICROSOFT_MANAGED_IDENTITY_USER_ASSIGNED_IDENTITIES" = 'Microsoft.ManagedIdentity/userAssignedIdentities', 66 | } 67 | 68 | export enum MicrosoftManagedIdentityUserAssignedIdentitiesApiVersion { 69 | "MicrosoftManagedIdentityUserAssignedIdentitiesApiVersion_2018_11_30" = '2018-11-30', 70 | } 71 | 72 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/DBforMySQL-2020-01-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.DBforMySQL/servers/keys 7 | * 8 | * @schema Microsoft.DBforMySQL.servers_keys 9 | */ 10 | export class ServersKeys extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.DBforMySQL.servers_keys" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ServersKeysOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'servers_keys', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.DBforMySQL/servers/keys 27 | * 28 | * @schema Microsoft.DBforMySQL.servers_keys 29 | */ 30 | export interface ServersKeysOptions { 31 | /** 32 | * @schema Microsoft.DBforMySQL.servers_keys#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftDBforMySqlServersKeysApiVersion; 35 | 36 | /** 37 | * The name of the MySQL Server key to be operated on (updated or created). 38 | * 39 | * @schema Microsoft.DBforMySQL.servers_keys#name 40 | */ 41 | readonly name: string; 42 | 43 | /** 44 | * Properties for a key execution. 45 | * 46 | * @schema Microsoft.DBforMySQL.servers_keys#properties 47 | */ 48 | readonly properties: ServerKeyProperties; 49 | 50 | /** 51 | * @schema Microsoft.DBforMySQL.servers_keys#type 52 | */ 53 | readonly type: MicrosoftDBforMySqlServersKeysType; 54 | 55 | } 56 | 57 | export enum MicrosoftDBforMySqlServersKeysApiVersion { 58 | "MicrosoftDBforMySqlServersKeysApiVersion_2020_01_01" = '2020-01-01', 59 | } 60 | 61 | /** 62 | * Properties for a key execution. 63 | * 64 | * @schema #/definitions/ServerKeyProperties 65 | */ 66 | export interface ServerKeyProperties { 67 | /** 68 | * The key type like 'AzureKeyVault'. 69 | * 70 | * @schema #/definitions/ServerKeyProperties#serverKeyType 71 | */ 72 | readonly serverKeyType: ServerKeyPropertiesServerKeyType; 73 | 74 | /** 75 | * The URI of the key. 76 | * 77 | * @schema #/definitions/ServerKeyProperties#uri 78 | */ 79 | readonly uri?: string; 80 | 81 | } 82 | 83 | export enum MicrosoftDBforMySqlServersKeysType { 84 | "MicrosoftDBforMySqlServersKeysType_MICROSOFT_D_BFOR_MY_SQL_SERVERS_KEYS" = 'Microsoft.DBforMySQL/servers/keys', 85 | } 86 | 87 | export enum ServerKeyPropertiesServerKeyType { 88 | AZURE_KEY_VAULT = 'AzureKeyVault', 89 | } 90 | 91 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/DBforPostgreSQL-2020-01-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.DBforPostgreSQL/servers/keys 7 | * 8 | * @schema Microsoft.DBforPostgreSQL.servers_keys 9 | */ 10 | export class ServersKeys extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.DBforPostgreSQL.servers_keys" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ServersKeysOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'servers_keys', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.DBforPostgreSQL/servers/keys 27 | * 28 | * @schema Microsoft.DBforPostgreSQL.servers_keys 29 | */ 30 | export interface ServersKeysOptions { 31 | /** 32 | * @schema Microsoft.DBforPostgreSQL.servers_keys#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftDBforPostgreSqlServersKeysApiVersion; 35 | 36 | /** 37 | * The name of the PostgreSQL Server key to be operated on (updated or created). 38 | * 39 | * @schema Microsoft.DBforPostgreSQL.servers_keys#name 40 | */ 41 | readonly name: string; 42 | 43 | /** 44 | * Properties for a key execution. 45 | * 46 | * @schema Microsoft.DBforPostgreSQL.servers_keys#properties 47 | */ 48 | readonly properties: ServerKeyProperties; 49 | 50 | /** 51 | * @schema Microsoft.DBforPostgreSQL.servers_keys#type 52 | */ 53 | readonly type: MicrosoftDBforPostgreSqlServersKeysType; 54 | 55 | } 56 | 57 | export enum MicrosoftDBforPostgreSqlServersKeysApiVersion { 58 | "MicrosoftDBforPostgreSqlServersKeysApiVersion_2020_01_01" = '2020-01-01', 59 | } 60 | 61 | /** 62 | * Properties for a key execution. 63 | * 64 | * @schema #/definitions/ServerKeyProperties 65 | */ 66 | export interface ServerKeyProperties { 67 | /** 68 | * The key type like 'AzureKeyVault'. 69 | * 70 | * @schema #/definitions/ServerKeyProperties#serverKeyType 71 | */ 72 | readonly serverKeyType: ServerKeyPropertiesServerKeyType; 73 | 74 | /** 75 | * The URI of the key. 76 | * 77 | * @schema #/definitions/ServerKeyProperties#uri 78 | */ 79 | readonly uri?: string; 80 | 81 | } 82 | 83 | export enum MicrosoftDBforPostgreSqlServersKeysType { 84 | "MicrosoftDBforPostgreSqlServersKeysType_MICROSOFT_D_BFOR_POSTGRE_SQL_SERVERS_KEYS" = 'Microsoft.DBforPostgreSQL/servers/keys', 85 | } 86 | 87 | export enum ServerKeyPropertiesServerKeyType { 88 | AZURE_KEY_VAULT = 'AzureKeyVault', 89 | } 90 | 91 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/PowerBI-2016-01-29.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.PowerBI/workspaceCollections 7 | * 8 | * @schema Microsoft.PowerBI.workspaceCollections 9 | */ 10 | export class WorkspaceCollections extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.PowerBI.workspaceCollections" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: WorkspaceCollectionsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'workspaceCollections', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.PowerBI/workspaceCollections 27 | * 28 | * @schema Microsoft.PowerBI.workspaceCollections 29 | */ 30 | export interface WorkspaceCollectionsOptions { 31 | /** 32 | * @schema Microsoft.PowerBI.workspaceCollections#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftPowerBiWorkspaceCollectionsApiVersion; 35 | 36 | /** 37 | * Azure location 38 | * 39 | * @schema Microsoft.PowerBI.workspaceCollections#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * Power BI Embedded Workspace Collection name 45 | * 46 | * @schema Microsoft.PowerBI.workspaceCollections#name 47 | */ 48 | readonly name: string; 49 | 50 | /** 51 | * @schema Microsoft.PowerBI.workspaceCollections#sku 52 | */ 53 | readonly sku?: AzureSku; 54 | 55 | /** 56 | * @schema Microsoft.PowerBI.workspaceCollections#tags 57 | */ 58 | readonly tags?: MicrosoftPowerBiWorkspaceCollectionsTags; 59 | 60 | /** 61 | * @schema Microsoft.PowerBI.workspaceCollections#type 62 | */ 63 | readonly type: MicrosoftPowerBiWorkspaceCollectionsType; 64 | 65 | } 66 | 67 | export enum MicrosoftPowerBiWorkspaceCollectionsApiVersion { 68 | "MicrosoftPowerBiWorkspaceCollectionsApiVersion_2016_01_29" = '2016-01-29', 69 | } 70 | 71 | /** 72 | * @schema #/definitions/AzureSku 73 | */ 74 | export interface AzureSku { 75 | /** 76 | * SKU name 77 | * 78 | * @schema #/definitions/AzureSku#name 79 | */ 80 | readonly name: AzureSkuName; 81 | 82 | /** 83 | * SKU tier 84 | * 85 | * @schema #/definitions/AzureSku#tier 86 | */ 87 | readonly tier: AzureSkuTier; 88 | 89 | } 90 | 91 | /** 92 | * @schema MicrosoftPowerBiWorkspaceCollectionsTags 93 | */ 94 | export interface MicrosoftPowerBiWorkspaceCollectionsTags { 95 | } 96 | 97 | export enum MicrosoftPowerBiWorkspaceCollectionsType { 98 | "MicrosoftPowerBiWorkspaceCollectionsType_MICROSOFT_POWER_BI_WORKSPACE_COLLECTIONS" = 'Microsoft.PowerBI/workspaceCollections', 99 | } 100 | 101 | export enum AzureSkuName { 102 | "AzureSkuName_S1" = 'S1', 103 | } 104 | 105 | export enum AzureSkuTier { 106 | STANDARD = 'Standard', 107 | } 108 | 109 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/HealthBot-2020-12-08.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.HealthBot/healthBots 7 | * 8 | * @schema Microsoft.HealthBot.healthBots 9 | */ 10 | export class HealthBots extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.HealthBot.healthBots" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: HealthBotsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'healthBots', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.HealthBot/healthBots 27 | * 28 | * @schema Microsoft.HealthBot.healthBots 29 | */ 30 | export interface HealthBotsOptions { 31 | /** 32 | * @schema Microsoft.HealthBot.healthBots#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftHealthBotHealthBotsApiVersion; 35 | 36 | /** 37 | * The geo-location where the resource lives 38 | * 39 | * @schema Microsoft.HealthBot.healthBots#location 40 | */ 41 | readonly location: string; 42 | 43 | /** 44 | * The name of the Bot resource. 45 | * 46 | * @schema Microsoft.HealthBot.healthBots#name 47 | */ 48 | readonly name: MicrosoftHealthBotHealthBotsNamePattern; 49 | 50 | /** 51 | * The properties of a HealthBot. The Health Bot Service is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. 52 | * 53 | * @schema Microsoft.HealthBot.healthBots#properties 54 | */ 55 | readonly properties: HealthBotProperties; 56 | 57 | /** 58 | * The resource model definition representing SKU 59 | * 60 | * @schema Microsoft.HealthBot.healthBots#sku 61 | */ 62 | readonly sku: Sku; 63 | 64 | /** 65 | * Resource tags. 66 | * 67 | * @schema Microsoft.HealthBot.healthBots#tags 68 | */ 69 | readonly tags?: MicrosoftHealthBotHealthBotsTags; 70 | 71 | /** 72 | * @schema Microsoft.HealthBot.healthBots#type 73 | */ 74 | readonly type: MicrosoftHealthBotHealthBotsType; 75 | 76 | } 77 | 78 | export enum MicrosoftHealthBotHealthBotsApiVersion { 79 | "MicrosoftHealthBotHealthBotsApiVersion_2020_12_08" = '2020-12-08', 80 | } 81 | 82 | /** 83 | * @schema MicrosoftHealthBotHealthBotsName 84 | */ 85 | export class MicrosoftHealthBotHealthBotsNamePattern { 86 | public static pattern(value: string): string { 87 | return value; 88 | } 89 | } 90 | 91 | /** 92 | * The properties of a HealthBot. The Health Bot Service is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. 93 | * 94 | * @schema #/definitions/HealthBotProperties 95 | */ 96 | export interface HealthBotProperties { 97 | } 98 | 99 | /** 100 | * The resource model definition representing SKU 101 | * 102 | * @schema #/definitions/Sku 103 | */ 104 | export interface Sku { 105 | /** 106 | * The name of the HealthBot SKU. 107 | * 108 | * @schema #/definitions/Sku#name 109 | */ 110 | readonly name: SkuName; 111 | 112 | } 113 | 114 | /** 115 | * @schema MicrosoftHealthBotHealthBotsTags 116 | */ 117 | export interface MicrosoftHealthBotHealthBotsTags { 118 | } 119 | 120 | export enum MicrosoftHealthBotHealthBotsType { 121 | "MicrosoftHealthBotHealthBotsType_MICROSOFT_HEALTH_BOT_HEALTH_BOTS" = 'Microsoft.HealthBot/healthBots', 122 | } 123 | 124 | export enum SkuName { 125 | "SkuName_F0" = 'F0', 126 | "SkuName_S1" = 'S1', 127 | "SkuName_C0" = 'C0', 128 | } 129 | 130 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Email-2015-01-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * SendGrid resources that user purchases 7 | * 8 | * @schema Sendgrid.Email.accounts 9 | */ 10 | export class Accounts extends ArmResource { 11 | /** 12 | * Defines a "Sendgrid.Email.accounts" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: AccountsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'accounts', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * SendGrid resources that user purchases 27 | * 28 | * @schema Sendgrid.Email.accounts 29 | */ 30 | export interface AccountsOptions { 31 | /** 32 | * Name of the resource 33 | * 34 | * @schema Sendgrid.Email.accounts#name 35 | */ 36 | readonly name: string; 37 | 38 | /** 39 | * @schema Sendgrid.Email.accounts#type 40 | */ 41 | readonly type: string; 42 | 43 | /** 44 | * @schema Sendgrid.Email.accounts#apiVersion 45 | */ 46 | readonly apiVersion?: string; 47 | 48 | /** 49 | * SendGrid plan 50 | * 51 | * @schema Sendgrid.Email.accounts#plan 52 | */ 53 | readonly plan: SendgridEmailAccountsPlan; 54 | 55 | /** 56 | * @schema Sendgrid.Email.accounts#properties 57 | */ 58 | readonly properties: SendgridEmailAccountsProperties; 59 | 60 | } 61 | 62 | /** 63 | * SendGrid plan 64 | * 65 | * @schema SendgridEmailAccountsPlan 66 | */ 67 | export interface SendgridEmailAccountsPlan { 68 | /** 69 | * Plan name 70 | * 71 | * @schema SendgridEmailAccountsPlan#name 72 | */ 73 | readonly name: string; 74 | 75 | /** 76 | * Publisher name 77 | * 78 | * @schema SendgridEmailAccountsPlan#publisher 79 | */ 80 | readonly publisher: string; 81 | 82 | /** 83 | * Plan id 84 | * 85 | * @schema SendgridEmailAccountsPlan#product 86 | */ 87 | readonly product: string; 88 | 89 | /** 90 | * Promotion code 91 | * 92 | * @schema SendgridEmailAccountsPlan#promotionCode 93 | */ 94 | readonly promotionCode?: string; 95 | 96 | } 97 | 98 | /** 99 | * @schema SendgridEmailAccountsProperties 100 | */ 101 | export interface SendgridEmailAccountsProperties { 102 | /** 103 | * The SendGrid account password 104 | * 105 | * @schema SendgridEmailAccountsProperties#password 106 | */ 107 | readonly password: string; 108 | 109 | /** 110 | * True if you want to accept Marketing Emails 111 | * 112 | * @schema SendgridEmailAccountsProperties#acceptMarketingEmails 113 | */ 114 | readonly acceptMarketingEmails: boolean; 115 | 116 | /** 117 | * The user's email address 118 | * 119 | * @schema SendgridEmailAccountsProperties#email 120 | */ 121 | readonly email: string; 122 | 123 | } 124 | 125 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/DevSpaces-2019-04-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.DevSpaces/controllers 7 | * 8 | * @schema Microsoft.DevSpaces.controllers 9 | */ 10 | export class Controllers extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.DevSpaces.controllers" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ControllersOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'controllers', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.DevSpaces/controllers 27 | * 28 | * @schema Microsoft.DevSpaces.controllers 29 | */ 30 | export interface ControllersOptions { 31 | /** 32 | * @schema Microsoft.DevSpaces.controllers#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftDevSpacesControllersApiVersion; 35 | 36 | /** 37 | * Region where the Azure resource is located. 38 | * 39 | * @schema Microsoft.DevSpaces.controllers#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * Name of the resource. 45 | * 46 | * @schema Microsoft.DevSpaces.controllers#name 47 | */ 48 | readonly name: MicrosoftDevSpacesControllersNamePattern; 49 | 50 | /** 51 | * @schema Microsoft.DevSpaces.controllers#properties 52 | */ 53 | readonly properties: ControllerProperties; 54 | 55 | /** 56 | * Model representing SKU for Azure Dev Spaces Controller. 57 | * 58 | * @schema Microsoft.DevSpaces.controllers#sku 59 | */ 60 | readonly sku: Sku; 61 | 62 | /** 63 | * Tags for the Azure resource. 64 | * 65 | * @schema Microsoft.DevSpaces.controllers#tags 66 | */ 67 | readonly tags?: MicrosoftDevSpacesControllersTags; 68 | 69 | /** 70 | * @schema Microsoft.DevSpaces.controllers#type 71 | */ 72 | readonly type: MicrosoftDevSpacesControllersType; 73 | 74 | } 75 | 76 | export enum MicrosoftDevSpacesControllersApiVersion { 77 | "MicrosoftDevSpacesControllersApiVersion_2019_04_01" = '2019-04-01', 78 | } 79 | 80 | /** 81 | * @schema MicrosoftDevSpacesControllersName 82 | */ 83 | export class MicrosoftDevSpacesControllersNamePattern { 84 | public static pattern(value: string): string { 85 | return value; 86 | } 87 | } 88 | 89 | /** 90 | * @schema #/definitions/ControllerProperties 91 | */ 92 | export interface ControllerProperties { 93 | /** 94 | * Credentials of the target container host (base64). 95 | * 96 | * @schema #/definitions/ControllerProperties#targetContainerHostCredentialsBase64 97 | */ 98 | readonly targetContainerHostCredentialsBase64: string; 99 | 100 | /** 101 | * Resource ID of the target container host 102 | * 103 | * @schema #/definitions/ControllerProperties#targetContainerHostResourceId 104 | */ 105 | readonly targetContainerHostResourceId: string; 106 | 107 | } 108 | 109 | /** 110 | * Model representing SKU for Azure Dev Spaces Controller. 111 | * 112 | * @schema #/definitions/Sku 113 | */ 114 | export interface Sku { 115 | /** 116 | * The name of the SKU for Azure Dev Spaces Controller. 117 | * 118 | * @schema #/definitions/Sku#name 119 | */ 120 | readonly name: SkuName; 121 | 122 | /** 123 | * The tier of the SKU for Azure Dev Spaces Controller. 124 | * 125 | * @schema #/definitions/Sku#tier 126 | */ 127 | readonly tier?: SkuTier; 128 | 129 | } 130 | 131 | /** 132 | * @schema MicrosoftDevSpacesControllersTags 133 | */ 134 | export interface MicrosoftDevSpacesControllersTags { 135 | } 136 | 137 | export enum MicrosoftDevSpacesControllersType { 138 | "MicrosoftDevSpacesControllersType_MICROSOFT_DEV_SPACES_CONTROLLERS" = 'Microsoft.DevSpaces/controllers', 139 | } 140 | 141 | export enum SkuName { 142 | "SkuName_S1" = 'S1', 143 | } 144 | 145 | export enum SkuTier { 146 | STANDARD = 'Standard', 147 | } 148 | 149 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/IotCentral-2018-09-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.IoTCentral/iotApps 7 | * 8 | * @schema Microsoft.IoTCentral.iotApps 9 | */ 10 | export class IotApps extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.IoTCentral.iotApps" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: IotAppsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'iotApps', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.IoTCentral/iotApps 27 | * 28 | * @schema Microsoft.IoTCentral.iotApps 29 | */ 30 | export interface IotAppsOptions { 31 | /** 32 | * @schema Microsoft.IoTCentral.iotApps#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftIoTCentralIotAppsApiVersion; 35 | 36 | /** 37 | * The resource location. 38 | * 39 | * @schema Microsoft.IoTCentral.iotApps#location 40 | */ 41 | readonly location: string; 42 | 43 | /** 44 | * The ARM resource name of the IoT Central application. 45 | * 46 | * @schema Microsoft.IoTCentral.iotApps#name 47 | */ 48 | readonly name: string; 49 | 50 | /** 51 | * The properties of an IoT Central application. 52 | * 53 | * @schema Microsoft.IoTCentral.iotApps#properties 54 | */ 55 | readonly properties: AppProperties; 56 | 57 | /** 58 | * Information about the SKU of the IoT Central application. 59 | * 60 | * @schema Microsoft.IoTCentral.iotApps#sku 61 | */ 62 | readonly sku: AppSkuInfo; 63 | 64 | /** 65 | * The resource tags. 66 | * 67 | * @schema Microsoft.IoTCentral.iotApps#tags 68 | */ 69 | readonly tags?: MicrosoftIoTCentralIotAppsTags; 70 | 71 | /** 72 | * @schema Microsoft.IoTCentral.iotApps#type 73 | */ 74 | readonly type: MicrosoftIoTCentralIotAppsType; 75 | 76 | } 77 | 78 | export enum MicrosoftIoTCentralIotAppsApiVersion { 79 | "MicrosoftIoTCentralIotAppsApiVersion_2018_09_01" = '2018-09-01', 80 | } 81 | 82 | /** 83 | * The properties of an IoT Central application. 84 | * 85 | * @schema #/definitions/AppProperties 86 | */ 87 | export interface AppProperties { 88 | /** 89 | * The display name of the application. 90 | * 91 | * @schema #/definitions/AppProperties#displayName 92 | */ 93 | readonly displayName?: string; 94 | 95 | /** 96 | * The subdomain of the application. 97 | * 98 | * @schema #/definitions/AppProperties#subdomain 99 | */ 100 | readonly subdomain?: string; 101 | 102 | /** 103 | * The ID of the application template, which is a blueprint that defines the characteristics and behaviors of an application. Optional; if not specified, defaults to a blank blueprint and allows the application to be defined from scratch. 104 | * 105 | * @schema #/definitions/AppProperties#template 106 | */ 107 | readonly template?: string; 108 | 109 | } 110 | 111 | /** 112 | * Information about the SKU of the IoT Central application. 113 | * 114 | * @schema #/definitions/AppSkuInfo 115 | */ 116 | export interface AppSkuInfo { 117 | /** 118 | * The name of the SKU. 119 | * 120 | * @schema #/definitions/AppSkuInfo#name 121 | */ 122 | readonly name: AppSkuInfoName; 123 | 124 | } 125 | 126 | /** 127 | * @schema MicrosoftIoTCentralIotAppsTags 128 | */ 129 | export interface MicrosoftIoTCentralIotAppsTags { 130 | } 131 | 132 | export enum MicrosoftIoTCentralIotAppsType { 133 | "MicrosoftIoTCentralIotAppsType_MICROSOFT_IO_T_CENTRAL_IOT_APPS" = 'Microsoft.IoTCentral/iotApps', 134 | } 135 | 136 | export enum AppSkuInfoName { 137 | "AppSkuInfoName_F1" = 'F1', 138 | "AppSkuInfoName_S1" = 'S1', 139 | "AppSkuInfoName_ST0" = 'ST0', 140 | "AppSkuInfoName_ST1" = 'ST1', 141 | "AppSkuInfoName_ST2" = 'ST2', 142 | } 143 | 144 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/MachineLearning-2019-10-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.MachineLearning/workspaces 7 | * 8 | * @schema Microsoft.MachineLearning.workspaces 9 | */ 10 | export class Workspaces extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.MachineLearning.workspaces" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: WorkspacesOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'workspaces', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.MachineLearning/workspaces 27 | * 28 | * @schema Microsoft.MachineLearning.workspaces 29 | */ 30 | export interface WorkspacesOptions { 31 | /** 32 | * @schema Microsoft.MachineLearning.workspaces#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftMachineLearningWorkspacesApiVersion; 35 | 36 | /** 37 | * The location of the resource. This cannot be changed after the resource is created. 38 | * 39 | * @schema Microsoft.MachineLearning.workspaces#location 40 | */ 41 | readonly location: string; 42 | 43 | /** 44 | * The name of the machine learning workspace. 45 | * 46 | * @schema Microsoft.MachineLearning.workspaces#name 47 | */ 48 | readonly name: string; 49 | 50 | /** 51 | * The properties of a machine learning workspace. 52 | * 53 | * @schema Microsoft.MachineLearning.workspaces#properties 54 | */ 55 | readonly properties: WorkspaceProperties; 56 | 57 | /** 58 | * Sku of the resource 59 | * 60 | * @schema Microsoft.MachineLearning.workspaces#sku 61 | */ 62 | readonly sku?: Sku; 63 | 64 | /** 65 | * The tags of the resource. 66 | * 67 | * @schema Microsoft.MachineLearning.workspaces#tags 68 | */ 69 | readonly tags?: MicrosoftMachineLearningWorkspacesTags; 70 | 71 | /** 72 | * @schema Microsoft.MachineLearning.workspaces#type 73 | */ 74 | readonly type: MicrosoftMachineLearningWorkspacesType; 75 | 76 | } 77 | 78 | export enum MicrosoftMachineLearningWorkspacesApiVersion { 79 | "MicrosoftMachineLearningWorkspacesApiVersion_2019_10_01" = '2019-10-01', 80 | } 81 | 82 | /** 83 | * The properties of a machine learning workspace. 84 | * 85 | * @schema #/definitions/WorkspaceProperties 86 | */ 87 | export interface WorkspaceProperties { 88 | /** 89 | * The key vault identifier used for encrypted workspaces. 90 | * 91 | * @schema #/definitions/WorkspaceProperties#keyVaultIdentifierId 92 | */ 93 | readonly keyVaultIdentifierId?: string; 94 | 95 | /** 96 | * The email id of the owner for this workspace. 97 | * 98 | * @schema #/definitions/WorkspaceProperties#ownerEmail 99 | */ 100 | readonly ownerEmail: string; 101 | 102 | /** 103 | * The fully qualified arm id of the storage account associated with this workspace. 104 | * 105 | * @schema #/definitions/WorkspaceProperties#userStorageAccountId 106 | */ 107 | readonly userStorageAccountId: string; 108 | 109 | } 110 | 111 | /** 112 | * Sku of the resource 113 | * 114 | * @schema #/definitions/Sku 115 | */ 116 | export interface Sku { 117 | /** 118 | * Name of the sku 119 | * 120 | * @schema #/definitions/Sku#name 121 | */ 122 | readonly name?: string; 123 | 124 | /** 125 | * Tier of the sku like Basic or Enterprise 126 | * 127 | * @schema #/definitions/Sku#tier 128 | */ 129 | readonly tier?: string; 130 | 131 | } 132 | 133 | /** 134 | * @schema MicrosoftMachineLearningWorkspacesTags 135 | */ 136 | export interface MicrosoftMachineLearningWorkspacesTags { 137 | } 138 | 139 | export enum MicrosoftMachineLearningWorkspacesType { 140 | "MicrosoftMachineLearningWorkspacesType_MICROSOFT_MACHINE_LEARNING_WORKSPACES" = 'Microsoft.MachineLearning/workspaces', 141 | } 142 | 143 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/DataCatalog-2016-03-30.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.DataCatalog/catalogs 7 | * 8 | * @schema Microsoft.DataCatalog.catalogs 9 | */ 10 | export class Catalogs extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.DataCatalog.catalogs" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: CatalogsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'catalogs', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.DataCatalog/catalogs 27 | * 28 | * @schema Microsoft.DataCatalog.catalogs 29 | */ 30 | export interface CatalogsOptions { 31 | /** 32 | * @schema Microsoft.DataCatalog.catalogs#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftDataCatalogCatalogsApiVersion; 35 | 36 | /** 37 | * Resource etag 38 | * 39 | * @schema Microsoft.DataCatalog.catalogs#etag 40 | */ 41 | readonly etag?: string; 42 | 43 | /** 44 | * Resource location 45 | * 46 | * @schema Microsoft.DataCatalog.catalogs#location 47 | */ 48 | readonly location?: string; 49 | 50 | /** 51 | * The name of the data catalog in the specified subscription and resource group. 52 | * 53 | * @schema Microsoft.DataCatalog.catalogs#name 54 | */ 55 | readonly name: string; 56 | 57 | /** 58 | * Properties of the data catalog. 59 | * 60 | * @schema Microsoft.DataCatalog.catalogs#properties 61 | */ 62 | readonly properties: AdcCatalogProperties; 63 | 64 | /** 65 | * Resource tags 66 | * 67 | * @schema Microsoft.DataCatalog.catalogs#tags 68 | */ 69 | readonly tags?: MicrosoftDataCatalogCatalogsTags; 70 | 71 | /** 72 | * @schema Microsoft.DataCatalog.catalogs#type 73 | */ 74 | readonly type: MicrosoftDataCatalogCatalogsType; 75 | 76 | } 77 | 78 | export enum MicrosoftDataCatalogCatalogsApiVersion { 79 | "MicrosoftDataCatalogCatalogsApiVersion_2016_03_30" = '2016-03-30', 80 | } 81 | 82 | /** 83 | * Properties of the data catalog. 84 | * 85 | * @schema #/definitions/ADCCatalogProperties 86 | */ 87 | export interface AdcCatalogProperties { 88 | /** 89 | * Azure data catalog admin list. 90 | * 91 | * @schema #/definitions/ADCCatalogProperties#admins 92 | */ 93 | readonly admins?: Principals[]; 94 | 95 | /** 96 | * Automatic unit adjustment enabled or not. 97 | * 98 | * @schema #/definitions/ADCCatalogProperties#enableAutomaticUnitAdjustment 99 | */ 100 | readonly enableAutomaticUnitAdjustment?: boolean; 101 | 102 | /** 103 | * Azure data catalog SKU. 104 | * 105 | * @schema #/definitions/ADCCatalogProperties#sku 106 | */ 107 | readonly sku?: AdcCatalogPropertiesSku; 108 | 109 | /** 110 | * Azure data catalog provision status. 111 | * 112 | * @schema #/definitions/ADCCatalogProperties#successfullyProvisioned 113 | */ 114 | readonly successfullyProvisioned?: boolean; 115 | 116 | /** 117 | * Azure data catalog units. 118 | * 119 | * @schema #/definitions/ADCCatalogProperties#units 120 | */ 121 | readonly units?: number; 122 | 123 | /** 124 | * Azure data catalog user list. 125 | * 126 | * @schema #/definitions/ADCCatalogProperties#users 127 | */ 128 | readonly users?: Principals[]; 129 | 130 | } 131 | 132 | /** 133 | * @schema MicrosoftDataCatalogCatalogsTags 134 | */ 135 | export interface MicrosoftDataCatalogCatalogsTags { 136 | } 137 | 138 | export enum MicrosoftDataCatalogCatalogsType { 139 | "MicrosoftDataCatalogCatalogsType_MICROSOFT_DATA_CATALOG_CATALOGS" = 'Microsoft.DataCatalog/catalogs', 140 | } 141 | 142 | /** 143 | * User principals. 144 | * 145 | * @schema #/definitions/Principals 146 | */ 147 | export interface Principals { 148 | /** 149 | * Object Id for the user 150 | * 151 | * @schema #/definitions/Principals#objectId 152 | */ 153 | readonly objectId?: string; 154 | 155 | /** 156 | * UPN of the user. 157 | * 158 | * @schema #/definitions/Principals#upn 159 | */ 160 | readonly upn?: string; 161 | 162 | } 163 | 164 | export enum AdcCatalogPropertiesSku { 165 | FREE = 'Free', 166 | STANDARD = 'Standard', 167 | } 168 | 169 | -------------------------------------------------------------------------------- /packages/armkit-cli/schema-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | "2021-03-01/Microsoft.AAD", 3 | "2020-03-20/Microsoft.AVS", 4 | "2017-04-01/Microsoft.Aadiam", 5 | "2018-03-01/Microsoft.Addons", 6 | "2020-01-01/Microsoft.Advisor", 7 | "2021-04-01/Microsoft.AlertsManagement", 8 | "2017-08-01/Microsoft.AnalysisServices", 9 | 10 | "2020-06-01/Microsoft.AppConfiguration", 11 | "2020-07-01/Microsoft.AppPlatform", 12 | "2020-10-01/Microsoft.Attestation", 13 | "2019-09-01/Microsoft.Authorization", 14 | 15 | "2017-06-01/Microsoft.AzureStack", 16 | "2021-01-01/Microsoft.Batch", 17 | "2018-05-01/Microsoft.BatchAI", 18 | "2020-05-01/Microsoft.Billing", 19 | "2021-03-01/Microsoft.BotService", 20 | "2020-06-01/Microsoft.Cache", 21 | "2021-03-01/Microsoft.Cache.Enterprise", 22 | "2020-10-25/Microsoft.Capacity", 23 | 24 | "2015-08-01/Microsoft.CertificateRegistration", 25 | "2017-04-18/Microsoft.CognitiveServices", 26 | "2020-08-20/Microsoft.Communication", 27 | 28 | "2020-12-01/Microsoft.Compute.Extensions", 29 | "2019-03-01/Microsoft.Compute.Galleries", 30 | "2020-03-01/Microsoft.Confluent", 31 | "2021-05-01/Microsoft.Consumption", 32 | "2021-03-01/Microsoft.ContainerInstance", 33 | "2019-05-01/Microsoft.ContainerRegistry", 34 | 35 | "2018-06-01/Microsoft.DBforMariaDB", 36 | "2020-01-01/Microsoft.DBforMySQL", 37 | "2020-01-01/Microsoft.DBforPostgreSQL", 38 | "2021-03-01/Microsoft.DataBox", 39 | "2020-12-01/Microsoft.DataBoxEdge", 40 | "2016-03-30/Microsoft.DataCatalog", 41 | "2018-06-01/Microsoft.DataFactory", 42 | "2016-11-01/Microsoft.DataLakeAnalytics", 43 | "2016-11-01/Microsoft.DataLakeStore", 44 | "2018-04-19/Microsoft.DataMigration", 45 | 46 | "2018-04-01/Microsoft.Databricks", 47 | "2021-03-01/Microsoft.Datadog", 48 | "2019-04-01/Microsoft.DevSpaces", 49 | "2018-09-15/Microsoft.DevTestLab", 50 | "2020-08-31/Microsoft.Devices", 51 | "2020-03-01/Microsoft.Devices.Provisioning", 52 | "2020-12-01/Microsoft.DigitalTwins", 53 | "2021-04-15/Microsoft.DocumentDB", 54 | "2015-04-01/Microsoft.DomainRegistration", 55 | "2018-12-03/Microsoft.EnterpriseKnowledgeGraph", 56 | "2020-06-01/Microsoft.EventGrid", 57 | "2017-04-01/Microsoft.EventHub", 58 | "2021-01-25/Microsoft.GuestConfiguration", 59 | "2020-12-08/Microsoft.HealthBot", 60 | "2021-01-11/Microsoft.HealthcareApis", 61 | "2020-08-02/Microsoft.HybridCompute", 62 | "2019-06-01/Microsoft.HybridData", 63 | "2021-01-01/Microsoft.ImportExport", 64 | "2020-10-01/Microsoft.Insights", 65 | "2021-03-08/Microsoft.Insights.Application", 66 | 67 | "2018-09-01/Microsoft.IotCentral", 68 | "2019-09-01/Microsoft.KeyVault", 69 | "2015-06-01/Microsoft.KeyVault.Secrets", 70 | "2021-03-01/Microsoft.Kubernetes", 71 | "2021-03-01/Microsoft.KubernetesConfiguration", 72 | 73 | "2018-10-15/Microsoft.LabServices", 74 | "2017-07-01/Microsoft.Logic", 75 | "2019-10-01/Microsoft.MachineLearning", 76 | "2021-04-01/Microsoft.MachineLearningServices", 77 | "2021-05-01/Microsoft.Maintenance", 78 | "2018-11-30/Microsoft.ManagedIdentity", 79 | "2019-06-01/Microsoft.ManagedServices", 80 | "2021-04-01/Microsoft.Management", 81 | "2018-02-01/Microsoft.ManagementPartner", 82 | "2021-02-01/Microsoft.Maps", 83 | "2020-12-01/Microsoft.Marketplace", 84 | 85 | "2021-01-01/Microsoft.Migrate", 86 | "2021-01-01/Microsoft.MixedReality", 87 | "2020-12-01/Microsoft.NetApp", 88 | 89 | "2020-11-01/Microsoft.Network.FrontDoor", 90 | "2017-04-01/Microsoft.NotificationHubs", 91 | "2020-07-07/Microsoft.OffAzure", 92 | "2020-10-01/Microsoft.OperationalInsights", 93 | "2021-01-01/Microsoft.Peering", 94 | "2021-01-01/Microsoft.PolicyInsights", 95 | "2016-01-29/Microsoft.PowerBI", 96 | "2021-01-01/Microsoft.PowerBIDedicated", 97 | "2021-03-01/Microsoft.RecoveryServices", 98 | "2021-03-01/Microsoft.RecoveryServices.Backup", 99 | "2021-03-01/Microsoft.RecoveryServices.SiteRecovery", 100 | "2016-06-01/Microsoft.RecoveryServices.legacy", 101 | "2020-04-30/Microsoft.RedHatOpenShift", 102 | "2017-04-01/Microsoft.Relay", 103 | "2021-05-01/Microsoft.Resources", 104 | "2016-03-01/Microsoft.Scheduler", 105 | "2020-08-01/Microsoft.Search", 106 | "2020-01-01/Microsoft.Security", 107 | "2020-01-01/Microsoft.SecurityInsights", 108 | "2018-05-01/Microsoft.SerialConsole", 109 | "2017-04-01/Microsoft.ServiceBus", 110 | "2020-03-01/Microsoft.ServiceFabric", 111 | "2020-05-01/Microsoft.SignalRService", 112 | "2019-12-01/Microsoft.SoftwarePlan", 113 | "2014-04-01/Microsoft.Sql", 114 | "2016-10-01/Microsoft.StorSimple.1200", 115 | "2017-06-01/Microsoft.StorSimple.8000", 116 | "2019-06-01/Microsoft.Storage", 117 | "2021-03-01/Microsoft.StorageCache", 118 | "2020-09-01/Microsoft.StorageSync", 119 | "2016-03-01/Microsoft.StreamAnalytics", 120 | "2020-09-01/Microsoft.Subscription", 121 | "2020-04-01/Microsoft.Support", 122 | "2021-03-01/Microsoft.Synapse", 123 | "2020-05-15/Microsoft.TimeSeriesInsights", 124 | "2019-04-01/Microsoft.VMwareCloudSimple", 125 | "2020-02-14/Microsoft.VirtualMachineImages", 126 | 127 | "2019-06-01/Microsoft.WindowsIoT", 128 | "2015-01-01/Sendgrid.Email" 129 | ] -------------------------------------------------------------------------------- /packages/armkit-resources/lib/WindowsIoT-2019-06-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.WindowsIoT/deviceServices 7 | * 8 | * @schema Microsoft.WindowsIoT.deviceServices 9 | */ 10 | export class DeviceServices extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.WindowsIoT.deviceServices" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: DeviceServicesOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'deviceServices', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.WindowsIoT/deviceServices 27 | * 28 | * @schema Microsoft.WindowsIoT.deviceServices 29 | */ 30 | export interface DeviceServicesOptions { 31 | /** 32 | * @schema Microsoft.WindowsIoT.deviceServices#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftWindowsIoTDeviceServicesApiVersion; 35 | 36 | /** 37 | * The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. 38 | * 39 | * @schema Microsoft.WindowsIoT.deviceServices#etag 40 | */ 41 | readonly etag?: string; 42 | 43 | /** 44 | * The Azure Region where the resource lives 45 | * 46 | * @schema Microsoft.WindowsIoT.deviceServices#location 47 | */ 48 | readonly location?: string; 49 | 50 | /** 51 | * The name of the Windows IoT Device Service. 52 | * 53 | * @schema Microsoft.WindowsIoT.deviceServices#name 54 | */ 55 | readonly name: string; 56 | 57 | /** 58 | * The properties of a Windows IoT Device Service. 59 | * 60 | * @schema Microsoft.WindowsIoT.deviceServices#properties 61 | */ 62 | readonly properties: DeviceServiceProperties; 63 | 64 | /** 65 | * Resource tags. 66 | * 67 | * @schema Microsoft.WindowsIoT.deviceServices#tags 68 | */ 69 | readonly tags?: MicrosoftWindowsIoTDeviceServicesTags; 70 | 71 | /** 72 | * @schema Microsoft.WindowsIoT.deviceServices#type 73 | */ 74 | readonly type: MicrosoftWindowsIoTDeviceServicesType; 75 | 76 | } 77 | 78 | export enum MicrosoftWindowsIoTDeviceServicesApiVersion { 79 | "MicrosoftWindowsIoTDeviceServicesApiVersion_2019_06_01" = '2019-06-01', 80 | } 81 | 82 | /** 83 | * The properties of a Windows IoT Device Service. 84 | * 85 | * @schema #/definitions/DeviceServiceProperties 86 | */ 87 | export interface DeviceServiceProperties { 88 | /** 89 | * Windows IoT Device Service OEM AAD domain 90 | * 91 | * @schema #/definitions/DeviceServiceProperties#adminDomainName 92 | */ 93 | readonly adminDomainName?: string; 94 | 95 | /** 96 | * Windows IoT Device Service ODM AAD domain 97 | * 98 | * @schema #/definitions/DeviceServiceProperties#billingDomainName 99 | */ 100 | readonly billingDomainName?: string; 101 | 102 | /** 103 | * Windows IoT Device Service notes. 104 | * 105 | * @schema #/definitions/DeviceServiceProperties#notes 106 | */ 107 | readonly notes?: string; 108 | 109 | /** 110 | * Windows IoT Device Service device allocation, 111 | * 112 | * @schema #/definitions/DeviceServiceProperties#quantity 113 | */ 114 | readonly quantity?: number; 115 | 116 | } 117 | 118 | /** 119 | * @schema MicrosoftWindowsIoTDeviceServicesTags 120 | */ 121 | export interface MicrosoftWindowsIoTDeviceServicesTags { 122 | } 123 | 124 | export enum MicrosoftWindowsIoTDeviceServicesType { 125 | "MicrosoftWindowsIoTDeviceServicesType_MICROSOFT_WINDOWS_IO_T_DEVICE_SERVICES" = 'Microsoft.WindowsIoT/deviceServices', 126 | } 127 | 128 | -------------------------------------------------------------------------------- /packages/schema-generator/lib/schemas-deployment-template.ts: -------------------------------------------------------------------------------- 1 | var github = require('octonode'); 2 | require('dotenv').config(); 3 | 4 | function getRepo(accessToken: string | undefined) { 5 | var client = github.client(accessToken); 6 | var ghrepo = client.repo('Azure/azure-resource-manager-schemas'); 7 | return ghrepo; 8 | } 9 | 10 | function filterVersions(body) { 11 | // Only versions that look like a date 12 | body = body.filter((schema) => schema.name.match(/^[\d-]+$/) != null); 13 | 14 | // Sort descending by name. 15 | body = body.sort((x, y) => x.name < y.name ? 1 : -1); 16 | 17 | return body; 18 | } 19 | 20 | function fromBase64(s: string) { 21 | let buffer = Buffer.from(s, "base64"); 22 | return buffer.toString("utf8"); 23 | } 24 | 25 | async function hasDeploymentTemplate(ghrepo, schema) { 26 | let body = await ghrepo.contentsAsync(schema.path); 27 | body = body[0]; 28 | 29 | return body.find(file => file.name == 'deploymentTemplate.json') !== undefined; 30 | } 31 | 32 | async function getSchemasWithTemplate(ghrepo) { 33 | let body = await ghrepo.contentsAsync('/schemas'); 34 | body = body[0]; 35 | 36 | body = filterVersions(body); 37 | 38 | body = body.filter(async schema => await hasDeploymentTemplate(ghrepo, schema)); 39 | 40 | return body; 41 | } 42 | 43 | async function getTemplateContents(ghrepo, schema) { 44 | let path = schema.path + '/deploymentTemplate.json'; 45 | 46 | let body = await ghrepo.contentsAsync(path); 47 | body = body[0]; 48 | 49 | 50 | return fromBase64(body.content); 51 | } 52 | 53 | function flatten(arr) { 54 | // Make sure we need it. 55 | if (arr.find(element => Array.isArray(element)) === undefined) { 56 | return arr; 57 | } 58 | 59 | return arr.reduce(function(accumulated, current) { 60 | if (Array.isArray(current)) { 61 | return accumulated.concat(current); 62 | } 63 | else { 64 | return accumulated.push(current); 65 | } 66 | }, []); 67 | } 68 | 69 | function getRefs(items) { 70 | if (items === undefined) { 71 | return []; 72 | } 73 | else if (items["$ref"]) { 74 | return [ items["$ref"] ]; 75 | } 76 | else if (Array.isArray(items)) { 77 | return flatten(items.map((value, index, array) => getRefs(value))); 78 | } 79 | else { 80 | return getRefs(items["oneOf"]).concat(getRefs(items["allOf"])); 81 | } 82 | } 83 | 84 | function keepLatestVersions(resources) { 85 | let groups = resources.map(function(resource) { 86 | return { 87 | name: resource.substring(55), 88 | version: resource.substring(44, 54) 89 | } 90 | }); 91 | 92 | groups = groups.sort(function(x, y) { 93 | if (x.name > y.name) return 1; // name ascending 94 | else if (x.name < y.name) return -1; 95 | else { 96 | if (x.version < y.version) return 1; // version descending 97 | else if (x.version > y.version) return -1; 98 | else return 0; 99 | } 100 | }); 101 | 102 | groups = groups.reduce(function(accumulated, current) { 103 | if (!accumulated.find((value) => value.name === current.name && value.version >= current.version)) { 104 | accumulated.push(current); 105 | } 106 | return accumulated; 107 | }, []); 108 | 109 | return groups.map(group => `${group.version}/${group.name}`); 110 | } 111 | 112 | function getResourceList(contents: string) { 113 | let items = contents['properties'].resources.items; 114 | 115 | // Iterate into the contents and get all the $ref 116 | let resources = getRefs(items); 117 | 118 | resources = resources 119 | .filter(resource => resource.startsWith('https://schema.management.azure.com/schemas/2')) // Filter the ones referencing versioned schemas 120 | .filter(resource => resource.indexOf('preview') < 0) // Exclude preview 121 | .map(resource => resource.substring(0, resource.indexOf('#'))) // Keep the file reference only 122 | .reduce(function(accumulated, current) { 123 | if (!accumulated.find((value) => value === current)) { 124 | accumulated.push(current); 125 | } 126 | return accumulated; 127 | }, []); // Remove duplicates 128 | 129 | return keepLatestVersions(resources); 130 | } 131 | 132 | async function main() { 133 | var ghrepo = getRepo(process.env.GITHUB_ACCESS_TOKEN); 134 | let schemas = await getSchemasWithTemplate(ghrepo); 135 | 136 | schemas.forEach(async schema => { 137 | let contents = await getTemplateContents(ghrepo, schema); 138 | 139 | var object = JSON.parse(contents); 140 | let resourceList = getResourceList(object); 141 | 142 | let fs = require('fs'); 143 | fs.writeFile( 144 | `out/schema-config${schema.name}.json`, 145 | JSON.stringify(resourceList), 146 | '', 147 | (err) => console.log(err)); 148 | }); 149 | 150 | } 151 | 152 | function testFileLoad() { 153 | let fs = require('fs'); 154 | 155 | fs.readFile('sampleDeploymentTemplate.json', 'utf8', function(err, data) { 156 | if (err) { 157 | throw Error(err); 158 | } 159 | 160 | var object = JSON.parse(data); 161 | let resourceList = getResourceList(object); 162 | 163 | console.log(JSON.stringify(resourceList)); 164 | }); 165 | } 166 | 167 | main(); 168 | 169 | export {} 170 | 171 | -------------------------------------------------------------------------------- /packages/schema-generator/lib/schema-config-repo.json: -------------------------------------------------------------------------------- 1 | [ 2 | "2021-03-01/Microsoft.AAD", 3 | "2021-06-01/Microsoft.AVS", 4 | "2017-04-01/Microsoft.Aadiam", 5 | "2018-03-01/Microsoft.Addons", 6 | "2020-01-01/Microsoft.Advisor", 7 | "2021-04-01/Microsoft.AlertsManagement", 8 | "2017-08-01/Microsoft.AnalysisServices", 9 | "2020-12-01/Microsoft.ApiManagement", 10 | "2020-06-01/Microsoft.AppConfiguration", 11 | "2020-07-01/Microsoft.AppPlatform", 12 | "2020-10-01/Microsoft.Attestation", 13 | "2019-09-01/Microsoft.Authorization", 14 | "2019-06-01/Microsoft.Automation", 15 | "2017-06-01/Microsoft.AzureStack", 16 | "2021-01-01/Microsoft.Batch", 17 | "2018-05-01/Microsoft.BatchAI", 18 | "2020-05-01/Microsoft.Billing", 19 | "2021-03-01/Microsoft.BotService", 20 | "2020-12-01/Microsoft.Cache", 21 | "2021-03-01/Microsoft.Cache.Enterprise", 22 | "2020-10-25/Microsoft.Capacity", 23 | "2020-09-01/Microsoft.Cdn", 24 | "2015-08-01/Microsoft.CertificateRegistration", 25 | "2017-04-18/Microsoft.CognitiveServices", 26 | "2020-08-20/Microsoft.Communication", 27 | "2020-12-01/Microsoft.Compute", 28 | "2020-12-01/Microsoft.Compute.Extensions", 29 | "2019-03-01/Microsoft.Compute.Galleries", 30 | "2020-03-01/Microsoft.Confluent", 31 | "2021-05-01/Microsoft.Consumption", 32 | "2021-03-01/Microsoft.ContainerInstance", 33 | "2019-05-01/Microsoft.ContainerRegistry", 34 | "2021-03-01/Microsoft.ContainerService", 35 | "2018-06-01/Microsoft.DBforMariaDB", 36 | "2020-01-01/Microsoft.DBforMySQL", 37 | "2020-01-01/Microsoft.DBforPostgreSQL", 38 | "2021-03-01/Microsoft.DataBox", 39 | "2020-12-01/Microsoft.DataBoxEdge", 40 | "2016-03-30/Microsoft.DataCatalog", 41 | "2018-06-01/Microsoft.DataFactory", 42 | "2016-11-01/Microsoft.DataLakeAnalytics", 43 | "2016-11-01/Microsoft.DataLakeStore", 44 | "2018-04-19/Microsoft.DataMigration", 45 | "2020-09-01/Microsoft.DataShare", 46 | "2018-04-01/Microsoft.Databricks", 47 | "2021-03-01/Microsoft.Datadog", 48 | "2019-04-01/Microsoft.DevSpaces", 49 | "2018-09-15/Microsoft.DevTestLab", 50 | "2021-03-31/Microsoft.Devices", 51 | "2020-03-01/Microsoft.Devices.Provisioning", 52 | "2020-12-01/Microsoft.DigitalTwins", 53 | "2021-04-15/Microsoft.DocumentDB", 54 | "2015-04-01/Microsoft.DomainRegistration", 55 | "2018-12-03/Microsoft.EnterpriseKnowledgeGraph", 56 | "2020-06-01/Microsoft.EventGrid", 57 | "2017-04-01/Microsoft.EventHub", 58 | "2021-01-25/Microsoft.GuestConfiguration", 59 | "2020-12-08/Microsoft.HealthBot", 60 | "2021-01-11/Microsoft.HealthcareApis", 61 | "2020-08-02/Microsoft.HybridCompute", 62 | "2019-06-01/Microsoft.HybridData", 63 | "2021-01-01/Microsoft.ImportExport", 64 | "2020-10-01/Microsoft.Insights", 65 | "2021-03-08/Microsoft.Insights.Application", 66 | "2014-04-01/Microsoft.Insights.ManuallyAuthored", 67 | "2018-09-01/Microsoft.IotCentral", 68 | "2019-09-01/Microsoft.KeyVault", 69 | "2015-06-01/Microsoft.KeyVault.Secrets", 70 | "2021-03-01/Microsoft.Kubernetes", 71 | "2021-03-01/Microsoft.KubernetesConfiguration", 72 | "2020-09-18/Microsoft.Kusto", 73 | "2018-10-15/Microsoft.LabServices", 74 | "2017-07-01/Microsoft.Logic", 75 | "2019-10-01/Microsoft.MachineLearning", 76 | "2021-04-01/Microsoft.MachineLearningServices", 77 | "2021-05-01/Microsoft.Maintenance", 78 | "2018-11-30/Microsoft.ManagedIdentity", 79 | "2019-06-01/Microsoft.ManagedServices", 80 | "2021-04-01/Microsoft.Management", 81 | "2018-02-01/Microsoft.ManagementPartner", 82 | "2021-02-01/Microsoft.Maps", 83 | "2020-12-01/Microsoft.Marketplace", 84 | "2018-07-01/Microsoft.Media", 85 | "2021-01-01/Microsoft.Migrate", 86 | "2021-01-01/Microsoft.MixedReality", 87 | "2021-02-01/Microsoft.NetApp", 88 | "2020-11-01/Microsoft.Network", 89 | "2020-11-01/Microsoft.Network.FrontDoor", 90 | "2017-04-01/Microsoft.NotificationHubs", 91 | "2020-07-07/Microsoft.OffAzure", 92 | "2020-10-01/Microsoft.OperationalInsights", 93 | "2021-01-01/Microsoft.Peering", 94 | "2021-01-01/Microsoft.PolicyInsights", 95 | "2016-01-29/Microsoft.PowerBI", 96 | "2021-01-01/Microsoft.PowerBIDedicated", 97 | "2021-03-01/Microsoft.RecoveryServices", 98 | "2021-03-01/Microsoft.RecoveryServices.Backup", 99 | "2021-03-01/Microsoft.RecoveryServices.SiteRecovery", 100 | "2016-06-01/Microsoft.RecoveryServices.legacy", 101 | "2020-04-30/Microsoft.RedHatOpenShift", 102 | "2017-04-01/Microsoft.Relay", 103 | "2021-05-01/Microsoft.Resources", 104 | "2016-03-01/Microsoft.Scheduler", 105 | "2020-08-01/Microsoft.Search", 106 | "2020-01-01/Microsoft.Security", 107 | "2020-01-01/Microsoft.SecurityInsights", 108 | "2018-05-01/Microsoft.SerialConsole", 109 | "2017-04-01/Microsoft.ServiceBus", 110 | "2020-03-01/Microsoft.ServiceFabric", 111 | "2020-05-01/Microsoft.SignalRService", 112 | "2019-12-01/Microsoft.SoftwarePlan", 113 | "2014-04-01/Microsoft.Sql", 114 | "2016-10-01/Microsoft.StorSimple.1200", 115 | "2017-06-01/Microsoft.StorSimple.8000", 116 | "2021-04-01/Microsoft.Storage", 117 | "2021-03-01/Microsoft.StorageCache", 118 | "2020-09-01/Microsoft.StorageSync", 119 | "2016-03-01/Microsoft.StreamAnalytics", 120 | "2020-09-01/Microsoft.Subscription", 121 | "2020-04-01/Microsoft.Support", 122 | "2021-03-01/Microsoft.Synapse", 123 | "2020-05-15/Microsoft.TimeSeriesInsights", 124 | "2019-04-01/Microsoft.VMwareCloudSimple", 125 | "2020-02-14/Microsoft.VirtualMachineImages", 126 | "2018-11-01/Microsoft.Web", 127 | "2019-06-01/Microsoft.WindowsIoT", 128 | "2015-01-01/Sendgrid.Email" 129 | ] -------------------------------------------------------------------------------- /packages/armkit-resources/lib/EnterpriseKnowledgeGraph-2018-12-03.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.EnterpriseKnowledgeGraph/services 7 | * 8 | * @schema Microsoft.EnterpriseKnowledgeGraph.services 9 | */ 10 | export class Services extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.EnterpriseKnowledgeGraph.services" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ServicesOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'services', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.EnterpriseKnowledgeGraph/services 27 | * 28 | * @schema Microsoft.EnterpriseKnowledgeGraph.services 29 | */ 30 | export interface ServicesOptions { 31 | /** 32 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftEnterpriseKnowledgeGraphServicesApiVersion; 35 | 36 | /** 37 | * Specifies the location of the resource. 38 | * 39 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * The name of the EnterpriseKnowledgeGraph resource. 45 | * 46 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#name 47 | */ 48 | readonly name: MicrosoftEnterpriseKnowledgeGraphServicesNamePattern; 49 | 50 | /** 51 | * The parameters to provide for the EnterpriseKnowledgeGraph. 52 | * 53 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#properties 54 | */ 55 | readonly properties: EnterpriseKnowledgeGraphProperties; 56 | 57 | /** 58 | * The SKU of the EnterpriseKnowledgeGraph service account. 59 | * 60 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#sku 61 | */ 62 | readonly sku?: Sku; 63 | 64 | /** 65 | * Contains resource tags defined as key/value pairs. 66 | * 67 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#tags 68 | */ 69 | readonly tags?: MicrosoftEnterpriseKnowledgeGraphServicesTags; 70 | 71 | /** 72 | * @schema Microsoft.EnterpriseKnowledgeGraph.services#type 73 | */ 74 | readonly type: MicrosoftEnterpriseKnowledgeGraphServicesType; 75 | 76 | } 77 | 78 | export enum MicrosoftEnterpriseKnowledgeGraphServicesApiVersion { 79 | "MicrosoftEnterpriseKnowledgeGraphServicesApiVersion_2018_12_03" = '2018-12-03', 80 | } 81 | 82 | /** 83 | * @schema MicrosoftEnterpriseKnowledgeGraphServicesName 84 | */ 85 | export class MicrosoftEnterpriseKnowledgeGraphServicesNamePattern { 86 | public static pattern(value: string): string { 87 | return value; 88 | } 89 | } 90 | 91 | /** 92 | * The parameters to provide for the EnterpriseKnowledgeGraph. 93 | * 94 | * @schema #/definitions/EnterpriseKnowledgeGraphProperties 95 | */ 96 | export interface EnterpriseKnowledgeGraphProperties { 97 | /** 98 | * The description of the EnterpriseKnowledgeGraph 99 | * 100 | * @schema #/definitions/EnterpriseKnowledgeGraphProperties#description 101 | */ 102 | readonly description?: string; 103 | 104 | /** 105 | * Specifies the metadata of the resource. 106 | * 107 | * @schema #/definitions/EnterpriseKnowledgeGraphProperties#metadata 108 | */ 109 | readonly metadata?: EnterpriseKnowledgeGraphPropertiesMetadata; 110 | 111 | /** 112 | * The state of EnterpriseKnowledgeGraph provisioning. 113 | * 114 | * @schema #/definitions/EnterpriseKnowledgeGraphProperties#provisioningState 115 | */ 116 | readonly provisioningState?: EnterpriseKnowledgeGraphPropertiesProvisioningState; 117 | 118 | } 119 | 120 | /** 121 | * The SKU of the EnterpriseKnowledgeGraph service account. 122 | * 123 | * @schema #/definitions/Sku 124 | */ 125 | export interface Sku { 126 | /** 127 | * The sku name. 128 | * 129 | * @schema #/definitions/Sku#name 130 | */ 131 | readonly name: SkuName; 132 | 133 | } 134 | 135 | /** 136 | * @schema MicrosoftEnterpriseKnowledgeGraphServicesTags 137 | */ 138 | export interface MicrosoftEnterpriseKnowledgeGraphServicesTags { 139 | } 140 | 141 | export enum MicrosoftEnterpriseKnowledgeGraphServicesType { 142 | "MicrosoftEnterpriseKnowledgeGraphServicesType_MICROSOFT_ENTERPRISE_KNOWLEDGE_GRAPH_SERVICES" = 'Microsoft.EnterpriseKnowledgeGraph/services', 143 | } 144 | 145 | /** 146 | * Specifies the metadata of the resource. 147 | * 148 | * @schema #/definitions/enterpriseKnowledgeGraphPropertiesMetadata 149 | */ 150 | export interface EnterpriseKnowledgeGraphPropertiesMetadata { 151 | } 152 | 153 | export enum EnterpriseKnowledgeGraphPropertiesProvisioningState { 154 | CREATING = 'Creating', 155 | DELETING = 'Deleting', 156 | FAILED = 'Failed', 157 | SUCCEEDED = 'Succeeded', 158 | } 159 | 160 | export enum SkuName { 161 | "SkuName_F0" = 'F0', 162 | "SkuName_S1" = 'S1', 163 | } 164 | 165 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Kubernetes-2021-03-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.Kubernetes/connectedClusters 7 | * 8 | * @schema Microsoft.Kubernetes.connectedClusters 9 | */ 10 | export class ConnectedClusters extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.Kubernetes.connectedClusters" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ConnectedClustersOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'connectedClusters', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.Kubernetes/connectedClusters 27 | * 28 | * @schema Microsoft.Kubernetes.connectedClusters 29 | */ 30 | export interface ConnectedClustersOptions { 31 | /** 32 | * @schema Microsoft.Kubernetes.connectedClusters#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftKubernetesConnectedClustersApiVersion; 35 | 36 | /** 37 | * Identity for the connected cluster. 38 | * 39 | * @schema Microsoft.Kubernetes.connectedClusters#identity 40 | */ 41 | readonly identity: ConnectedClusterIdentity; 42 | 43 | /** 44 | * The geo-location where the resource lives 45 | * 46 | * @schema Microsoft.Kubernetes.connectedClusters#location 47 | */ 48 | readonly location: string; 49 | 50 | /** 51 | * The name of the Kubernetes cluster on which get is called. 52 | * 53 | * @schema Microsoft.Kubernetes.connectedClusters#name 54 | */ 55 | readonly name: string; 56 | 57 | /** 58 | * Properties of the connected cluster. 59 | * 60 | * @schema Microsoft.Kubernetes.connectedClusters#properties 61 | */ 62 | readonly properties: ConnectedClusterProperties; 63 | 64 | /** 65 | * Resource tags. 66 | * 67 | * @schema Microsoft.Kubernetes.connectedClusters#tags 68 | */ 69 | readonly tags?: MicrosoftKubernetesConnectedClustersTags; 70 | 71 | /** 72 | * @schema Microsoft.Kubernetes.connectedClusters#type 73 | */ 74 | readonly type: MicrosoftKubernetesConnectedClustersType; 75 | 76 | } 77 | 78 | export enum MicrosoftKubernetesConnectedClustersApiVersion { 79 | "MicrosoftKubernetesConnectedClustersApiVersion_2021_03_01" = '2021-03-01', 80 | } 81 | 82 | /** 83 | * Identity for the connected cluster. 84 | * 85 | * @schema #/definitions/ConnectedClusterIdentity 86 | */ 87 | export interface ConnectedClusterIdentity { 88 | /** 89 | * The type of identity used for the connected cluster. The type 'SystemAssigned, includes a system created identity. The type 'None' means no identity is assigned to the connected cluster. 90 | * 91 | * @schema #/definitions/ConnectedClusterIdentity#type 92 | */ 93 | readonly type: ConnectedClusterIdentityType; 94 | 95 | } 96 | 97 | /** 98 | * Properties of the connected cluster. 99 | * 100 | * @schema #/definitions/ConnectedClusterProperties 101 | */ 102 | export interface ConnectedClusterProperties { 103 | /** 104 | * Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. 105 | * 106 | * @schema #/definitions/ConnectedClusterProperties#agentPublicKeyCertificate 107 | */ 108 | readonly agentPublicKeyCertificate: string; 109 | 110 | /** 111 | * The Kubernetes distribution running on this connected cluster. 112 | * 113 | * @schema #/definitions/ConnectedClusterProperties#distribution 114 | */ 115 | readonly distribution?: string; 116 | 117 | /** 118 | * The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on. 119 | * 120 | * @schema #/definitions/ConnectedClusterProperties#infrastructure 121 | */ 122 | readonly infrastructure?: string; 123 | 124 | /** 125 | * Provisioning state of the connected cluster resource. 126 | * 127 | * @schema #/definitions/ConnectedClusterProperties#provisioningState 128 | */ 129 | readonly provisioningState?: ConnectedClusterPropertiesProvisioningState; 130 | 131 | } 132 | 133 | /** 134 | * @schema MicrosoftKubernetesConnectedClustersTags 135 | */ 136 | export interface MicrosoftKubernetesConnectedClustersTags { 137 | } 138 | 139 | export enum MicrosoftKubernetesConnectedClustersType { 140 | "MicrosoftKubernetesConnectedClustersType_MICROSOFT_KUBERNETES_CONNECTED_CLUSTERS" = 'Microsoft.Kubernetes/connectedClusters', 141 | } 142 | 143 | export enum ConnectedClusterIdentityType { 144 | NONE = 'None', 145 | SYSTEM_ASSIGNED = 'SystemAssigned', 146 | } 147 | 148 | export enum ConnectedClusterPropertiesProvisioningState { 149 | SUCCEEDED = 'Succeeded', 150 | FAILED = 'Failed', 151 | CANCELED = 'Canceled', 152 | PROVISIONING = 'Provisioning', 153 | UPDATING = 'Updating', 154 | DELETING = 'Deleting', 155 | ACCEPTED = 'Accepted', 156 | } 157 | 158 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Communication-2020-08-20.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.Communication/communicationServices 7 | * 8 | * @schema Microsoft.Communication.communicationServices 9 | */ 10 | export class CommunicationServices extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.Communication.communicationServices" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: CommunicationServicesOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'communicationServices', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.Communication/communicationServices 27 | * 28 | * @schema Microsoft.Communication.communicationServices 29 | */ 30 | export interface CommunicationServicesOptions { 31 | /** 32 | * @schema Microsoft.Communication.communicationServices#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftCommunicationCommunicationServicesApiVersion; 35 | 36 | /** 37 | * The Azure location where the CommunicationService is running. 38 | * 39 | * @schema Microsoft.Communication.communicationServices#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * The name of the CommunicationService resource. 45 | * 46 | * @schema Microsoft.Communication.communicationServices#name 47 | */ 48 | readonly name: MicrosoftCommunicationCommunicationServicesNamePattern; 49 | 50 | /** 51 | * A class that describes the properties of the CommunicationService. 52 | * 53 | * @schema Microsoft.Communication.communicationServices#properties 54 | */ 55 | readonly properties: CommunicationServiceProperties; 56 | 57 | /** 58 | * Metadata pertaining to creation and last modification of the resource. 59 | * 60 | * @schema Microsoft.Communication.communicationServices#systemData 61 | */ 62 | readonly systemData?: SystemData; 63 | 64 | /** 65 | * Tags of the service which is a list of key value pairs that describe the resource. 66 | * 67 | * @schema Microsoft.Communication.communicationServices#tags 68 | */ 69 | readonly tags?: MicrosoftCommunicationCommunicationServicesTags; 70 | 71 | /** 72 | * @schema Microsoft.Communication.communicationServices#type 73 | */ 74 | readonly type: MicrosoftCommunicationCommunicationServicesType; 75 | 76 | } 77 | 78 | export enum MicrosoftCommunicationCommunicationServicesApiVersion { 79 | "MicrosoftCommunicationCommunicationServicesApiVersion_2020_08_20" = '2020-08-20', 80 | } 81 | 82 | /** 83 | * @schema MicrosoftCommunicationCommunicationServicesName 84 | */ 85 | export class MicrosoftCommunicationCommunicationServicesNamePattern { 86 | public static pattern(value: string): string { 87 | return value; 88 | } 89 | } 90 | 91 | /** 92 | * A class that describes the properties of the CommunicationService. 93 | * 94 | * @schema #/definitions/CommunicationServiceProperties 95 | */ 96 | export interface CommunicationServiceProperties { 97 | /** 98 | * The location where the communication service stores its data at rest. 99 | * 100 | * @schema #/definitions/CommunicationServiceProperties#dataLocation 101 | */ 102 | readonly dataLocation: string; 103 | 104 | } 105 | 106 | /** 107 | * Metadata pertaining to creation and last modification of the resource. 108 | * 109 | * @schema #/definitions/SystemData 110 | */ 111 | export interface SystemData { 112 | /** 113 | * The timestamp of resource creation (UTC). 114 | * 115 | * @schema #/definitions/SystemData#createdAt 116 | */ 117 | readonly createdAt?: Date; 118 | 119 | /** 120 | * The identity that created the resource. 121 | * 122 | * @schema #/definitions/SystemData#createdBy 123 | */ 124 | readonly createdBy?: string; 125 | 126 | /** 127 | * The type of identity that created the resource. 128 | * 129 | * @schema #/definitions/SystemData#createdByType 130 | */ 131 | readonly createdByType?: SystemDataCreatedByType; 132 | 133 | /** 134 | * The timestamp of resource last modification (UTC) 135 | * 136 | * @schema #/definitions/SystemData#lastModifiedAt 137 | */ 138 | readonly lastModifiedAt?: Date; 139 | 140 | /** 141 | * The identity that last modified the resource. 142 | * 143 | * @schema #/definitions/SystemData#lastModifiedBy 144 | */ 145 | readonly lastModifiedBy?: string; 146 | 147 | /** 148 | * The type of identity that last modified the resource. 149 | * 150 | * @schema #/definitions/SystemData#lastModifiedByType 151 | */ 152 | readonly lastModifiedByType?: SystemDataLastModifiedByType; 153 | 154 | } 155 | 156 | /** 157 | * @schema MicrosoftCommunicationCommunicationServicesTags 158 | */ 159 | export interface MicrosoftCommunicationCommunicationServicesTags { 160 | } 161 | 162 | export enum MicrosoftCommunicationCommunicationServicesType { 163 | "MicrosoftCommunicationCommunicationServicesType_MICROSOFT_COMMUNICATION_COMMUNICATION_SERVICES" = 'Microsoft.Communication/communicationServices', 164 | } 165 | 166 | export enum SystemDataCreatedByType { 167 | USER = 'User', 168 | APPLICATION = 'Application', 169 | MANAGED_IDENTITY = 'ManagedIdentity', 170 | KEY = 'Key', 171 | } 172 | 173 | export enum SystemDataLastModifiedByType { 174 | USER = 'User', 175 | APPLICATION = 'Application', 176 | MANAGED_IDENTITY = 'ManagedIdentity', 177 | KEY = 'Key', 178 | } 179 | 180 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Confluent-2020-03-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.Confluent/organizations 7 | * 8 | * @schema Microsoft.Confluent.organizations 9 | */ 10 | export class Organizations extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.Confluent.organizations" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: OrganizationsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'organizations', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.Confluent/organizations 27 | * 28 | * @schema Microsoft.Confluent.organizations 29 | */ 30 | export interface OrganizationsOptions { 31 | /** 32 | * @schema Microsoft.Confluent.organizations#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftConfluentOrganizationsApiVersion; 35 | 36 | /** 37 | * Location of Organization resource 38 | * 39 | * @schema Microsoft.Confluent.organizations#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * Organization resource name 45 | * 46 | * @schema Microsoft.Confluent.organizations#name 47 | */ 48 | readonly name: string; 49 | 50 | /** 51 | * Organization resource properties 52 | * 53 | * @schema Microsoft.Confluent.organizations#properties 54 | */ 55 | readonly properties: OrganizationResourcePropertiesModel; 56 | 57 | /** 58 | * Organization resource tags 59 | * 60 | * @schema Microsoft.Confluent.organizations#tags 61 | */ 62 | readonly tags?: MicrosoftConfluentOrganizationsTags; 63 | 64 | /** 65 | * @schema Microsoft.Confluent.organizations#type 66 | */ 67 | readonly type: MicrosoftConfluentOrganizationsType; 68 | 69 | } 70 | 71 | export enum MicrosoftConfluentOrganizationsApiVersion { 72 | "MicrosoftConfluentOrganizationsApiVersion_2020_03_01" = '2020-03-01', 73 | } 74 | 75 | /** 76 | * Organization resource properties 77 | * 78 | * @schema #/definitions/OrganizationResourcePropertiesModel 79 | */ 80 | export interface OrganizationResourcePropertiesModel { 81 | /** 82 | * Confluent offer detail 83 | * 84 | * @schema #/definitions/OrganizationResourcePropertiesModel#offerDetail 85 | */ 86 | readonly offerDetail?: OrganizationResourcePropertiesOfferDetail; 87 | 88 | /** 89 | * Subscriber detail 90 | * 91 | * @schema #/definitions/OrganizationResourcePropertiesModel#userDetail 92 | */ 93 | readonly userDetail?: OrganizationResourcePropertiesUserDetail; 94 | 95 | } 96 | 97 | /** 98 | * @schema MicrosoftConfluentOrganizationsTags 99 | */ 100 | export interface MicrosoftConfluentOrganizationsTags { 101 | } 102 | 103 | export enum MicrosoftConfluentOrganizationsType { 104 | "MicrosoftConfluentOrganizationsType_MICROSOFT_CONFLUENT_ORGANIZATIONS" = 'Microsoft.Confluent/organizations', 105 | } 106 | 107 | /** 108 | * Confluent offer detail 109 | * 110 | * @schema #/definitions/OrganizationResourcePropertiesOfferDetail 111 | */ 112 | export interface OrganizationResourcePropertiesOfferDetail { 113 | /** 114 | * Offer Id 115 | * 116 | * @schema #/definitions/OrganizationResourcePropertiesOfferDetail#id 117 | */ 118 | readonly id?: string; 119 | 120 | /** 121 | * Offer Plan Id 122 | * 123 | * @schema #/definitions/OrganizationResourcePropertiesOfferDetail#planId 124 | */ 125 | readonly planId?: string; 126 | 127 | /** 128 | * Offer Plan Name 129 | * 130 | * @schema #/definitions/OrganizationResourcePropertiesOfferDetail#planName 131 | */ 132 | readonly planName?: string; 133 | 134 | /** 135 | * Publisher Id 136 | * 137 | * @schema #/definitions/OrganizationResourcePropertiesOfferDetail#publisherId 138 | */ 139 | readonly publisherId?: string; 140 | 141 | /** 142 | * Offer Plan Term unit 143 | * 144 | * @schema #/definitions/OrganizationResourcePropertiesOfferDetail#termUnit 145 | */ 146 | readonly termUnit?: string; 147 | 148 | } 149 | 150 | /** 151 | * Subscriber detail 152 | * 153 | * @schema #/definitions/OrganizationResourcePropertiesUserDetail 154 | */ 155 | export interface OrganizationResourcePropertiesUserDetail { 156 | /** 157 | * Email address 158 | * 159 | * @schema #/definitions/OrganizationResourcePropertiesUserDetail#emailAddress 160 | */ 161 | readonly emailAddress?: OrganizationResourcePropertiesUserDetailEmailAddressPattern; 162 | 163 | /** 164 | * First name 165 | * 166 | * @schema #/definitions/OrganizationResourcePropertiesUserDetail#firstName 167 | */ 168 | readonly firstName?: string; 169 | 170 | /** 171 | * Last name 172 | * 173 | * @schema #/definitions/OrganizationResourcePropertiesUserDetail#lastName 174 | */ 175 | readonly lastName?: string; 176 | 177 | } 178 | 179 | /** 180 | * @schema #/definitions/organizationResourcePropertiesUserDetailEmailAddress 181 | */ 182 | export class OrganizationResourcePropertiesUserDetailEmailAddressPattern { 183 | public static pattern(value: string): string { 184 | return value; 185 | } 186 | } 187 | 188 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Logic-2017-07-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.Logic/workflows 7 | * 8 | * @schema Microsoft.Logic.workflows 9 | */ 10 | export class Workflows extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.Logic.workflows" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: WorkflowsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'workflows', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.Logic/workflows 27 | * 28 | * @schema Microsoft.Logic.workflows 29 | */ 30 | export interface WorkflowsOptions { 31 | /** 32 | * @schema Microsoft.Logic.workflows#type 33 | */ 34 | readonly type: MicrosoftLogicWorkflowsType; 35 | 36 | /** 37 | * @schema Microsoft.Logic.workflows#apiVersion 38 | */ 39 | readonly apiVersion?: MicrosoftLogicWorkflowsApiVersion; 40 | 41 | /** 42 | * The resource id. 43 | * 44 | * @schema Microsoft.Logic.workflows#id 45 | */ 46 | readonly id?: string; 47 | 48 | /** 49 | * Gets the resource name. 50 | * 51 | * @schema Microsoft.Logic.workflows#name 52 | */ 53 | readonly name?: string; 54 | 55 | /** 56 | * The resource location. 57 | * 58 | * @schema Microsoft.Logic.workflows#location 59 | */ 60 | readonly location?: string; 61 | 62 | /** 63 | * The resource tags. 64 | * 65 | * @schema Microsoft.Logic.workflows#tags 66 | */ 67 | readonly tags?: { [key: string]: string }; 68 | 69 | /** 70 | * The workflow properties. 71 | * 72 | * @schema Microsoft.Logic.workflows#properties 73 | */ 74 | readonly properties: WorkflowProperties; 75 | 76 | } 77 | 78 | export enum MicrosoftLogicWorkflowsType { 79 | "MicrosoftLogicWorkflowsType_MICROSOFT_LOGIC_WORKFLOWS" = 'Microsoft.Logic/workflows', 80 | } 81 | 82 | export enum MicrosoftLogicWorkflowsApiVersion { 83 | "MicrosoftLogicWorkflowsApiVersion_2017_07_01" = '2017-07-01', 84 | } 85 | 86 | /** 87 | * @schema #/definitions/WorkflowProperties 88 | */ 89 | export interface WorkflowProperties { 90 | /** 91 | * The state. 92 | * 93 | * @schema #/definitions/WorkflowProperties#state 94 | */ 95 | readonly state?: WorkflowPropertiesState; 96 | 97 | /** 98 | * The integration account. 99 | * 100 | * @schema #/definitions/WorkflowProperties#integrationAccount 101 | */ 102 | readonly integrationAccount?: ResourceReference; 103 | 104 | /** 105 | * The definition. 106 | * 107 | * @schema #/definitions/WorkflowProperties#definition 108 | */ 109 | readonly definition?: any; 110 | 111 | /** 112 | * The parameters. 113 | * 114 | * @schema #/definitions/WorkflowProperties#parameters 115 | */ 116 | readonly parameters?: { [key: string]: WorkflowParameter }; 117 | 118 | } 119 | 120 | export enum WorkflowPropertiesState { 121 | NOT_SPECIFIED = 'NotSpecified', 122 | COMPLETED = 'Completed', 123 | ENABLED = 'Enabled', 124 | DISABLED = 'Disabled', 125 | DELETED = 'Deleted', 126 | SUSPENDED = 'Suspended', 127 | } 128 | 129 | /** 130 | * @schema #/definitions/ResourceReference 131 | */ 132 | export interface ResourceReference { 133 | /** 134 | * The resource id. 135 | * 136 | * @schema #/definitions/ResourceReference#id 137 | */ 138 | readonly id?: string; 139 | 140 | } 141 | 142 | /** 143 | * @schema #/definitions/WorkflowParameter 144 | */ 145 | export interface WorkflowParameter { 146 | /** 147 | * The type. 148 | * 149 | * @schema #/definitions/WorkflowParameter#type 150 | */ 151 | readonly type?: WorkflowParameterType; 152 | 153 | /** 154 | * The value. 155 | * 156 | * @schema #/definitions/WorkflowParameter#value 157 | */ 158 | readonly value?: any; 159 | 160 | /** 161 | * The metadata. 162 | * 163 | * @schema #/definitions/WorkflowParameter#metadata 164 | */ 165 | readonly metadata?: any; 166 | 167 | /** 168 | * The description. 169 | * 170 | * @schema #/definitions/WorkflowParameter#description 171 | */ 172 | readonly description?: string; 173 | 174 | } 175 | 176 | export enum WorkflowParameterType { 177 | NOT_SPECIFIED = 'NotSpecified', 178 | STRING = 'String', 179 | SECURE_STRING = 'SecureString', 180 | INT = 'Int', 181 | FLOAT = 'Float', 182 | BOOL = 'Bool', 183 | ARRAY = 'Array', 184 | OBJECT = 'Object', 185 | SECURE_OBJECT = 'SecureObject', 186 | } 187 | 188 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/PolicyInsights-2021-01-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.PolicyInsights/attestations 7 | * 8 | * @schema Microsoft.PolicyInsights.attestations 9 | */ 10 | export class Attestations extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.PolicyInsights.attestations" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: AttestationsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'attestations', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.PolicyInsights/attestations 27 | * 28 | * @schema Microsoft.PolicyInsights.attestations 29 | */ 30 | export interface AttestationsOptions { 31 | /** 32 | * @schema Microsoft.PolicyInsights.attestations#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftPolicyInsightsAttestationsApiVersion; 35 | 36 | /** 37 | * The name of the attestation. 38 | * 39 | * @schema Microsoft.PolicyInsights.attestations#name 40 | */ 41 | readonly name: string; 42 | 43 | /** 44 | * The properties of an attestation resource. 45 | * 46 | * @schema Microsoft.PolicyInsights.attestations#properties 47 | */ 48 | readonly properties: AttestationProperties; 49 | 50 | /** 51 | * @schema Microsoft.PolicyInsights.attestations#type 52 | */ 53 | readonly type: MicrosoftPolicyInsightsAttestationsType; 54 | 55 | } 56 | 57 | export enum MicrosoftPolicyInsightsAttestationsApiVersion { 58 | "MicrosoftPolicyInsightsAttestationsApiVersion_2021_01_01" = '2021-01-01', 59 | } 60 | 61 | /** 62 | * The properties of an attestation resource. 63 | * 64 | * @schema #/definitions/AttestationProperties 65 | */ 66 | export interface AttestationProperties { 67 | /** 68 | * Comments describing why this attestation was created. 69 | * 70 | * @schema #/definitions/AttestationProperties#comments 71 | */ 72 | readonly comments?: string; 73 | 74 | /** 75 | * The compliance state that should be set on the resource. 76 | * 77 | * @schema #/definitions/AttestationProperties#complianceState 78 | */ 79 | readonly complianceState?: AttestationPropertiesComplianceState; 80 | 81 | /** 82 | * The evidence supporting the compliance state set in this attestation. 83 | * 84 | * @schema #/definitions/AttestationProperties#evidence 85 | */ 86 | readonly evidence?: AttestationEvidence[]; 87 | 88 | /** 89 | * The time the compliance state should expire. 90 | * 91 | * @schema #/definitions/AttestationProperties#expiresOn 92 | */ 93 | readonly expiresOn?: Date; 94 | 95 | /** 96 | * The person responsible for setting the state of the resource. This value is typically an Azure Active Directory object ID. 97 | * 98 | * @schema #/definitions/AttestationProperties#owner 99 | */ 100 | readonly owner?: string; 101 | 102 | /** 103 | * The resource ID of the policy assignment that the attestation is setting the state for. 104 | * 105 | * @schema #/definitions/AttestationProperties#policyAssignmentId 106 | */ 107 | readonly policyAssignmentId: string; 108 | 109 | /** 110 | * The policy definition reference ID from a policy set definition that the attestation is setting the state for. If the policy assignment assigns a policy set definition the attestation can choose a definition within the set definition with this property or omit this and set the state for the entire set definition. 111 | * 112 | * @schema #/definitions/AttestationProperties#policyDefinitionReferenceId 113 | */ 114 | readonly policyDefinitionReferenceId?: string; 115 | 116 | } 117 | 118 | export enum MicrosoftPolicyInsightsAttestationsType { 119 | "MicrosoftPolicyInsightsAttestationsType_MICROSOFT_POLICY_INSIGHTS_ATTESTATIONS" = 'Microsoft.PolicyInsights/attestations', 120 | } 121 | 122 | export enum AttestationPropertiesComplianceState { 123 | COMPLIANT = 'Compliant', 124 | NON_COMPLIANT = 'NonCompliant', 125 | UNKNOWN = 'Unknown', 126 | } 127 | 128 | /** 129 | * A piece of evidence supporting the compliance state set in the attestation. 130 | * 131 | * @schema #/definitions/AttestationEvidence 132 | */ 133 | export interface AttestationEvidence { 134 | /** 135 | * The description for this piece of evidence. 136 | * 137 | * @schema #/definitions/AttestationEvidence#description 138 | */ 139 | readonly description?: string; 140 | 141 | /** 142 | * The URI location of the evidence. 143 | * 144 | * @schema #/definitions/AttestationEvidence#sourceUri 145 | */ 146 | readonly sourceUri?: string; 147 | 148 | } 149 | 150 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/AlertsManagement-2021-04-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * microsoft.alertsManagement/smartDetectorAlertRules 7 | * 8 | * @schema microsoft.alertsManagement.smartDetectorAlertRules 9 | */ 10 | export class SmartDetectorAlertRules extends ArmResource { 11 | /** 12 | * Defines a "microsoft.alertsManagement.smartDetectorAlertRules" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: SmartDetectorAlertRulesOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'smartDetectorAlertRules', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * microsoft.alertsManagement/smartDetectorAlertRules 27 | * 28 | * @schema microsoft.alertsManagement.smartDetectorAlertRules 29 | */ 30 | export interface SmartDetectorAlertRulesOptions { 31 | /** 32 | * @schema microsoft.alertsManagement.smartDetectorAlertRules#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftAlertsManagementSmartDetectorAlertRulesApiVersion; 35 | 36 | /** 37 | * The resource location. 38 | * 39 | * @schema microsoft.alertsManagement.smartDetectorAlertRules#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * The name of the alert rule. 45 | * 46 | * @schema microsoft.alertsManagement.smartDetectorAlertRules#name 47 | */ 48 | readonly name: string; 49 | 50 | /** 51 | * The alert rule properties. 52 | * 53 | * @schema microsoft.alertsManagement.smartDetectorAlertRules#properties 54 | */ 55 | readonly properties: AlertRuleProperties; 56 | 57 | /** 58 | * The resource tags. 59 | * 60 | * @schema microsoft.alertsManagement.smartDetectorAlertRules#tags 61 | */ 62 | readonly tags?: MicrosoftAlertsManagementSmartDetectorAlertRulesTags; 63 | 64 | /** 65 | * @schema microsoft.alertsManagement.smartDetectorAlertRules#type 66 | */ 67 | readonly type: MicrosoftAlertsManagementSmartDetectorAlertRulesType; 68 | 69 | } 70 | 71 | export enum MicrosoftAlertsManagementSmartDetectorAlertRulesApiVersion { 72 | "MicrosoftAlertsManagementSmartDetectorAlertRulesApiVersion_2021_04_01" = '2021-04-01', 73 | } 74 | 75 | /** 76 | * The alert rule properties. 77 | * 78 | * @schema #/definitions/AlertRuleProperties 79 | */ 80 | export interface AlertRuleProperties { 81 | /** 82 | * The Action Groups information, used by the alert rule. 83 | * 84 | * @schema #/definitions/AlertRuleProperties#actionGroups 85 | */ 86 | readonly actionGroups: ActionGroupsInformation; 87 | 88 | /** 89 | * The alert rule description. 90 | * 91 | * @schema #/definitions/AlertRuleProperties#description 92 | */ 93 | readonly description?: string; 94 | 95 | /** 96 | * The detector information. By default this is not populated, unless it's specified in expandDetector 97 | * 98 | * @schema #/definitions/AlertRuleProperties#detector 99 | */ 100 | readonly detector: Detector; 101 | 102 | /** 103 | * The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector. 104 | * 105 | * @schema #/definitions/AlertRuleProperties#frequency 106 | */ 107 | readonly frequency: string; 108 | 109 | /** 110 | * The alert rule resources scope. 111 | * 112 | * @schema #/definitions/AlertRuleProperties#scope 113 | */ 114 | readonly scope: string[]; 115 | 116 | /** 117 | * The alert rule severity. 118 | * 119 | * @schema #/definitions/AlertRuleProperties#severity 120 | */ 121 | readonly severity: AlertRulePropertiesSeverity; 122 | 123 | /** 124 | * The alert rule state. 125 | * 126 | * @schema #/definitions/AlertRuleProperties#state 127 | */ 128 | readonly state: AlertRulePropertiesState; 129 | 130 | /** 131 | * Optional throttling information for the alert rule. 132 | * 133 | * @schema #/definitions/AlertRuleProperties#throttling 134 | */ 135 | readonly throttling?: ThrottlingInformation; 136 | 137 | } 138 | 139 | /** 140 | * @schema MicrosoftAlertsManagementSmartDetectorAlertRulesTags 141 | */ 142 | export interface MicrosoftAlertsManagementSmartDetectorAlertRulesTags { 143 | } 144 | 145 | export enum MicrosoftAlertsManagementSmartDetectorAlertRulesType { 146 | "MicrosoftAlertsManagementSmartDetectorAlertRulesType_MICROSOFT_ALERTS_MANAGEMENT_SMART_DETECTOR_ALERT_RULES" = 'microsoft.alertsManagement/smartDetectorAlertRules', 147 | } 148 | 149 | /** 150 | * The Action Groups information, used by the alert rule. 151 | * 152 | * @schema #/definitions/ActionGroupsInformation 153 | */ 154 | export interface ActionGroupsInformation { 155 | /** 156 | * An optional custom email subject to use in email notifications. 157 | * 158 | * @schema #/definitions/ActionGroupsInformation#customEmailSubject 159 | */ 160 | readonly customEmailSubject?: string; 161 | 162 | /** 163 | * An optional custom web-hook payload to use in web-hook notifications. 164 | * 165 | * @schema #/definitions/ActionGroupsInformation#customWebhookPayload 166 | */ 167 | readonly customWebhookPayload?: string; 168 | 169 | /** 170 | * The Action Group resource IDs. 171 | * 172 | * @schema #/definitions/ActionGroupsInformation#groupIds 173 | */ 174 | readonly groupIds: string[]; 175 | 176 | } 177 | 178 | /** 179 | * The detector information. By default this is not populated, unless it's specified in expandDetector 180 | * 181 | * @schema #/definitions/Detector 182 | */ 183 | export interface Detector { 184 | /** 185 | * The detector id. 186 | * 187 | * @schema #/definitions/Detector#id 188 | */ 189 | readonly id: string; 190 | 191 | /** 192 | * The detector's parameters.' 193 | * 194 | * @schema #/definitions/Detector#parameters 195 | */ 196 | readonly parameters?: DetectorParameters; 197 | 198 | } 199 | 200 | export enum AlertRulePropertiesSeverity { 201 | "AlertRulePropertiesSeverity_SEV0" = 'Sev0', 202 | "AlertRulePropertiesSeverity_SEV1" = 'Sev1', 203 | "AlertRulePropertiesSeverity_SEV2" = 'Sev2', 204 | "AlertRulePropertiesSeverity_SEV3" = 'Sev3', 205 | "AlertRulePropertiesSeverity_SEV4" = 'Sev4', 206 | } 207 | 208 | export enum AlertRulePropertiesState { 209 | ENABLED = 'Enabled', 210 | DISABLED = 'Disabled', 211 | } 212 | 213 | /** 214 | * Optional throttling information for the alert rule. 215 | * 216 | * @schema #/definitions/ThrottlingInformation 217 | */ 218 | export interface ThrottlingInformation { 219 | /** 220 | * The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time granularity must be in minutes and minimum value is 0 minutes 221 | * 222 | * @schema #/definitions/ThrottlingInformation#duration 223 | */ 224 | readonly duration?: string; 225 | 226 | } 227 | 228 | /** 229 | * @schema #/definitions/detectorParameters 230 | */ 231 | export interface DetectorParameters { 232 | } 233 | 234 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Advisor-2020-01-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.Advisor/configurations 7 | * 8 | * @schema Microsoft.Advisor.configurations 9 | */ 10 | export class Configurations extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.Advisor.configurations" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ConfigurationsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'configurations', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.Advisor/suppressions 27 | * 28 | * @schema Microsoft.Advisor.recommendations_suppressions 29 | */ 30 | export class RecommendationsSuppressions extends ArmResource { 31 | /** 32 | * Defines a "Microsoft.Advisor.recommendations_suppressions" Arm Template object 33 | * @param scope the scope in which to define this object 34 | * @param name a scope-local name for the object 35 | * @param options configuration options 36 | */ 37 | public constructor(scope: Construct, name: string, options: RecommendationsSuppressionsOptions) { 38 | super(scope, name, { 39 | ...options, 40 | armResourceType: 'recommendations_suppressions', 41 | }); 42 | } 43 | } 44 | 45 | /** 46 | * Microsoft.Advisor/configurations 47 | * 48 | * @schema Microsoft.Advisor.configurations 49 | */ 50 | export interface ConfigurationsOptions { 51 | /** 52 | * @schema Microsoft.Advisor.configurations#apiVersion 53 | */ 54 | readonly apiVersion?: MicrosoftAdvisorConfigurationsApiVersion; 55 | 56 | /** 57 | * Advisor configuration name. Value must be 'default' 58 | * 59 | * @schema Microsoft.Advisor.configurations#name 60 | */ 61 | readonly name: MicrosoftAdvisorConfigurationsName; 62 | 63 | /** 64 | * Configuration data properties 65 | * 66 | * @schema Microsoft.Advisor.configurations#properties 67 | */ 68 | readonly properties: ConfigDataProperties; 69 | 70 | /** 71 | * @schema Microsoft.Advisor.configurations#type 72 | */ 73 | readonly type: MicrosoftAdvisorConfigurationsType; 74 | 75 | } 76 | 77 | /** 78 | * Microsoft.Advisor/suppressions 79 | * 80 | * @schema Microsoft.Advisor.recommendations_suppressions 81 | */ 82 | export interface RecommendationsSuppressionsOptions { 83 | /** 84 | * @schema Microsoft.Advisor.recommendations_suppressions#apiVersion 85 | */ 86 | readonly apiVersion?: MicrosoftAdvisorRecommendationsSuppressionsApiVersion; 87 | 88 | /** 89 | * The name of the suppression. 90 | * 91 | * @schema Microsoft.Advisor.recommendations_suppressions#name 92 | */ 93 | readonly name: string; 94 | 95 | /** 96 | * The properties of the suppression. 97 | * 98 | * @schema Microsoft.Advisor.recommendations_suppressions#properties 99 | */ 100 | readonly properties: SuppressionProperties; 101 | 102 | /** 103 | * @schema Microsoft.Advisor.recommendations_suppressions#type 104 | */ 105 | readonly type: MicrosoftAdvisorRecommendationsSuppressionsType; 106 | 107 | } 108 | 109 | export enum MicrosoftAdvisorConfigurationsApiVersion { 110 | "MicrosoftAdvisorConfigurationsApiVersion_2020_01_01" = '2020-01-01', 111 | } 112 | 113 | export enum MicrosoftAdvisorConfigurationsName { 114 | DEFAULT = 'default', 115 | } 116 | 117 | /** 118 | * Configuration data properties 119 | * 120 | * @schema #/definitions/ConfigDataProperties 121 | */ 122 | export interface ConfigDataProperties { 123 | /** 124 | * Advisor digest configuration. Valid only for subscriptions 125 | * 126 | * @schema #/definitions/ConfigDataProperties#digests 127 | */ 128 | readonly digests?: DigestConfig[]; 129 | 130 | /** 131 | * Exclude the resource from Advisor evaluations. Valid values: False (default) or True. 132 | * 133 | * @schema #/definitions/ConfigDataProperties#exclude 134 | */ 135 | readonly exclude?: boolean; 136 | 137 | /** 138 | * Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid values: 5 (default), 10, 15 or 20. 139 | * 140 | * @schema #/definitions/ConfigDataProperties#lowCpuThreshold 141 | */ 142 | readonly lowCpuThreshold?: ConfigDataPropertiesLowCpuThreshold; 143 | 144 | } 145 | 146 | export enum MicrosoftAdvisorConfigurationsType { 147 | "MicrosoftAdvisorConfigurationsType_MICROSOFT_ADVISOR_CONFIGURATIONS" = 'Microsoft.Advisor/configurations', 148 | } 149 | 150 | export enum MicrosoftAdvisorRecommendationsSuppressionsApiVersion { 151 | "MicrosoftAdvisorRecommendationsSuppressionsApiVersion_2020_01_01" = '2020-01-01', 152 | } 153 | 154 | /** 155 | * The properties of the suppression. 156 | * 157 | * @schema #/definitions/SuppressionProperties 158 | */ 159 | export interface SuppressionProperties { 160 | /** 161 | * The GUID of the suppression. 162 | * 163 | * @schema #/definitions/SuppressionProperties#suppressionId 164 | */ 165 | readonly suppressionId?: string; 166 | 167 | /** 168 | * The duration for which the suppression is valid. 169 | * 170 | * @schema #/definitions/SuppressionProperties#ttl 171 | */ 172 | readonly ttl?: string; 173 | 174 | } 175 | 176 | export enum MicrosoftAdvisorRecommendationsSuppressionsType { 177 | "MicrosoftAdvisorRecommendationsSuppressionsType_MICROSOFT_ADVISOR_SUPPRESSIONS" = 'Microsoft.Advisor/suppressions', 178 | } 179 | 180 | /** 181 | * Advisor Digest configuration entity 182 | * 183 | * @schema #/definitions/DigestConfig 184 | */ 185 | export interface DigestConfig { 186 | /** 187 | * Action group resource id used by digest. 188 | * 189 | * @schema #/definitions/DigestConfig#actionGroupResourceId 190 | */ 191 | readonly actionGroupResourceId?: string; 192 | 193 | /** 194 | * Categories to send digest for. If categories are not provided, then digest will be sent for all categories. 195 | * 196 | * @schema #/definitions/DigestConfig#categories 197 | */ 198 | readonly categories?: DigestConfigCategories[]; 199 | 200 | /** 201 | * Frequency that digest will be triggered, in days. Value must be between 7 and 30 days inclusive. 202 | * 203 | * @schema #/definitions/DigestConfig#frequency 204 | */ 205 | readonly frequency?: number; 206 | 207 | /** 208 | * Language for digest content body. Value must be ISO 639-1 code for one of Azure portal supported languages. Otherwise, it will be converted into one. Default value is English (en). 209 | * 210 | * @schema #/definitions/DigestConfig#language 211 | */ 212 | readonly language?: string; 213 | 214 | /** 215 | * Name of digest configuration. Value is case-insensitive and must be unique within a subscription. 216 | * 217 | * @schema #/definitions/DigestConfig#name 218 | */ 219 | readonly name?: string; 220 | 221 | /** 222 | * State of digest configuration. 223 | * 224 | * @schema #/definitions/DigestConfig#state 225 | */ 226 | readonly state?: DigestConfigState; 227 | 228 | } 229 | 230 | export enum ConfigDataPropertiesLowCpuThreshold { 231 | "ConfigDataPropertiesLowCpuThreshold_5" = '5', 232 | "ConfigDataPropertiesLowCpuThreshold_10" = '10', 233 | "ConfigDataPropertiesLowCpuThreshold_15" = '15', 234 | "ConfigDataPropertiesLowCpuThreshold_20" = '20', 235 | } 236 | 237 | export enum DigestConfigCategories { 238 | HIGH_AVAILABILITY = 'HighAvailability', 239 | SECURITY = 'Security', 240 | PERFORMANCE = 'Performance', 241 | COST = 'Cost', 242 | OPERATIONAL_EXCELLENCE = 'OperationalExcellence', 243 | } 244 | 245 | export enum DigestConfigState { 246 | ACTIVE = 'Active', 247 | DISABLED = 'Disabled', 248 | } 249 | 250 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Armkit (Azure Cloud Development Kit) 2 | 3 | - [Armkit (Azure Cloud Development Kit)](#armkit-azure-cloud-development-kit) 4 | - [Badges](#badges) 5 | - [Contributing and Feedback](#contributing-and-feedback) 6 | - [Summary](#summary) 7 | - [Background](#background) 8 | - [Examples](#examples) 9 | - [**`helloArmkit.ts`**](#helloarmkitts) 10 | - [Building](#building) 11 | - [Roadmap](#roadmap) 12 | - [License](#license) 13 | 14 | ## Badges 15 | 16 | [![Build](https://github.com/Yetics/armkit/actions/workflows/test-build.yml/badge.svg)](https://github.com/Yetics/armkit/actions/workflows/test-build.yml) 17 | [![npm version](https://badge.fury.io/js/%40yetics%2Farmkit-core.svg)](https://badge.fury.io/js/%40yetics%2Farmkit-core) 18 | 19 | ## Contributing and Feedback 20 | 21 | CDK for Azure is an early experimental project and the development folks would love your feedback to help guide the project. 22 | 23 | - Report a [bug](https://github.com/yetics/armkit/issues/new?assignees=&labels=bug&template=bug-report.md&title=) 24 | - Request a new [feature](https://github.com/yetics/armkit/issues/new?assignees=&labels=enhancement&template=feature-request.md&title=). 25 | - Browse all [open issues](https://github.com/yetics/armkit/issues). 26 | - Public [roadmap](https://github.com/yetics/armkit/projects/1). 27 | - Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/armkit) and tag it with `armkit` 28 | - Come join the Armkit community on [Slack](https://cdk-dev.slack.com/archives/C01QBE1A3RC) 29 | 30 | We welcome community contributions and pull requests. See [CONTRIBUTING](./CONTRIBUTING.md) for information on how to set up a development environment and submit code. 31 | 32 | ## Summary 33 | 34 | `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`. 35 | 36 | 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. 37 | 38 | `Armkit` is available in the following languages: 39 | 40 | - JavaScript/TypeScript ([Node.js ≥ 12.17.0](https://nodejs.org/download/release/latest-v12.x/)) 41 | 42 | ## Background 43 | 44 | Developers use the `Armkit` framework in one of the supported programming 45 | languages to define reusable cloud components called `constructs`, which 46 | are composed together into `stacks`, forming an "`Armkit` app". 47 | 48 | They then use the [Armkit CLI](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. 49 | 50 | The [Armkit Construct Library](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. 51 | 52 | Armkit packages: 53 | 54 | - [@armkit/core](https://www.npmjs.com/package/@yetics/armkit-core) - A library that allows users to build Azure applications contructs. 55 | - [armkit-resources](https://www.npmjs.com/package/@yetics/armkit-resources) - A library for defining Azure resources using programming constructs. 56 | - [armkit-cli](https://www.npmjs.com/package/@yetics/armkit-cli) - A CLI that allows users to run commands to initialize, import, and synthesize `Armkit` applications. 57 | 58 | ## Examples 59 | 60 | Some sample `constructs` are in [examples](./examples/basic/README.md). This could look like this: 61 | 62 | ### **`helloArmkit.ts`** 63 | 64 | ```ts 65 | import { Construct } from "constructs"; 66 | import { App, ArmStack } from "@yetics/armkit-core"; 67 | import { 68 | ContainerGroups, 69 | ContainerGroupPropertiesOsType, 70 | MicrosoftContainerInstanceContainerGroupsType, 71 | MicrosoftContainerInstanceContainerGroupsApiVersion, 72 | } from "./.generated/ContainerInstance-2021-03-01"; 73 | import { 74 | Registries, 75 | MicrosoftContainerRegistryRegistriesApiVersion, 76 | MicrosoftContainerRegistryRegistriesType, 77 | SkuName, 78 | } from "./.generated/ContainerRegistry-2019-05-01"; 79 | 80 | export class HelloArmkit extends ArmStack { 81 | constructor(scope: Construct, id: string) { 82 | super(scope, id); 83 | 84 | new ContainerGroups(this, "MyContainerGroup", { 85 | name: "azurecdktest", 86 | location: "westeurope", 87 | apiVersion: 88 | MicrosoftContainerInstanceContainerGroupsApiVersion["2021_03_01"], 89 | type: 90 | MicrosoftContainerInstanceContainerGroupsType.MICROSOFT_CONTAINER_INSTANCE_CONTAINER_GROUPS, 91 | properties: { 92 | containers: [ 93 | { 94 | name: "ubuntu-server", 95 | properties: { 96 | image: "ubuntu:18.04", 97 | command: ["sleep infinity"], 98 | resources: { 99 | requests: { 100 | cpu: 1, 101 | memoryInGB: 2, 102 | }, 103 | limits: { 104 | cpu: 1, 105 | memoryInGB: 2, 106 | }, 107 | }, 108 | }, 109 | }, 110 | ], 111 | osType: ContainerGroupPropertiesOsType.LINUX, 112 | }, 113 | }); 114 | 115 | new Registries(this, "azurecdktest", { 116 | name: "azurecdktest", 117 | location: "westeurope", 118 | apiVersion: MicrosoftContainerRegistryRegistriesApiVersion["2019_05_01"], 119 | type: 120 | MicrosoftContainerRegistryRegistriesType.MICROSOFT_CONTAINER_REGISTRY_REGISTRIES, 121 | sku: { 122 | name: SkuName.BASIC, 123 | }, 124 | properties: { 125 | adminUserEnabled: false, 126 | }, 127 | }); 128 | } 129 | } 130 | 131 | const app = new App({ outdir: "cdk.out" }); 132 | new HelloArmkit(app, "hello-armkit"); 133 | app.synth(); 134 | ``` 135 | 136 | For a detailed walk through, see the Armkit [Developer Guide](./CONTRIBUTING.md). 137 | 138 | ## Building 139 | 140 | Clone the project repository 141 | 142 | ```bash 143 | git clone https://github.com/Yetics/armkit.git 144 | ``` 145 | 146 | Download dependencies and build node.js 147 | 148 | ```bash 149 | cd armkit/ 150 | yarn install 151 | yarn build 152 | ``` 153 | 154 | Build the `examples/basic` package: 155 | 156 | Go to `examples/basic`: 157 | 158 | ```bash 159 | cd /examples/basic 160 | ``` 161 | 162 | Generate the `armkit cdk` libs: 163 | 164 | ```bash 165 | yarn generate 166 | ``` 167 | 168 | Translate `typescript` to `node.js`: 169 | 170 | ```bash 171 | yarn build 172 | ``` 173 | 174 | Render ARM template from CDK: 175 | 176 | ```bash 177 | node index.js 178 | ``` 179 | 180 | Check out the results: 181 | 182 | ```bash 183 | az deployment group create --resource-group --template-file @cdk-out/helloarmkit.json 184 | ``` 185 | 186 | ## Roadmap 187 | 188 | The [Armkit Roadmap project board](https://github.com/Yetics/armkit/projects) lets developers know about our upcoming 189 | features and priorities to help them plan how to best leverage `Armkit`and identify opportunities to contribute to the project. See [ROADMAP](./ROADMAP.md) for more information and FAQs. 190 | 191 | - `Armkit` Roadmap project board: https://github.com/Armkit/armkit/projects/1 192 | - Roadmap: https://github.com/Armkit/armkit/ROADMAP.md 193 | 194 | ## License 195 | 196 | `Armkit` is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). 197 | 198 | See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for more information. 199 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/AzureStack-2017-06-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.AzureStack/registrations 7 | * 8 | * @schema Microsoft.AzureStack.registrations 9 | */ 10 | export class Registrations extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.AzureStack.registrations" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: RegistrationsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'registrations', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.AzureStack/registrations/customerSubscriptions 27 | * 28 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions 29 | */ 30 | export class RegistrationsCustomerSubscriptions extends ArmResource { 31 | /** 32 | * Defines a "Microsoft.AzureStack.registrations_customerSubscriptions" Arm Template object 33 | * @param scope the scope in which to define this object 34 | * @param name a scope-local name for the object 35 | * @param options configuration options 36 | */ 37 | public constructor(scope: Construct, name: string, options: RegistrationsCustomerSubscriptionsOptions) { 38 | super(scope, name, { 39 | ...options, 40 | armResourceType: 'registrations_customerSubscriptions', 41 | }); 42 | } 43 | } 44 | 45 | /** 46 | * Microsoft.AzureStack/registrations 47 | * 48 | * @schema Microsoft.AzureStack.registrations 49 | */ 50 | export interface RegistrationsOptions { 51 | /** 52 | * @schema Microsoft.AzureStack.registrations#apiVersion 53 | */ 54 | readonly apiVersion?: MicrosoftAzureStackRegistrationsApiVersion; 55 | 56 | /** 57 | * Location of the resource. 58 | * 59 | * @schema Microsoft.AzureStack.registrations#location 60 | */ 61 | readonly location: MicrosoftAzureStackRegistrationsLocation; 62 | 63 | /** 64 | * Name of the Azure Stack registration. 65 | * 66 | * @schema Microsoft.AzureStack.registrations#name 67 | */ 68 | readonly name: string; 69 | 70 | /** 71 | * Properties of the Azure Stack registration resource 72 | * 73 | * @schema Microsoft.AzureStack.registrations#properties 74 | */ 75 | readonly properties: RegistrationParameterProperties; 76 | 77 | /** 78 | * @schema Microsoft.AzureStack.registrations#resources 79 | */ 80 | readonly resources?: RegistrationsCustomerSubscriptionsChildResource[]; 81 | 82 | /** 83 | * @schema Microsoft.AzureStack.registrations#type 84 | */ 85 | readonly type: MicrosoftAzureStackRegistrationsType; 86 | 87 | } 88 | 89 | /** 90 | * Microsoft.AzureStack/registrations/customerSubscriptions 91 | * 92 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions 93 | */ 94 | export interface RegistrationsCustomerSubscriptionsOptions { 95 | /** 96 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions#apiVersion 97 | */ 98 | readonly apiVersion?: MicrosoftAzureStackRegistrationsCustomerSubscriptionsApiVersion; 99 | 100 | /** 101 | * The entity tag used for optimistic concurrency when modifying the resource. 102 | * 103 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions#etag 104 | */ 105 | readonly etag?: string; 106 | 107 | /** 108 | * Name of the product. 109 | * 110 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions#name 111 | */ 112 | readonly name: string; 113 | 114 | /** 115 | * Customer subscription properties. 116 | * 117 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions#properties 118 | */ 119 | readonly properties: CustomerSubscriptionProperties; 120 | 121 | /** 122 | * @schema Microsoft.AzureStack.registrations_customerSubscriptions#type 123 | */ 124 | readonly type: MicrosoftAzureStackRegistrationsCustomerSubscriptionsType; 125 | 126 | } 127 | 128 | export enum MicrosoftAzureStackRegistrationsApiVersion { 129 | "MicrosoftAzureStackRegistrationsApiVersion_2017_06_01" = '2017-06-01', 130 | } 131 | 132 | export enum MicrosoftAzureStackRegistrationsLocation { 133 | GLOBAL = 'global', 134 | } 135 | 136 | /** 137 | * Properties of the Azure Stack registration resource 138 | * 139 | * @schema #/definitions/RegistrationParameterProperties 140 | */ 141 | export interface RegistrationParameterProperties { 142 | /** 143 | * The token identifying registered Azure Stack 144 | * 145 | * @schema #/definitions/RegistrationParameterProperties#registrationToken 146 | */ 147 | readonly registrationToken: string; 148 | 149 | } 150 | 151 | /** 152 | * Microsoft.AzureStack/registrations/customerSubscriptions 153 | * 154 | * @schema #/definitions/registrations_customerSubscriptions_childResource 155 | */ 156 | export interface RegistrationsCustomerSubscriptionsChildResource { 157 | /** 158 | * @schema #/definitions/registrations_customerSubscriptions_childResource#apiVersion 159 | */ 160 | readonly apiVersion: RegistrationsCustomerSubscriptionsChildResourceApiVersion; 161 | 162 | /** 163 | * The entity tag used for optimistic concurrency when modifying the resource. 164 | * 165 | * @schema #/definitions/registrations_customerSubscriptions_childResource#etag 166 | */ 167 | readonly etag?: string; 168 | 169 | /** 170 | * Name of the product. 171 | * 172 | * @schema #/definitions/registrations_customerSubscriptions_childResource#name 173 | */ 174 | readonly name: string; 175 | 176 | /** 177 | * Customer subscription properties. 178 | * 179 | * @schema #/definitions/registrations_customerSubscriptions_childResource#properties 180 | */ 181 | readonly properties: CustomerSubscriptionProperties; 182 | 183 | /** 184 | * @schema #/definitions/registrations_customerSubscriptions_childResource#type 185 | */ 186 | readonly type: RegistrationsCustomerSubscriptionsChildResourceType; 187 | 188 | } 189 | 190 | export enum MicrosoftAzureStackRegistrationsType { 191 | "MicrosoftAzureStackRegistrationsType_MICROSOFT_AZURE_STACK_REGISTRATIONS" = 'Microsoft.AzureStack/registrations', 192 | } 193 | 194 | export enum MicrosoftAzureStackRegistrationsCustomerSubscriptionsApiVersion { 195 | "MicrosoftAzureStackRegistrationsCustomerSubscriptionsApiVersion_2017_06_01" = '2017-06-01', 196 | } 197 | 198 | /** 199 | * Customer subscription properties. 200 | * 201 | * @schema #/definitions/CustomerSubscriptionProperties 202 | */ 203 | export interface CustomerSubscriptionProperties { 204 | /** 205 | * Tenant Id. 206 | * 207 | * @schema #/definitions/CustomerSubscriptionProperties#tenantId 208 | */ 209 | readonly tenantId?: string; 210 | 211 | } 212 | 213 | export enum MicrosoftAzureStackRegistrationsCustomerSubscriptionsType { 214 | "MicrosoftAzureStackRegistrationsCustomerSubscriptionsType_MICROSOFT_AZURE_STACK_REGISTRATIONS_CUSTOMER_SUBSCRIPTIONS" = 'Microsoft.AzureStack/registrations/customerSubscriptions', 215 | } 216 | 217 | export enum RegistrationsCustomerSubscriptionsChildResourceApiVersion { 218 | "RegistrationsCustomerSubscriptionsChildResourceApiVersion_2017_06_01" = '2017-06-01', 219 | } 220 | 221 | export enum RegistrationsCustomerSubscriptionsChildResourceType { 222 | CUSTOMER_SUBSCRIPTIONS = 'customerSubscriptions', 223 | } 224 | 225 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/AnalysisServices-2017-08-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.AnalysisServices/servers 7 | * 8 | * @schema Microsoft.AnalysisServices.servers 9 | */ 10 | export class Servers extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.AnalysisServices.servers" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: ServersOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'servers', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.AnalysisServices/servers 27 | * 28 | * @schema Microsoft.AnalysisServices.servers 29 | */ 30 | export interface ServersOptions { 31 | /** 32 | * @schema Microsoft.AnalysisServices.servers#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftAnalysisServicesServersApiVersion; 35 | 36 | /** 37 | * Location of the Analysis Services resource. 38 | * 39 | * @schema Microsoft.AnalysisServices.servers#location 40 | */ 41 | readonly location: string; 42 | 43 | /** 44 | * The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. 45 | * 46 | * @schema Microsoft.AnalysisServices.servers#name 47 | */ 48 | readonly name: MicrosoftAnalysisServicesServersNamePattern; 49 | 50 | /** 51 | * Properties of Analysis Services resource. 52 | * 53 | * @schema Microsoft.AnalysisServices.servers#properties 54 | */ 55 | readonly properties: AnalysisServicesServerProperties; 56 | 57 | /** 58 | * Represents the SKU name and Azure pricing tier for Analysis Services resource. 59 | * 60 | * @schema Microsoft.AnalysisServices.servers#sku 61 | */ 62 | readonly sku: ResourceSku; 63 | 64 | /** 65 | * Key-value pairs of additional resource provisioning properties. 66 | * 67 | * @schema Microsoft.AnalysisServices.servers#tags 68 | */ 69 | readonly tags?: MicrosoftAnalysisServicesServersTags; 70 | 71 | /** 72 | * @schema Microsoft.AnalysisServices.servers#type 73 | */ 74 | readonly type: MicrosoftAnalysisServicesServersType; 75 | 76 | } 77 | 78 | export enum MicrosoftAnalysisServicesServersApiVersion { 79 | "MicrosoftAnalysisServicesServersApiVersion_2017_08_01" = '2017-08-01', 80 | } 81 | 82 | /** 83 | * @schema MicrosoftAnalysisServicesServersName 84 | */ 85 | export class MicrosoftAnalysisServicesServersNamePattern { 86 | public static pattern(value: string): string { 87 | return value; 88 | } 89 | } 90 | 91 | /** 92 | * Properties of Analysis Services resource. 93 | * 94 | * @schema #/definitions/AnalysisServicesServerProperties 95 | */ 96 | export interface AnalysisServicesServerProperties { 97 | /** 98 | * An array of administrator user identities. 99 | * 100 | * @schema #/definitions/AnalysisServicesServerProperties#asAdministrators 101 | */ 102 | readonly asAdministrators?: ServerAdministrators; 103 | 104 | /** 105 | * The SAS container URI to the backup container. 106 | * 107 | * @schema #/definitions/AnalysisServicesServerProperties#backupBlobContainerUri 108 | */ 109 | readonly backupBlobContainerUri?: string; 110 | 111 | /** 112 | * The gateway details. 113 | * 114 | * @schema #/definitions/AnalysisServicesServerProperties#gatewayDetails 115 | */ 116 | readonly gatewayDetails?: GatewayDetails; 117 | 118 | /** 119 | * An array of firewall rules. 120 | * 121 | * @schema #/definitions/AnalysisServicesServerProperties#ipV4FirewallSettings 122 | */ 123 | readonly ipV4FirewallSettings?: IPv4FirewallSettings; 124 | 125 | /** 126 | * The managed mode of the server (0 = not managed, 1 = managed). 127 | * 128 | * @schema #/definitions/AnalysisServicesServerProperties#managedMode 129 | */ 130 | readonly managedMode?: number; 131 | 132 | /** 133 | * How the read-write server's participation in the query pool is controlled.
It can have the following values:
  • readOnly - indicates that the read-write server is intended not to participate in query operations
  • all - indicates that the read-write server can participate in query operations
Specifying readOnly when capacity is 1 results in error. 134 | * 135 | * @schema #/definitions/AnalysisServicesServerProperties#querypoolConnectionMode 136 | */ 137 | readonly querypoolConnectionMode?: AnalysisServicesServerPropertiesQuerypoolConnectionMode; 138 | 139 | /** 140 | * The server monitor mode for AS server 141 | * 142 | * @schema #/definitions/AnalysisServicesServerProperties#serverMonitorMode 143 | */ 144 | readonly serverMonitorMode?: number; 145 | 146 | /** 147 | * Represents the SKU name and Azure pricing tier for Analysis Services resource. 148 | * 149 | * @schema #/definitions/AnalysisServicesServerProperties#sku 150 | */ 151 | readonly sku?: ResourceSku; 152 | 153 | } 154 | 155 | /** 156 | * Represents the SKU name and Azure pricing tier for Analysis Services resource. 157 | * 158 | * @schema #/definitions/ResourceSku 159 | */ 160 | export interface ResourceSku { 161 | /** 162 | * The number of instances in the read only query pool. 163 | * 164 | * @schema #/definitions/ResourceSku#capacity 165 | */ 166 | readonly capacity?: number; 167 | 168 | /** 169 | * Name of the SKU level. 170 | * 171 | * @schema #/definitions/ResourceSku#name 172 | */ 173 | readonly name: string; 174 | 175 | /** 176 | * The name of the Azure pricing tier to which the SKU applies. 177 | * 178 | * @schema #/definitions/ResourceSku#tier 179 | */ 180 | readonly tier?: ResourceSkuTier; 181 | 182 | } 183 | 184 | /** 185 | * @schema MicrosoftAnalysisServicesServersTags 186 | */ 187 | export interface MicrosoftAnalysisServicesServersTags { 188 | } 189 | 190 | export enum MicrosoftAnalysisServicesServersType { 191 | "MicrosoftAnalysisServicesServersType_MICROSOFT_ANALYSIS_SERVICES_SERVERS" = 'Microsoft.AnalysisServices/servers', 192 | } 193 | 194 | /** 195 | * An array of administrator user identities. 196 | * 197 | * @schema #/definitions/ServerAdministrators 198 | */ 199 | export interface ServerAdministrators { 200 | /** 201 | * An array of administrator user identities. 202 | * 203 | * @schema #/definitions/ServerAdministrators#members 204 | */ 205 | readonly members?: string[]; 206 | 207 | } 208 | 209 | /** 210 | * The gateway details. 211 | * 212 | * @schema #/definitions/GatewayDetails 213 | */ 214 | export interface GatewayDetails { 215 | /** 216 | * Gateway resource to be associated with the server. 217 | * 218 | * @schema #/definitions/GatewayDetails#gatewayResourceId 219 | */ 220 | readonly gatewayResourceId?: string; 221 | 222 | } 223 | 224 | /** 225 | * An array of firewall rules. 226 | * 227 | * @schema #/definitions/IPv4FirewallSettings 228 | */ 229 | export interface IPv4FirewallSettings { 230 | /** 231 | * The indicator of enabling PBI service. 232 | * 233 | * @schema #/definitions/IPv4FirewallSettings#enablePowerBIService 234 | */ 235 | readonly enablePowerBIService?: boolean; 236 | 237 | /** 238 | * An array of firewall rules. 239 | * 240 | * @schema #/definitions/IPv4FirewallSettings#firewallRules 241 | */ 242 | readonly firewallRules?: IPv4FirewallRule[]; 243 | 244 | } 245 | 246 | export enum AnalysisServicesServerPropertiesQuerypoolConnectionMode { 247 | ALL = 'All', 248 | READ_ONLY = 'ReadOnly', 249 | } 250 | 251 | export enum ResourceSkuTier { 252 | DEVELOPMENT = 'Development', 253 | BASIC = 'Basic', 254 | STANDARD = 'Standard', 255 | } 256 | 257 | /** 258 | * The detail of firewall rule. 259 | * 260 | * @schema #/definitions/IPv4FirewallRule 261 | */ 262 | export interface IPv4FirewallRule { 263 | /** 264 | * The rule name. 265 | * 266 | * @schema #/definitions/IPv4FirewallRule#firewallRuleName 267 | */ 268 | readonly firewallRuleName?: string; 269 | 270 | /** 271 | * The end range of IPv4. 272 | * 273 | * @schema #/definitions/IPv4FirewallRule#rangeEnd 274 | */ 275 | readonly rangeEnd?: string; 276 | 277 | /** 278 | * The start range of IPv4. 279 | * 280 | * @schema #/definitions/IPv4FirewallRule#rangeStart 281 | */ 282 | readonly rangeStart?: string; 283 | 284 | } 285 | 286 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/Maintenance-2021-05-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.Maintenance/maintenanceConfigurations 7 | * 8 | * @schema Microsoft.Maintenance.maintenanceConfigurations 9 | */ 10 | export class MaintenanceConfigurations extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.Maintenance.maintenanceConfigurations" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: MaintenanceConfigurationsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'maintenanceConfigurations', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.Maintenance/maintenanceConfigurations 27 | * 28 | * @schema Microsoft.Maintenance.maintenanceConfigurations 29 | */ 30 | export interface MaintenanceConfigurationsOptions { 31 | /** 32 | * @schema Microsoft.Maintenance.maintenanceConfigurations#apiVersion 33 | */ 34 | readonly apiVersion?: MicrosoftMaintenanceMaintenanceConfigurationsApiVersion; 35 | 36 | /** 37 | * Gets or sets location of the resource 38 | * 39 | * @schema Microsoft.Maintenance.maintenanceConfigurations#location 40 | */ 41 | readonly location?: string; 42 | 43 | /** 44 | * Maintenance Configuration Name 45 | * 46 | * @schema Microsoft.Maintenance.maintenanceConfigurations#name 47 | */ 48 | readonly name: string; 49 | 50 | /** 51 | * Properties for maintenance configuration 52 | * 53 | * @schema Microsoft.Maintenance.maintenanceConfigurations#properties 54 | */ 55 | readonly properties: MaintenanceConfigurationProperties; 56 | 57 | /** 58 | * Gets or sets tags of the resource 59 | * 60 | * @schema Microsoft.Maintenance.maintenanceConfigurations#tags 61 | */ 62 | readonly tags?: MicrosoftMaintenanceMaintenanceConfigurationsTags; 63 | 64 | /** 65 | * @schema Microsoft.Maintenance.maintenanceConfigurations#type 66 | */ 67 | readonly type: MicrosoftMaintenanceMaintenanceConfigurationsType; 68 | 69 | } 70 | 71 | export enum MicrosoftMaintenanceMaintenanceConfigurationsApiVersion { 72 | "MicrosoftMaintenanceMaintenanceConfigurationsApiVersion_2021_05_01" = '2021-05-01', 73 | } 74 | 75 | /** 76 | * Properties for maintenance configuration 77 | * 78 | * @schema #/definitions/MaintenanceConfigurationProperties 79 | */ 80 | export interface MaintenanceConfigurationProperties { 81 | /** 82 | * Gets or sets extensionProperties of the maintenanceConfiguration 83 | * 84 | * @schema #/definitions/MaintenanceConfigurationProperties#extensionProperties 85 | */ 86 | readonly extensionProperties?: MaintenanceConfigurationPropertiesExtensionProperties; 87 | 88 | /** 89 | * Gets or sets maintenanceScope of the configuration. 90 | * 91 | * @schema #/definitions/MaintenanceConfigurationProperties#maintenanceScope 92 | */ 93 | readonly maintenanceScope?: MaintenanceConfigurationPropertiesMaintenanceScope; 94 | 95 | /** 96 | * Definition of a MaintenanceWindow 97 | * 98 | * @schema #/definitions/MaintenanceConfigurationProperties#maintenanceWindow 99 | */ 100 | readonly maintenanceWindow?: MaintenanceWindow; 101 | 102 | /** 103 | * Gets or sets namespace of the resource 104 | * 105 | * @schema #/definitions/MaintenanceConfigurationProperties#namespace 106 | */ 107 | readonly namespace?: string; 108 | 109 | /** 110 | * Gets or sets the visibility of the configuration. The default value is 'Custom'. 111 | * 112 | * @schema #/definitions/MaintenanceConfigurationProperties#visibility 113 | */ 114 | readonly visibility?: MaintenanceConfigurationPropertiesVisibility; 115 | 116 | } 117 | 118 | /** 119 | * @schema MicrosoftMaintenanceMaintenanceConfigurationsTags 120 | */ 121 | export interface MicrosoftMaintenanceMaintenanceConfigurationsTags { 122 | } 123 | 124 | export enum MicrosoftMaintenanceMaintenanceConfigurationsType { 125 | "MicrosoftMaintenanceMaintenanceConfigurationsType_MICROSOFT_MAINTENANCE_MAINTENANCE_CONFIGURATIONS" = 'Microsoft.Maintenance/maintenanceConfigurations', 126 | } 127 | 128 | /** 129 | * @schema #/definitions/maintenanceConfigurationPropertiesExtensionProperties 130 | */ 131 | export interface MaintenanceConfigurationPropertiesExtensionProperties { 132 | } 133 | 134 | export enum MaintenanceConfigurationPropertiesMaintenanceScope { 135 | HOST = 'Host', 136 | OS_IMAGE = 'OSImage', 137 | EXTENSION = 'Extension', 138 | IN_GUEST_PATCH = 'InGuestPatch', 139 | SQLDB = 'SQLDB', 140 | SQL_MANAGED_INSTANCE = 'SQLManagedInstance', 141 | } 142 | 143 | /** 144 | * Definition of a MaintenanceWindow 145 | * 146 | * @schema #/definitions/MaintenanceWindow 147 | */ 148 | export interface MaintenanceWindow { 149 | /** 150 | * Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00. 151 | * 152 | * @schema #/definitions/MaintenanceWindow#duration 153 | */ 154 | readonly duration?: string; 155 | 156 | /** 157 | * Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59. 158 | * 159 | * @schema #/definitions/MaintenanceWindow#expirationDateTime 160 | */ 161 | readonly expirationDateTime?: string; 162 | 163 | /** 164 | * Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday. 165 | * 166 | * @schema #/definitions/MaintenanceWindow#recurEvery 167 | */ 168 | readonly recurEvery?: string; 169 | 170 | /** 171 | * Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. 172 | * 173 | * @schema #/definitions/MaintenanceWindow#startDateTime 174 | */ 175 | readonly startDateTime?: string; 176 | 177 | /** 178 | * Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time. 179 | * 180 | * @schema #/definitions/MaintenanceWindow#timeZone 181 | */ 182 | readonly timeZone?: string; 183 | 184 | } 185 | 186 | export enum MaintenanceConfigurationPropertiesVisibility { 187 | CUSTOM = 'Custom', 188 | PUBLIC = 'Public', 189 | } 190 | 191 | -------------------------------------------------------------------------------- /packages/armkit-resources/lib/ManagedServices-2019-06-01.ts: -------------------------------------------------------------------------------- 1 | // generated by armkit 2 | import { ArmResource } from '@yetics/armkit-core'; 3 | import { Construct } from 'constructs'; 4 | 5 | /** 6 | * Microsoft.ManagedServices/registrationAssignments 7 | * 8 | * @schema Microsoft.ManagedServices.registrationAssignments 9 | */ 10 | export class RegistrationAssignments extends ArmResource { 11 | /** 12 | * Defines a "Microsoft.ManagedServices.registrationAssignments" Arm Template object 13 | * @param scope the scope in which to define this object 14 | * @param name a scope-local name for the object 15 | * @param options configuration options 16 | */ 17 | public constructor(scope: Construct, name: string, options: RegistrationAssignmentsOptions) { 18 | super(scope, name, { 19 | ...options, 20 | armResourceType: 'registrationAssignments', 21 | }); 22 | } 23 | } 24 | 25 | /** 26 | * Microsoft.ManagedServices/registrationDefinitions 27 | * 28 | * @schema Microsoft.ManagedServices.registrationDefinitions 29 | */ 30 | export class RegistrationDefinitions extends ArmResource { 31 | /** 32 | * Defines a "Microsoft.ManagedServices.registrationDefinitions" Arm Template object 33 | * @param scope the scope in which to define this object 34 | * @param name a scope-local name for the object 35 | * @param options configuration options 36 | */ 37 | public constructor(scope: Construct, name: string, options: RegistrationDefinitionsOptions) { 38 | super(scope, name, { 39 | ...options, 40 | armResourceType: 'registrationDefinitions', 41 | }); 42 | } 43 | } 44 | 45 | /** 46 | * Microsoft.ManagedServices/registrationAssignments 47 | * 48 | * @schema Microsoft.ManagedServices.registrationAssignments 49 | */ 50 | export interface RegistrationAssignmentsOptions { 51 | /** 52 | * Guid of the registration assignment. 53 | * 54 | * @schema Microsoft.ManagedServices.registrationAssignments#name 55 | */ 56 | readonly name: string; 57 | 58 | /** 59 | * @schema Microsoft.ManagedServices.registrationAssignments#type 60 | */ 61 | readonly type: MicrosoftManagedServicesRegistrationAssignmentsType; 62 | 63 | /** 64 | * @schema Microsoft.ManagedServices.registrationAssignments#apiVersion 65 | */ 66 | readonly apiVersion?: MicrosoftManagedServicesRegistrationAssignmentsApiVersion; 67 | 68 | /** 69 | * Properties of a registration assignment. 70 | * 71 | * @schema Microsoft.ManagedServices.registrationAssignments#properties 72 | */ 73 | readonly properties: RegistrationAssignmentProperties; 74 | 75 | } 76 | 77 | /** 78 | * Microsoft.ManagedServices/registrationDefinitions 79 | * 80 | * @schema Microsoft.ManagedServices.registrationDefinitions 81 | */ 82 | export interface RegistrationDefinitionsOptions { 83 | /** 84 | * Guid of the registration definition. 85 | * 86 | * @schema Microsoft.ManagedServices.registrationDefinitions#name 87 | */ 88 | readonly name: string; 89 | 90 | /** 91 | * @schema Microsoft.ManagedServices.registrationDefinitions#type 92 | */ 93 | readonly type: MicrosoftManagedServicesRegistrationDefinitionsType; 94 | 95 | /** 96 | * @schema Microsoft.ManagedServices.registrationDefinitions#apiVersion 97 | */ 98 | readonly apiVersion?: MicrosoftManagedServicesRegistrationDefinitionsApiVersion; 99 | 100 | /** 101 | * Properties of a registration definition. 102 | * 103 | * @schema Microsoft.ManagedServices.registrationDefinitions#properties 104 | */ 105 | readonly properties: RegistrationDefinitionProperties; 106 | 107 | /** 108 | * Plan details for the managed services. 109 | * 110 | * @schema Microsoft.ManagedServices.registrationDefinitions#plan 111 | */ 112 | readonly plan?: Plan; 113 | 114 | } 115 | 116 | export enum MicrosoftManagedServicesRegistrationAssignmentsType { 117 | "MicrosoftManagedServicesRegistrationAssignmentsType_MICROSOFT_MANAGED_SERVICES_REGISTRATION_ASSIGNMENTS" = 'Microsoft.ManagedServices/registrationAssignments', 118 | } 119 | 120 | export enum MicrosoftManagedServicesRegistrationAssignmentsApiVersion { 121 | "MicrosoftManagedServicesRegistrationAssignmentsApiVersion_2019_06_01" = '2019-06-01', 122 | } 123 | 124 | /** 125 | * Properties of a registration assignment. 126 | * 127 | * @schema #/definitions/RegistrationAssignmentProperties 128 | */ 129 | export interface RegistrationAssignmentProperties { 130 | /** 131 | * Fully qualified path of the registration definition. 132 | * 133 | * @schema #/definitions/RegistrationAssignmentProperties#registrationDefinitionId 134 | */ 135 | readonly registrationDefinitionId: string; 136 | 137 | } 138 | 139 | export enum MicrosoftManagedServicesRegistrationDefinitionsType { 140 | "MicrosoftManagedServicesRegistrationDefinitionsType_MICROSOFT_MANAGED_SERVICES_REGISTRATION_DEFINITIONS" = 'Microsoft.ManagedServices/registrationDefinitions', 141 | } 142 | 143 | export enum MicrosoftManagedServicesRegistrationDefinitionsApiVersion { 144 | "MicrosoftManagedServicesRegistrationDefinitionsApiVersion_2019_06_01" = '2019-06-01', 145 | } 146 | 147 | /** 148 | * Properties of a registration definition. 149 | * 150 | * @schema #/definitions/RegistrationDefinitionProperties 151 | */ 152 | export interface RegistrationDefinitionProperties { 153 | /** 154 | * Description of the registration definition. 155 | * 156 | * @schema #/definitions/RegistrationDefinitionProperties#description 157 | */ 158 | readonly description?: string; 159 | 160 | /** 161 | * Authorization tuple containing principal id of the user/security group or service principal and id of the build-in role. 162 | * 163 | * @schema #/definitions/RegistrationDefinitionProperties#authorizations 164 | */ 165 | readonly authorizations: Authorization[]; 166 | 167 | /** 168 | * Name of the registration definition. 169 | * 170 | * @schema #/definitions/RegistrationDefinitionProperties#registrationDefinitionName 171 | */ 172 | readonly registrationDefinitionName?: string; 173 | 174 | /** 175 | * Id of the managedBy tenant. 176 | * 177 | * @schema #/definitions/RegistrationDefinitionProperties#managedByTenantId 178 | */ 179 | readonly managedByTenantId: string; 180 | 181 | } 182 | 183 | /** 184 | * Plan details for the managed services. 185 | * 186 | * @schema #/definitions/Plan 187 | */ 188 | export interface Plan { 189 | /** 190 | * The plan name. 191 | * 192 | * @schema #/definitions/Plan#name 193 | */ 194 | readonly name: string; 195 | 196 | /** 197 | * The publisher ID. 198 | * 199 | * @schema #/definitions/Plan#publisher 200 | */ 201 | readonly publisher: string; 202 | 203 | /** 204 | * The product code. 205 | * 206 | * @schema #/definitions/Plan#product 207 | */ 208 | readonly product: string; 209 | 210 | /** 211 | * The plan's version. 212 | * 213 | * @schema #/definitions/Plan#version 214 | */ 215 | readonly version: string; 216 | 217 | } 218 | 219 | /** 220 | * Authorization tuple containing principal Id (of user/service principal/security group) and role definition id. 221 | * 222 | * @schema #/definitions/Authorization 223 | */ 224 | export interface Authorization { 225 | /** 226 | * Principal Id of the security group/service principal/user that would be assigned permissions to the projected subscription 227 | * 228 | * @schema #/definitions/Authorization#principalId 229 | */ 230 | readonly principalId: string; 231 | 232 | /** 233 | * The role definition identifier. This role will define all the permissions that the security group/service principal/user must have on the projected subscription. This role cannot be an owner role. 234 | * 235 | * @schema #/definitions/Authorization#roleDefinitionId 236 | */ 237 | readonly roleDefinitionId: string; 238 | 239 | } 240 | 241 | -------------------------------------------------------------------------------- /packages/armkit-resources/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "armkit-resources", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/node": { 8 | "version": "13.13.52", 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", 10 | "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" 11 | }, 12 | "@yetics/armkit-core": { 13 | "version": "0.0.0", 14 | "resolved": "https://registry.npmjs.org/@yetics/armkit-core/-/armkit-core-0.0.0.tgz", 15 | "integrity": "sha512-gNv/+yy8bOdxifjwF+VHczgg41HJoWokEM/vRez2VEckiH6hgZjtKCvzkLOlZ5+xVdXlLnaxQ6N1cYncrY78cg==", 16 | "requires": { 17 | "@types/node": "^13.13.4", 18 | "constructs": "^3.0.2", 19 | "typescript": "^3.8.3", 20 | "yargs": "^15.1.0" 21 | } 22 | }, 23 | "ansi-regex": { 24 | "version": "5.0.0", 25 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", 26 | "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" 27 | }, 28 | "ansi-styles": { 29 | "version": "4.3.0", 30 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 31 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 32 | "requires": { 33 | "color-convert": "^2.0.1" 34 | } 35 | }, 36 | "camelcase": { 37 | "version": "5.3.1", 38 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 39 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" 40 | }, 41 | "cliui": { 42 | "version": "6.0.0", 43 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", 44 | "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", 45 | "requires": { 46 | "string-width": "^4.2.0", 47 | "strip-ansi": "^6.0.0", 48 | "wrap-ansi": "^6.2.0" 49 | } 50 | }, 51 | "color-convert": { 52 | "version": "2.0.1", 53 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 54 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 55 | "requires": { 56 | "color-name": "~1.1.4" 57 | } 58 | }, 59 | "color-name": { 60 | "version": "1.1.4", 61 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 62 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 63 | }, 64 | "constructs": { 65 | "version": "3.3.75", 66 | "resolved": "https://registry.npmjs.org/constructs/-/constructs-3.3.75.tgz", 67 | "integrity": "sha512-q10foASSSfDWmS99OQLfnWDXCzqLvoORISAVWPFg0AmIGlBv2ZdDOtXxLqrJARPxVlOldmW2JzWzdRI+4+0/ZA==" 68 | }, 69 | "decamelize": { 70 | "version": "1.2.0", 71 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 72 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" 73 | }, 74 | "emoji-regex": { 75 | "version": "8.0.0", 76 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 77 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 78 | }, 79 | "find-up": { 80 | "version": "4.1.0", 81 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", 82 | "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", 83 | "requires": { 84 | "locate-path": "^5.0.0", 85 | "path-exists": "^4.0.0" 86 | } 87 | }, 88 | "get-caller-file": { 89 | "version": "2.0.5", 90 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 91 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" 92 | }, 93 | "is-fullwidth-code-point": { 94 | "version": "3.0.0", 95 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 96 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" 97 | }, 98 | "locate-path": { 99 | "version": "5.0.0", 100 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", 101 | "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", 102 | "requires": { 103 | "p-locate": "^4.1.0" 104 | } 105 | }, 106 | "p-limit": { 107 | "version": "2.3.0", 108 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", 109 | "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", 110 | "requires": { 111 | "p-try": "^2.0.0" 112 | } 113 | }, 114 | "p-locate": { 115 | "version": "4.1.0", 116 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", 117 | "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", 118 | "requires": { 119 | "p-limit": "^2.2.0" 120 | } 121 | }, 122 | "p-try": { 123 | "version": "2.2.0", 124 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", 125 | "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" 126 | }, 127 | "path-exists": { 128 | "version": "4.0.0", 129 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", 130 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" 131 | }, 132 | "require-directory": { 133 | "version": "2.1.1", 134 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 135 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" 136 | }, 137 | "require-main-filename": { 138 | "version": "2.0.0", 139 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", 140 | "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" 141 | }, 142 | "set-blocking": { 143 | "version": "2.0.0", 144 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 145 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" 146 | }, 147 | "string-width": { 148 | "version": "4.2.2", 149 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", 150 | "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", 151 | "requires": { 152 | "emoji-regex": "^8.0.0", 153 | "is-fullwidth-code-point": "^3.0.0", 154 | "strip-ansi": "^6.0.0" 155 | } 156 | }, 157 | "strip-ansi": { 158 | "version": "6.0.0", 159 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", 160 | "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", 161 | "requires": { 162 | "ansi-regex": "^5.0.0" 163 | } 164 | }, 165 | "typescript": { 166 | "version": "3.9.9", 167 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", 168 | "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==" 169 | }, 170 | "which-module": { 171 | "version": "2.0.0", 172 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 173 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" 174 | }, 175 | "wrap-ansi": { 176 | "version": "6.2.0", 177 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", 178 | "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", 179 | "requires": { 180 | "ansi-styles": "^4.0.0", 181 | "string-width": "^4.1.0", 182 | "strip-ansi": "^6.0.0" 183 | } 184 | }, 185 | "y18n": { 186 | "version": "4.0.3", 187 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", 188 | "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" 189 | }, 190 | "yargs": { 191 | "version": "15.4.1", 192 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", 193 | "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", 194 | "requires": { 195 | "cliui": "^6.0.0", 196 | "decamelize": "^1.2.0", 197 | "find-up": "^4.1.0", 198 | "get-caller-file": "^2.0.1", 199 | "require-directory": "^2.1.1", 200 | "require-main-filename": "^2.0.0", 201 | "set-blocking": "^2.0.0", 202 | "string-width": "^4.2.0", 203 | "which-module": "^2.0.0", 204 | "y18n": "^4.0.0", 205 | "yargs-parser": "^18.1.2" 206 | } 207 | }, 208 | "yargs-parser": { 209 | "version": "18.1.3", 210 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", 211 | "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", 212 | "requires": { 213 | "camelcase": "^5.0.0", 214 | "decamelize": "^1.2.0" 215 | } 216 | } 217 | } 218 | } 219 | --------------------------------------------------------------------------------