ปรับใช้บริการที่แค็ตตาล็อกไม่มี
เมื่อaggrega import อ่าน
อ่าน
| รูป | สคีมา | ผู้ |
|---|---|---|
cloudformation-schema | ประเภทaws cloudformation describe-type หรือ | cloudformation |
terraform-schema | สคีมาterraform providers schema -json | terraform |
arm-schema | ไฟล์types.json | arm |
หน้าarm
ไม่มี
ส่งออกสคีมา
เครื่อง
# CloudFormation: any registered type, third-party and private ones included.aws cloudformation describe-type --type RESOURCE --type-name AWS::SQS::Queue > sqs-queue.json
# Terraform or OpenTofu: in a directory whose configuration requires the provider.terraform init && terraform providers schema -json > schema.json
# Azure: no export is needed. Bicep's type files are published in the# Azure/bicep-types-az repository, one for each resource provider and API# version, at generated/<namespace>/<provider>/<apiVersion>/types.json.กรณี Azure ด้านMicrosoft.ManagedIdentity ที่ API เวอร์ชัน 2024-11-30 เก็บmsi ภายtypes.json
ไฟล์สคีมา Azure และสัญญาอนุญาต
types.json ของ Microsoft.ManagedIdentity ที่ 2024-11-30 เป็น
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWAREพื้นที่.aggrega-config.yaml ซึ่งworkspace และmsi ที่
.aggrega-config.yamlmsi/types.jsonแสดงรายการชนิดที่จะร่าง
ไฟล์
jq -r '.[] | select(."$type" == "ResourceType") | .name' msi/types.jsonMicrosoft.ManagedIdentity/userAssignedIdentities@2024-11-30Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials@2024-11-30Microsoft.ManagedIdentity/identities@2024-11-30จากresource_types ของ.aggrega-config.yaml ทุกresource_types เท่านั้น uri ของaggrega version พิมพ์
workspace: {}default_registry: hub.aggrega.aiplugins: importer: - uri: importer/arm-schema:<compiler version> with: settings: resource_types: - Microsoft.ManagedIdentity/userAssignedIdentitiesชื่อAWS::SQS::Queue) และ Terraform (aws_sqs_queue) และ@ ไฟล์
halt: the sources hold 3 resource types and the resource_types setting names none: write the types to draft in it, one of Microsoft.ManagedIdentity/userAssignedIdentities, Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials, Microsoft.ManagedIdentity/identitiesประเภท
รันการนำเข้า
ระบุ
aggrega import msiที่
wrote catalog/component/imported/security/microsoft-managedidentity-userassignedidentities/0.1.0/component.yamlwrote catalog/recipe/arm/microsoft-managedidentity-userassignedidentities/0.1.0/recipe.yamlwrote .aggrega-import.jsonที่<workspace> แทน
read as the arm-schema format, with drafted paths relative to <workspace>mapped Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30 (Microsoft.ManagedIdentity/userAssignedIdentities) to imported/security/microsoft-managedidentity-userassignedidentities as a draft, NONE at 0.05aggrega import รู้จักtypes.json ตามAzure/bicep-types-az ตั้ง--format arm-schema ระบุ--format ยัง
บรรทัด mapped บอกcatalog/ ซึ่ง.aggrega-import.json แสดงaggrega import --sync จึง
สิ่งที่ฉบับร่างบอก
Component คือ component.yaml จัด
- คุณสมบัติ
แบบ อ่านกลับ ซึ่งคลาวด์ ตั้ง ค่า และ คุณ ตั้ง ไม่ ได้ ไม่ใช่ อินพุต สเกลาร์ จะ กลาย เป็น คีย์ providesที่ผู้ บริโภค อ่าน ได้ - ข้อมูล
ลับ ถูกร่าง ข้อมูลเป็นการ อ้างอิง ถึงที่ มา ของ ค่า ไม่ เป็น ค่า เลย ดัง ที่ ลับ ด้านล่าง อธิบาย - ตำแหน่ง
ที่ คือวาง ที่ ที่ ทรัพยากร อยู่ เช่น locationของ Azure ไปอยู่ ใน infraซึ่งเป็น เสา หลัก ที่ ผู้ ดำเนิน การ จัดหา ให้ แต่ละ สภาพ แวดล้อม - ตัว
ตน คือชื่อ ของ ทรัพยากร เอง ไป อยู่ ใน valuesซึ่งเป็น เสา หลัก ที่ นัก พัฒนา เขียน - คุณสมบัติ อื่น
ที่ ไปจำเป็น ทุก รายการ อยู่ ใน infra - คุณสมบัติ อื่น
ที่ ไปเขียน ได้ ทุก รายการ อยู่ ใต้ infra.overridesซึ่งเป็น แมป แบบ เปิด ที่ คง การ สะกด ชื่อ แต่ละ รายการ ตาม ผู้ จำหน่าย
สำหรับ
apiVersion: aggrega.ai/v1beta1kind: Componentmetadata: name: imported/security/microsoft-managedidentity-userassignedidentities version: 0.1.0 description: "Draft Component of the resource type Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30, imported from a source in the arm-schema format." labels: component.aggrega.ai/type: resource component.aggrega.ai/category: security component.aggrega.ai/hosting: managedspec: schema: values: type: object properties: # identity: the resource's own name or identifier # [vendor schema text] The resource name name: type: string description: "[vendor schema text] The resource name" required: true additionalProperties: false infra: type: object properties: # placement: where the resource is deployed # [vendor schema text] The geo-location where the resource lives location: type: string description: "[vendor schema text] The geo-location where the resource lives" required: true # override: every writable property no other rule places, each under the vendor's own name overrides: type: object description: "Writable settings of Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30, each under the vendor's own name, which the Recipe passes to the resource as written; its header lists the names it reads." additionalProperties: true additionalProperties: false provides: type: object properties: # read back: published under provides # [vendor schema text] The resource id id: type: string description: "[vendor schema text] The resource id" # … client_id, principal_id and tenant_id, each read back the same way additionalProperties: falseข้อความ[vendor schema text] คุณ
Recipe คือ recipe.yaml ทำให้ Component เป็นarm ความ
spec: # This Recipe realizes imported/security/microsoft-managedidentity-userassignedidentities with one resource of the type Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30. It reads the keys below, each with its type, its rule and the first sentence of the vendor's description; any other key under infra.overrides halts the build naming it. # infra.location: string, required; placement: where the resource is deployed # [… omitted: the first sentence of the vendor's description of the key above, marked as vendor schema text, as below each key] # values.name: string, required; identity: the resource's own name or identifier # [… omitted: the vendor's description of the key] # infra.overrides.tags: object; override: writable, set under infra.overrides in the vendor's spelling # [… omitted: the vendor's description of the key] # infra.overrides.isolationScope: string; override: writable, set under infra.overrides in the vendor's spelling # [… omitted: the vendor's description of the key, then a line saying template.yaml declares the resource under the symbolic name locals.symbol holds] capability: arm implements: imported/security/microsoft-managedidentity-userassignedidentities:0.1.0 locals: # [… omitted: a comment saying what the symbolic name is made of] symbol: "{{ capitalizedWords .context.instance_id }}" provides: # [… omitted: a comment saying each value is one whole ARM expression, evaluated when the template is deployed] id: "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities'{{ range splitList \"/\" (toString (index .values \"name\")) }}, '{{ replace \"'\" \"''\" . }}'{{ end }})]" client_id: "[reference('{{ .locals.symbol }}').clientId]" # … principal_id and tenant_id the same way assertions: overrides_this_recipe_reads: | # halts naming any key under infra.overrides the header does not list artifacts: template.yaml: | # … the resource, written under the symbolic name locals.symbol holdsRecipe เขียนprovides แต่ละinfra.overrides ที่
ตรวจ
ใช้ฉบับร่างใน Aggregate และ Release
การนำaggregate.yaml มีvalues เก็บ
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: identities version: 1.0.0spec: components: deploy-identity: type: imported/security/microsoft-managedidentity-userassignedidentities:0.1.0 values: name: deploy-identityใน Manifest คือ manifest.yaml มี
apiVersion: aggrega.ai/v1beta1kind: Manifestmetadata: name: identities version: 1.0.0spec: mappings: components: type: imported/security/microsoft-managedidentity-userassignedidentities:0.1.0: arm/microsoft-managedidentity-userassignedidentities:0.1.0ใน Release คือ release.yaml มีinfra ที่ Recipe ต้องการ คือ
apiVersion: aggrega.ai/v1beta1kind: Releasemetadata: name: identities version: 1.0.0 environment: productionspec: aggregate: ./aggregate.yaml manifest: ./manifest.yaml boundaries: azure: directory: azure components: deploy-identity: infra: location: westeuropeตรวจสอบความถูกต้องและบิลด์
aggrega validate --release release.yamlrelease dependency validation passed: release.yaml (schema-pillar + dependency pillars)pull สิ่ง
aggrega pull --release release.yamlaggrega build --release release.yamlPull complete: release.lock (entities=…, source_artifacts=…, external_inputs=…)[… omitted: the build's elapsed time]Build completed: 1 file written to <workspace>/distการdist/azure/arm/arm-template.json ซึ่งazure โดยmetadata:
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "languageVersion": "2.0", "resources": { "DeployIdentity": { "apiVersion": "2024-11-30", "location": "westeurope", "metadata": { "aggrega.ai/provenance": { "aggrega.ai/aggregate-name": "identities", "aggrega.ai/boundary-path": "azure", "aggrega.ai/compiler-version": "<compiler version>", "aggrega.ai/component-id": "deploy-identity", "aggrega.ai/environment": "production", "aggrega.ai/provider": "arm", "aggrega.ai/provider-version": "<compiler version>", "aggrega.ai/recipe-uri": "microsoft-managedidentity-userassignedidentities:0.1.0" } }, "name": "deploy-identity", "type": "Microsoft.ManagedIdentity/userAssignedIdentities" } }}เทมเพลต
ข้อมูลลับ
ค่า
- Azure: พารามิเตอร์
securestringระดับบน สุด ของ เทมเพลต ตั้ง ชื่อ ตาม อินสแตนซ์ และ คุณสมบัติ ซึ่ง คุณ จัดหา ให้ เมื่อ ปรับ ใช้ ข้อมูล ลับ ที่ ผู้ จำหน่าย ทำ เครื่องหมาย ว่า ไม่ บังคับ จะ เป็น พารามิเตอร์ ที่ จำเป็น - CloudFormation: รายการ
Parametersของเทมเพลต ที่ ทำ เครื่องหมาย NoEchoตั้งชื่อ ด้วย วิธี เดียวกัน ข้อมูล ลับ ที่ ผู้ จำหน่าย ทำ เครื่องหมาย ว่า ไม่ บังคับ จะ เป็น พารามิเตอร์ ที่ จำเป็น - Terraform: สล็อต Feature บน Component และ
ตัวแปร โมดูล ที่ ทำ เครื่องหมาย sensitive: trueค่ามา จาก ข้อมูล ลับ ที่ Release แนบ กับ สล็อต
เฉพาะproperties สมาชิกadminPassword ภายใน osProfile ของ Azure หรือ password ภายในconstraint-dropped โดย
คุณสมบัติArn, Id, Name หรือ Ref การ
การนำเข้าเดียวกันบน CloudFormation และ Terraform
ขั้น
CloudFormation
aws cloudformation describe-type --type RESOURCE --type-name AWS::Example::Ledger > ledger.jsonaggrega import ledger.jsonการนำ
wrote catalog/component/imported/component/aws-example-ledger/0.1.0/component.yamlwrote catalog/recipe/cloudformation/aws-example-ledger/0.1.0/recipe.yamlwrote .aggrega-import.jsonread as the cloudformation-schema format, with drafted paths relative to <workspace>warn: the property "LedgerName" does not carry the vendor schema's pattern "…": the catalog reads a pattern as an RE2 regular expression, which refuses it: …warn: the property "Rules[].Children[]" does not carry the vendor schema's shape below it: the vendor schema's definitions refer back to themselves there, so it is drafted as an open objectmapped AWS::Example::Ledger (AWS::Example::Ledger) to imported/component/aws-example-ledger as a draft, NONE at 0.0167template.yaml ของ Recipe ประกาศNoEcho และprovides เขียน!Ref หรือ !GetAtt ซ้ำprovides เพื่อcloudformation ฉาย
artifacts: template.yaml: | Parameters: {{ .locals.logical_id }}MasterPassword: Type: String NoEcho: true Resources: {{ .locals.logical_id }}: Type: AWS::Example::Ledger Properties: # … one line for each key the header lists MasterPassword: !Ref {{ .locals.logical_id }}MasterPassword provides: arn: !GetAtt {{ .locals.logical_id }}.ArnTerraform
terraform init && terraform providers schema -json > schema.jsonaggrega import schema.jsonwrote catalog/component/imported/component/aws-example-ledger/0.1.0/component.yamlwrote catalog/recipe/terraform/aws-example-ledger/0.1.0/recipe.yamlwrote catalog/recipe/terraform/aws-example-ledger/0.1.0/module/main.tf.jsonwrote .aggrega-import.jsonการ
warn: no version of the provider hashicorp/aws is known, so the module drafted for aws_example_ledger requires it without a version constraint: set terraform.required_providers.aws.version in the module/main.tf.json beside the Recipe, then run aggrega pin on the Recipeฉบับmodule/main.tf.json ประกาศthis โดยspec.source ของ Recipe ชี้valuesMapping เติม
aggrega pin catalog/recipe/terraform/aws-example-ledger/0.1.0/recipe.yamlPinned Recipe "aws-example-ledger": wrote <workspace>/catalog/recipe/terraform/aws-example-ledger/0.1.0/entity.lock (remote source pins: 0, imported file pins: 0, local source file pins: 1). Commit it beside the entityRecipe ที่aggrega pin ให้
บรรทัดinfra ของregion ใน
Component ที่แค็ตตาล็อกมีอยู่แล้ว
เมื่อresource_types เป็น
plugins: importer: # The entry passes resource_types; the importer is served without it. - uri: importer/arm-schema:<compiler version> with: settings: resource_types: - type: Microsoft.ManagedIdentity/userAssignedIdentities component: acme/security/identityRecipe ใช้identity-microsoft-managedidentity-userassignedidentities ตาม Component จึงvalues ซึ่งvalues คุณสมบัติinfra.overrides พร้อม
warn: the Component acme/security/identity provides principal_id, and no attribute Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30 reads back carries its name, so the drafted Recipe's provides.principal_id halts the build until it is mapped: map it to an attribute Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30 reads back, one of id, properties.clientId, properties.principalId, properties.tenantIdAzure ซ้อนproperties บรรทัด
provides: principal_id: "[reference('{{ .locals.symbol }}').principalId]"เมื่อinfra.overrides.location และ
ชื่อ
ขั้นต่อไป
- ตัวนำ
เข้า อธิบายแกน สิ่ง ที่ ตัวนำ เข้า แต่ละ ตัว อ่าน วิธี เลือก ระหว่าง หลาย ประเภท และ ระหว่าง ผู้ ให้ บริการ หลาย ราย การ แบ่ง โดย สมบูรณ์ สิ่ง ที่ แต่ละ เป้า หมาย ร่าง และ การ วินิจฉัย ที่ ทั้ง สาม ตัว รายงาน - ผู้
ให้ อธิบายบริการ arm เทมเพลต ที่ ฉบับ ร่าง Azure ถูก รวม เข้าไป และ ขอบเขต ที่ ปรับ ใช้ - aggrega import คือ
เอกสาร อ้างอิง ฉบับ เต็ม ของ คำ สั่ง