Bỏ qua để đến nội dung
AggregaAggregaAggregaAggrega
Chọn ngôn ngữ: Tiếng Việt
Trang này được dịch bằng máy. Đọc bản gốc tiếng Anh.

Triển khai một dịch vụ mà catalog không có

Khi catalog không có Component nào cho một dịch vụ đám mây, mô tả riêng của nhà cung cấp về loại tài nguyên của dịch vụ đó có thể thay thế cho một Component. aggrega import đọc mô tả này — schema mà một nhà cung cấp đám mây phát hành cho một loại tài nguyên — và soạn nháp từ đó hai tệp: một Component khai báo các thiết lập của loại đó trong các trụ cột mà Aggrega đọc, và một Recipe hiện thực hóa Component đó cho một provider bằng cách ghi đúng một tài nguyên thuộc loại đó. Bạn xem xét các bản nháp, thêm các dòng sử dụng chúng vào một Aggregate và một Release, rồi build.

Ba định dạng được đọc, mỗi định dạng bởi một trình nhập lõi phục vụ nó:

Định dạngSchema bạn xuấtProvider của Recipe
cloudformation-schemamột loại tài nguyên CloudFormation, từ aws cloudformation describe-type hoặc tệp schema của providercloudformation
terraform-schemaschema của một provider Terraform hoặc OpenTofu, từ terraform providers schema -jsonterraform
arm-schematệp kiểu Bicep của một resource provider Azure, types.jsonarm

Trang này đi hết trường hợp Azure từ đầu đến cuối, rồi trình bày các trường hợp CloudFormation và Terraform, cùng một biến thể chỉ soạn nháp một Recipe cho một Component mà catalog đã có. Các lệnh và kết quả ở các phần Azure bên dưới lấy từ một lần chạy của một bản build thuộc bản phát hành trình biên dịch có các trình nhập này và provider arm.

Không có gì được tải về thay bạn. Bạn xuất schema bằng công cụ riêng của nhà cung cấp, nên lần nhập đọc một tệp bạn đang giữ và không truy cập tài khoản đám mây nào.

Xuất schema

Công cụ của mỗi nhà cung cấp ghi schema ra một tệp. Chạy công cụ dành cho đám mây của bạn, trong một workspace:

Terminal window
# 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.

Trường hợp Azure bên dưới dùng tệp của Microsoft.ManagedIdentity ở phiên bản API 2024-11-30, được giữ trong một thư mục tên msi dưới tên mà Bicep đặt cho nó, types.json.

Tệp schema Azure và giấy phép của nó

types.json của Microsoft.ManagedIdentity ở 2024-11-30 là một tệp của kho Azure/bicep-types-az, bản quyền thuộc Microsoft Corporation, được phân phối theo Giấy phép MIT. Các mô tả mà các bản nháp bên dưới trích dẫn là của Microsoft, và thông báo của giấy phép áp dụng cho chúng:

MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, 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 THE
SOFTWARE

Workspace là một thư mục chứa một .aggrega-config.yaml có khóa workspace, cùng thư mục msi chứa tệp:

.aggrega-config.yaml
msi/types.json

Liệt kê các loại cần soạn nháp

Một tệp schema có thể chứa nhiều hơn một loại tài nguyên, và lần nhập chỉ soạn nháp những loại bạn nêu tên. Liệt kê những gì tệp chứa:

Terminal window
jq -r '.[] | select(."$type" == "ResourceType") | .name' msi/types.json
Microsoft.ManagedIdentity/userAssignedIdentities@2024-11-30
Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials@2024-11-30
Microsoft.ManagedIdentity/identities@2024-11-30

Sau đó nêu tên loại bạn muốn dưới thiết lập resource_types của mục của trình nhập trong .aggrega-config.yaml. Mọi workspace đều đã phục vụ trình nhập, nên mục này chỉ cần để truyền resource_types. uri của nó nêu tên trình nhập và phiên bản của trình biên dịch, mà aggrega version in ra; một trình nhập được trao các thiết lập của nó qua một mục như vậy, như Trình nhập nào biến một nguồn thành bản nháp mô tả:

workspace: {}
default_registry: hub.aggrega.ai
plugins:
importer:
- uri: importer/arm-schema:<compiler version>
with:
settings:
resource_types:
- Microsoft.ManagedIdentity/userAssignedIdentities

Tên được khớp chính xác với CloudFormation (AWS::SQS::Queue) và Terraform (aws_sqs_queue), và không phân biệt chữ hoa chữ thường với Azure, nơi một tên có thể kèm phiên bản API sau một @. Một tệp chứa đúng một loại thì không cần danh sách. Một lần nhập tệp chứa nhiều loại mà không có danh sách sẽ dừng lại và nêu tên chúng:

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

Một loại được liệt kê mà tệp không chứa cũng làm lần nhập dừng lại, nêu tên các tên gần nhất mà nó có. Một lần dừng không soạn nháp gì, nên không có tệp nào được ghi.

Chạy lệnh nhập

Nêu tên thư mục, hoặc tệp:

Terminal window
aggrega import msi

Trên đầu ra chuẩn, nó liệt kê những gì đã ghi:

wrote catalog/component/imported/security/microsoft-managedidentity-userassignedidentities/0.1.0/component.yaml
wrote catalog/recipe/arm/microsoft-managedidentity-userassignedidentities/0.1.0/recipe.yaml
wrote .aggrega-import.json

Trên luồng lỗi chuẩn, với <workspace> đại diện cho thư mục nơi bạn đã chạy nó:

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

aggrega import nhận ra một tệp kiểu Bicep có tên types.json, theo cách Azure/bicep-types-az đặt tên cho chúng, và --format arm-schema nêu tên định dạng cho một tệp được đặt tên khác. --format cũng là cách để nhập một tệp xuất lớn, chẳng hạn toàn bộ schema Terraform của một provider, mà không để lần nhập nhận ra nó trước.

Dòng mapped cho biết loại tài nguyên đã trở thành một bản nháp riêng, không có Component catalog nào gần giống nó. Các bản nháp được ghi dưới catalog/, một thư mục mà workspace đọc như một catalog, nên chúng được phân giải ở lần validate và build tiếp theo mà không cần cấu hình gì. Bản ghi .aggrega-import.json liệt kê chúng, nên aggrega import --sync có thể cập nhật chúng theo một schema đã thay đổi mà không ghi đè lên một chỉnh sửa của bạn.

Các bản nháp nói gì

Component, component.yaml, xếp mỗi thuộc tính của loại tài nguyên vào một trụ cột, và một chú thích bên cạnh mỗi khóa nêu tên quy tắc đã đặt nó vào đó:

  • Một thuộc tính đọc ngược, thuộc tính mà đám mây đặt và bạn không thể đặt, không phải là đầu vào. Một giá trị vô hướng trở thành một khóa provides mà bên tiêu thụ có thể đọc.
  • Một secret được soạn nháp dưới dạng tham chiếu đến nơi giá trị của nó đến từ đó, không bao giờ là một giá trị, như Secret bên dưới mô tả.
  • Vị trí đặt, nơi tài nguyên tồn tại, chẳng hạn location của Azure, đi vào infra, trụ cột mà một người vận hành cung cấp cho từng môi trường.
  • Danh tính, tên riêng của tài nguyên, đi vào values, trụ cột mà nhà phát triển viết.
  • Mọi thuộc tính bắt buộc khác đi vào infra.
  • Mọi thuộc tính khác có thể ghi đi dưới infra.overrides, một map mở giữ nguyên cách viết của nhà cung cấp cho từng tên.

Với loại tài nguyên này, Component đọc như sau:

apiVersion: aggrega.ai/v1beta1
kind: Component
metadata:
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: managed
spec:
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

Mọi văn bản mà bản nháp lấy từ schema của nhà cung cấp đều mở đầu bằng [vendor schema text], để bạn có thể tìm chúng và viết lại bằng lời của riêng bạn trước khi Component rời khỏi workspace của bạn. Văn bản mà lần nhập tự soạn không mang dấu hiệu nào.

Recipe, recipe.yaml, hiện thực hóa Component trên provider arm. Chú thích đầu tệp của nó liệt kê mọi khóa mà nó đọc, kèm quy tắc và kiểu của khóa, và những gì nó không đọc:

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 holds

Recipe ghi một tài nguyên, tài nguyên mà loại đó nêu tên, và không gì khác: không có resource group, không có mạng, không có danh tính mà bạn không khai báo. Mỗi giá trị provides là một biểu thức nguyên vẹn mà Azure đánh giá khi template được triển khai, được chuyển cho bên tiêu thụ nguyên như một chuỗi. Một khóa của infra.overrides mà phần chú thích đầu tệp không liệt kê sẽ làm build dừng lại và nêu tên khóa đó, nên một thiết lập viết sai được bắt trước khi bất cứ thứ gì được triển khai.

Hãy xem xét cả hai tệp trước khi build. Chuyển một thiết lập giữa các trụ cột là một chỉnh sửa Component và cách Recipe đọc nó, và các tệp là của bạn: không có gì mà build phụ thuộc vào được giữ ở nơi nào khác.

Dùng các bản nháp trong một Aggregate và một Release

Lần nhập không soạn nháp Aggregate, Manifest hay Release nào, nên các dòng sử dụng Component đã soạn nháp là của bạn. Trong một Aggregate, aggregate.yaml, một component thuộc loại đã soạn nháp, mang danh tính mà trụ cột values chứa:

apiVersion: aggrega.ai/v1beta1
kind: Aggregate
metadata:
name: identities
version: 1.0.0
spec:
components:
deploy-identity:
type: imported/security/microsoft-managedidentity-userassignedidentities:0.1.0
values:
name: deploy-identity

Trong một Manifest, manifest.yaml, một dòng cho biết Recipe nào hiện thực hóa loại đó:

apiVersion: aggrega.ai/v1beta1
kind: Manifest
metadata:
name: identities
version: 1.0.0
spec:
mappings:
components:
type:
imported/security/microsoft-managedidentity-userassignedidentities:0.1.0: arm/microsoft-managedidentity-userassignedidentities:0.1.0

Trong một Release, release.yaml, ranh giới mà component rơi vào và trụ cột infra mà Recipe yêu cầu, tức vị trí đặt:

apiVersion: aggrega.ai/v1beta1
kind: Release
metadata:
name: identities
version: 1.0.0
environment: production
spec:
aggregate: ./aggregate.yaml
manifest: ./manifest.yaml
boundaries:
azure:
directory: azure
components:
deploy-identity:
infra:
location: westeurope

Xác thực và dựng

Terminal window
aggrega validate --release release.yaml
release dependency validation passed: release.yaml (schema-pillar + dependency pillars)

Pull những gì Release phụ thuộc vào, rồi build:

Terminal window
aggrega pull --release release.yaml
aggrega build --release release.yaml
Pull complete: release.lock (entities=…, source_artifacts=…, external_inputs=…)
[… omitted: the build's elapsed time]
Build completed: 1 file written to <workspace>/dist

Build ghi dist/azure/arm/arm-template.json, template duy nhất của ranh giới azure, với một tài nguyên, dưới tên biểu tượng mà instance của nó đặt cho nó. Bên cạnh các thành viên riêng của tài nguyên, build ghi lại Aggregate, Release và Recipe nào đã tạo ra nó dưới 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"
}
}
}

Template là thứ bạn trao cho Azure; provider arm mô tả các lệnh triển khai nó ở phạm vi resource group. Một loại tài nguyên chỉ ghi được ở phạm vi subscription hoặc management group được soạn nháp thành một đoạn cho phạm vi đó, và phần chú thích đầu tệp của Recipe của nó nêu tên chú thích ranh giới mà Release đặt, như Triển khai ở phạm vi subscription và Triển khai ở phạm vi management group mô tả. Một loại chỉ ghi được ở phạm vi tenant, hoặc chỉ như một phần mở rộng của tài nguyên khác, sẽ bị từ chối theo tên.

Bí mật

Giá trị của một thuộc tính secret không bao giờ được ghi vào một bản nháp, và không có giá trị mặc định nào được soạn nháp cho nó. Cách nó đến được tài nguyên tùy theo provider:

  • Azure: một tham số securestring cấp cao nhất của template, đặt tên theo instance và thuộc tính, mà bạn cung cấp khi triển khai. Một secret mà nhà cung cấp đánh dấu là tùy chọn vẫn là một tham số bắt buộc.
  • CloudFormation: một mục Parameters của template được đánh dấu NoEcho, đặt tên theo cùng cách. Một secret mà nhà cung cấp đánh dấu là tùy chọn vẫn là một tham số bắt buộc.
  • Terraform: một slot Feature trên Component, và một biến module được đánh dấu sensitive: true; giá trị đến qua secret mà Release gắn vào slot.

Chỉ một thuộc tính ở cấp cao nhất của tài nguyên mới trở thành secret — trên Azure là một khóa gốc hoặc một thành viên của properties. Một thành viên nhạy cảm bên dưới nó, chẳng hạn adminPassword bên trong osProfile của Azure hay password bên trong một khối Terraform, không được soạn nháp thành secret: Release đặt nó như một giá trị thuần bên trong khóa mà phần tử cha của nó được soạn nháp dưới đó, và lần nhập cảnh báo về từng thành viên như vậy dưới constraint-dropped, nêu tên đường dẫn của nó và khóa đó.

Một thuộc tính CloudFormation được đọc là secret khi tên của nó chứa một từ thông tin xác thực — password, secret, token, credential, private key, API key hoặc passphrase — và không kết thúc bằng Arn, Id, Name hay Ref. Cách đọc đó là một quy ước của bản nháp, và phần chú thích đầu tệp của Recipe đánh dấu từng thuộc tính nó đọc là secret, để bạn xác nhận chúng khi xem xét.

Cùng một lần nhập với CloudFormation và Terraform

Các bước giống nhau; chỉ khác tệp xuất và hình dạng của Recipe. Hai trường hợp dưới đây được soạn nháp từ các schema tổng hợp, và văn bản của nhà cung cấp được lược khỏi phần tiếp theo.

CloudFormation

Terminal window
aws cloudformation describe-type --type RESOURCE --type-name AWS::Example::Ledger > ledger.json
aggrega import ledger.json

Lần nhập ghi một Component và một Recipe, cùng một cảnh báo cho mỗi ràng buộc của nhà cung cấp mà nó không thể mang theo:

wrote catalog/component/imported/component/aws-example-ledger/0.1.0/component.yaml
wrote catalog/recipe/cloudformation/aws-example-ledger/0.1.0/recipe.yaml
wrote .aggrega-import.json
read 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 object
mapped AWS::Example::Ledger (AWS::Example::Ledger) to imported/component/aws-example-ledger as a draft, NONE at 0.0167

template.yaml của Recipe khai báo tài nguyên dưới một logical id mà instance đặt cho nó, với secret là một tham số NoEcho và mỗi khóa provides được viết dưới dạng !Ref hoặc !GetAtt, lặp lại dưới provides để provider cloudformation chiếu nó vào Outputs của stack:

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 }}.Arn

Terraform

Terminal window
terraform init && terraform providers schema -json > schema.json
aggrega import schema.json
wrote catalog/component/imported/component/aws-example-ledger/0.1.0/component.yaml
wrote catalog/recipe/terraform/aws-example-ledger/0.1.0/recipe.yaml
wrote catalog/recipe/terraform/aws-example-ledger/0.1.0/module/main.tf.json
wrote .aggrega-import.json

Một tệp xuất Terraform nêu tên các provider mà một cấu hình yêu cầu nhưng không nêu phiên bản nào của chúng, nên lần nhập cảnh báo:

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

Một bản nháp Terraform là một Recipe kèm một module bên cạnh. module/main.tf.json khai báo một biến cho mỗi đầu vào, một tài nguyên duy nhất, this, với mỗi đối số được đọc từ biến của nó, và provider mà tệp xuất nêu tên. spec.source của Recipe trỏ tới module, và valuesMapping của nó điền từng biến từ các trụ cột của Component, chỉ ghi một đầu vào tùy chọn khi Release đặt nó. Hãy ghim module trước lần pull đầu tiên, để lockfile ghi lại digest của nó:

Terminal window
aggrega pin catalog/recipe/terraform/aws-example-ledger/0.1.0/recipe.yaml
Pinned 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 entity

Một Recipe chưa được ghim làm pull dừng lại, nêu tên aggrega pin. Hãy ghim lại sau mỗi lần chỉnh sửa module.

Các dòng Aggregate, Manifest và Release giống như ở trường hợp Azure, với các tên đã soạn nháp và infra riêng của provider: một Release Terraform nêu tên các khóa vị trí đặt của provider, chẳng hạn region, ở nơi Component khai báo chúng.

Một Component mà catalog đã có

Khi catalog có một Component cho dịch vụ, và chỉ thiếu Recipe cho provider của bạn, hãy nêu tên Component đó trong thiết lập. Khi đó lần nhập chỉ soạn nháp Recipe, được viết dựa trên các trụ cột của Component. Mỗi mục của resource_types là một tên loại, hoặc một đối tượng gồm loại và Component:

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/identity

Recipe lấy tên identity-microsoft-managedidentity-userassignedidentities, theo Component, nên nó không bao giờ lấy tên của một Recipe mà catalog đã có. Một Component của catalog khai báo một khóa values có tên giống một thuộc tính của loại sẽ đọc thuộc tính đó từ values; một thuộc tính mà nhà cung cấp yêu cầu còn Component không có khóa nào cho nó thì được đọc từ infra.overrides, kèm một assertion làm build dừng lại cho đến khi Release đặt nó. Mỗi khóa mà Component cung cấp khớp tên với một thuộc tính đọc ngược thì được ghi. Với mọi khóa khác, bản nháp ghi một template thất bại và nêu tên khóa, nên build dừng lại cho đến khi bạn ánh xạ nó, và lần nhập cảnh báo:

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

Azure lồng thuộc tính này dưới properties, nên dòng cần viết là dòng mà bản nháp đầy đủ của loại đó mang:

provides:
principal_id: "[reference('{{ .locals.symbol }}').principalId]"

Khi đã viết dòng đó, Release nêu tên Component trong Aggregate của nó và Recipe trong Manifest của nó như ở trên, đặt vị trí dưới infra.overrides.location, rồi validate và build ra cùng một template.

Một tên mà catalog không có Component nào được soạn nháp thành một Component mới dưới tên đó, và lần nhập cảnh báo, để một tên gõ sai một Component không bị nhầm là một Component mới.

Tiếp theo nên đọc gì

  • Core importers mô tả mỗi trình nhập đọc gì, cách nó chọn giữa nhiều loại và giữa nhiều provider, cách phân chia đầy đủ, mỗi target soạn nháp gì và các chẩn đoán mà ba trình nhập báo cáo.
  • Provider arm mô tả template mà một bản nháp Azure được gộp vào và các phạm vi nó triển khai.
  • aggrega import là tài liệu tham khảo đầy đủ của lệnh.