콘텐츠로 이동
AggregaAggregaAggregaAggrega
언어 선택: 한국어
이 페이지는 기계 번역되었습니다. 영어 원문 읽기.

카탈로그에 없는 서비스 배포하기

카탈로그에 클라우드 서비스용 Component가 없을 때는 해당 서비스의 리소스 타입에 대한 벤더 자체의 설명이 그 Component를 대신할 수 있습니다. aggrega import는 이 설명 — 클라우드 벤더가 리소스 타입에 대해 게시하는 스키마 — 을 읽고 그로부터 두 개의 파일을 초안으로 작성합니다. 하나는 Aggrega가 읽는 필러 안에 해당 타입의 설정을 선언하는 Component이고, 다른 하나는 그 타입의 리소스를 정확히 하나 작성하여 해당 Component를 프로바이더용으로 구현하는 Recipe입니다. 사용자는 초안을 검토하고, 이를 사용하는 항목을 Aggregate와 Release에 추가한 다음 빌드합니다.

세 가지 형식을 읽으며, 각 형식은 이를 담당하는 코어 임포터가 읽습니다.

형식내보내는 스키마Recipe의 provider
cloudformation-schemaCloudFormation 리소스 타입. aws cloudformation describe-type 또는 프로바이더 스키마 파일에서 얻습니다cloudformation
terraform-schemaTerraform 또는 OpenTofu 프로바이더의 스키마. terraform providers schema -json에서 얻습니다terraform
arm-schemaAzure 리소스 프로바이더의 Bicep 타입 파일 types.jsonarm

이 페이지는 Azure 사례를 처음부터 끝까지 따라간 다음, CloudFormation과 Terraform 사례, 그리고 카탈로그에 이미 있는 Component에 대해 Recipe만 초안으로 작성하는 변형을 보여 줍니다. 아래 Azure 부분의 명령과 출력은 이 임포터들과 arm 프로바이더를 포함하는 컴파일러 릴리스의 빌드를 실행한 결과입니다.

사용자를 대신해 가져오는 것은 없습니다. 벤더 자체 도구로 스키마를 내보내므로, 가져오기는 사용자가 가진 파일을 읽을 뿐 클라우드 계정에는 접근하지 않습니다.

스키마 내보내기

각 벤더의 도구는 스키마를 파일에 씁니다. 작업 공간에서 사용하는 클라우드에 맞는 도구를 실행합니다.

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.

아래 Azure 사례는 API 버전 2024-11-30의 Microsoft.ManagedIdentity 파일을 사용하며, 이 파일은 Bicep이 붙이는 이름 types.json으로 msi라는 폴더에 보관되어 있습니다.

Azure 스키마 파일과 그 라이선스

API 버전 2024-11-30의 Microsoft.ManagedIdentity의 types.json은 Azure/bicep-types-az 저장소에 있는 파일로, 저작권은 Microsoft Corporation에 있으며 MIT 라이선스로 배포됩니다. 아래 초안이 인용하는 설명은 Microsoft의 것이며, 라이선스의 고지가 이에 적용됩니다.

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 키가 있는 .aggrega-config.yaml을 담은 폴더이며, 그 안에 해당 파일이 든 msi 폴더가 있습니다.

.aggrega-config.yaml
msi/types.json

초안으로 작성할 타입 나열하기

스키마 파일에는 리소스 타입이 둘 이상 들어 있을 수 있으며, 가져오기는 사용자가 이름을 지정한 타입만 초안으로 작성합니다. 파일에 들어 있는 타입을 나열합니다.

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

그런 다음 .aggrega-config.yaml의 임포터 항목에 있는 resource_types 설정 아래에 원하는 타입의 이름을 지정합니다. 모든 작업 공간은 이미 임포터를 제공하므로, 이 항목은 resource_types를 전달하는 데에만 필요합니다. 항목의 uri는 임포터와 컴파일러의 버전을 지정하며, 이 버전은 aggrega version이 출력합니다. 임포터는 이러한 항목을 통해 설정을 전달받으며, 이는 어떤 임포터가 소스를 초안으로 변환하는가에서 설명합니다.

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

이름은 CloudFormation(AWS::SQS::Queue)과 Terraform(aws_sqs_queue)에서는 정확히 일치해야 하고, Azure에서는 대소문자를 구분하지 않고 일치하며 이름이 @ 뒤에 API 버전을 붙일 수 있습니다. 정확히 하나의 타입이 들어 있는 파일에는 목록이 필요하지 않습니다. 여러 타입이 들어 있고 목록이 없는 파일을 가져오면 가져오기가 중단되며 해당 타입들의 이름을 알려 줍니다.

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

나열한 타입이 파일에 없는 경우에도 가져오기가 중단되며, 파일에 있는 가장 가까운 이름을 알려 줍니다. 중단되면 초안은 작성되지 않으므로 어떤 파일도 쓰이지 않습니다.

가져오기 실행

폴더 또는 파일의 이름을 지정합니다.

Terminal window
aggrega import msi

표준 출력에는 작성한 것을 나열합니다:

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

표준 오류에는 다음과 같이 출력합니다. 여기서 <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.05

aggrega import는 Azure/bicep-types-az가 이름 붙이는 방식대로 types.json이라는 이름의 Bicep 타입 파일을 인식하며, 다른 이름의 파일에는 --format arm-schema가 그 형식을 지정합니다. --format은 또한 프로바이더의 전체 Terraform 스키마와 같은 큰 내보내기를, 가져오기가 먼저 인식하지 않아도 가져오는 방법이기도 합니다.

mapped 줄은 리소스 타입이 가까운 카탈로그 Component 없이 그 자체의 초안이 되었다는 뜻입니다. 초안은 작업 공간이 카탈로그로 읽는 폴더인 catalog/ 아래에 작성되므로, 구성할 것 없이 다음 검증과 빌드에서 해석됩니다. 기록 .aggrega-import.json이 초안을 나열하므로, aggrega import --sync는 사용자가 한 편집을 덮어쓰지 않고 변경된 스키마에 맞게 초안을 최신 상태로 만들 수 있습니다.

초안의 내용

Component component.yaml은 리소스 타입의 각 속성을 하나의 필러으로 분류하며, 각 키 옆의 주석은 그 속성을 배치한 규칙을 알려 줍니다.

  • 읽기 전용(read-back) 속성, 즉 클라우드가 설정하며 사용자는 설정할 수 없는 속성은 입력이 아닙니다. 스칼라는 소비자가 읽을 수 있는 provides 키가 됩니다.
  • 시크릿은 값이 아니라 그 값이 어디에서 오는지를 가리키는 참조로 초안이 작성되며, 자세한 내용은 아래의 시크릿에서 설명합니다.
  • 리소스가 위치하는 곳인 배치, 예를 들어 Azure의 location은 운영자가 환경마다 제공하는 필러인 infra에 들어갑니다.
  • 리소스 자체의 이름인 식별자는 개발자가 작성하는 필러인 values에 들어갑니다.
  • 그 밖의 필수 속성은 infra에 들어갑니다.
  • 그 밖의 쓰기 가능한 속성은 infra.overrides 아래에 들어갑니다. 이는 각 이름에 대해 벤더 자체의 표기를 그대로 유지하는 열린 맵입니다.

이 리소스 타입에 대한 Component는 다음과 같습니다.

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

초안이 벤더의 스키마에서 가져오는 모든 텍스트는 [vendor schema text]로 시작하므로, Component가 작업 공간을 떠나기 전에 이를 찾아 직접 표현으로 다시 쓸 수 있습니다. 가져오기가 직접 구성한 텍스트에는 표시가 없습니다.

Recipe recipe.yaml은 arm 프로바이더에서 Component를 구현합니다. 헤더 주석은 이 Recipe가 읽는 모든 키를 규칙 및 타입과 함께 나열하고, 읽지 않는 것도 알려 줍니다.

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는 타입이 지정하는 리소스 하나만 작성하고 그 외에는 아무것도 작성하지 않습니다. 리소스 그룹도, 네트워크도, 선언하지 않은 ID도 없습니다. 각 provides 값은 템플릿이 배포될 때 Azure가 평가하는 완전한 표현식이며, 그 문자열 그대로 소비자에게 전달됩니다. 헤더가 나열하지 않는 infra.overrides 키는 해당 키의 이름을 알려 주며 빌드를 중단시키므로, 철자가 틀린 설정은 어떤 것도 배포되기 전에 잡힙니다.

빌드하기 전에 두 파일을 모두 검토합니다. 설정을 필러 사이에서 옮기는 것은 Component와 이에 대한 Recipe의 해석을 편집하는 일이며, 이 파일들은 사용자의 것입니다. 빌드가 의존하는 것은 다른 어디에도 보관되지 않습니다.

Aggregate와 Release에서 초안 사용하기

가져오기는 Aggregate도, Manifest도, Release도 초안으로 작성하지 않으므로, 초안으로 작성된 Component를 사용하는 항목은 사용자가 작성합니다. Aggregate인 aggregate.yaml에는 values 필러가 담은 식별자를 가지는, 초안으로 작성된 타입의 component 하나를 작성합니다.

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

Manifest인 manifest.yaml에는 어떤 Recipe가 해당 타입을 구현하는지를 알려 주는 한 줄을 작성합니다.

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

Release인 release.yaml에는 component가 놓이는 경계와, Recipe가 요구하는 infra 필러인 배치를 작성합니다.

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

검증 및 빌드

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

Release가 의존하는 것을 pull한 다음 빌드합니다.

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

빌드는 azure 경계의 템플릿 하나인 dist/azure/arm/arm-template.json을 작성하며, 여기에는 인스턴스가 지정하는 심볼 이름으로 리소스 하나가 들어 있습니다. 빌드는 리소스 자체의 멤버 옆에, 어떤 Aggregate, Release, Recipe가 이를 생성했는지를 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에 전달하는 대상이며, arm 프로바이더는 이를 리소스 그룹 범위에서 배포하는 명령을 설명합니다. 구독 또는 관리 그룹 범위에서만 쓸 수 있는 리소스 타입은 해당 범위의 조각으로 초안이 작성되며, 그 Recipe의 헤더는 Release가 설정하는 경계 어노테이션을 알려 줍니다. 이는 구독 범위에서 배포하기와 관리 그룹 범위에서 배포하기에서 설명합니다. 테넌트 범위에서만 쓸 수 있거나 다른 리소스의 확장으로만 쓸 수 있는 타입은 이름을 밝히며 거부됩니다.

시크릿

시크릿 속성의 값은 초안에 절대 기록되지 않으며, 그에 대한 기본값도 초안으로 작성되지 않습니다. 값이 리소스에 전달되는 방식은 프로바이더에 따라 다릅니다.

  • Azure: 템플릿의 최상위 securestring 파라미터이며, 인스턴스와 속성의 이름을 따서 이름이 붙고, 배포할 때 사용자가 제공합니다. 벤더가 선택 사항으로 표시한 시크릿은 필수 파라미터입니다.
  • CloudFormation: NoEcho로 표시된 템플릿 Parameters 항목이며, 같은 방식으로 이름이 붙습니다. 벤더가 선택 사항으로 표시한 시크릿은 필수 파라미터가 됩니다.
  • Terraform: Component의 Feature 슬롯과 sensitive: true로 표시된 모듈 변수이며, 값은 Release가 슬롯에 연결하는 시크릿을 통해 전달됩니다.

리소스의 최상위에 있는 속성만 시크릿이 됩니다. Azure에서는 루트 키 또는 properties의 멤버입니다. 그 아래에 있는 민감한 멤버, 예를 들어 Azure osProfile 안의 adminPassword나 Terraform 블록 안의 password는 시크릿으로 초안이 작성되지 않습니다. Release는 그 부모의 초안이 작성되는 키 안에 일반 값으로 설정하고, 가져오기는 그런 멤버마다 constraint-dropped 아래에서 경로와 그 키를 밝히며 경고합니다.

CloudFormation 속성은 이름에 자격 증명을 뜻하는 단어 — password, secret, token, credential, private key, API key 또는 passphrase — 가 들어 있고 Arn, Id, Name 또는 Ref로 끝나지 않을 때 시크릿으로 해석됩니다. 이 해석은 초안의 관례이며, Recipe의 헤더는 시크릿으로 해석한 각 속성을 표시하므로 검토할 때 이를 확인합니다.

CloudFormation과 Terraform에서의 동일한 가져오기

단계는 같으며, 내보내기와 Recipe의 형태만 다릅니다. 아래의 두 사례는 합성 스키마로 초안을 작성한 것이며, 그 벤더 텍스트는 이어지는 내용에서 생략됩니다.

CloudFormation

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

가져오기는 Component와 Recipe를 작성하며, 전달할 수 없는 벤더 제약마다 경고를 하나씩 냅니다.

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

Recipe의 template.yaml은 인스턴스가 지정하는 논리 ID 아래에 리소스를 선언하며, 시크릿은 NoEcho 파라미터로, 각 provides 키는 !Ref 또는 !GetAtt로 작성하고 provides 아래에서 반복하여 cloudformation 프로바이더가 이를 스택의 Outputs로 투영하도록 합니다.

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

Terraform 내보내기는 구성이 요구하는 프로바이더의 이름은 알려 주지만 그 버전은 알려 주지 않으므로, 가져오기가 경고합니다.

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

Terraform 초안은 옆에 모듈이 있는 Recipe입니다. module/main.tf.json은 각 입력마다 변수 하나, 리소스 하나인 this, 각 변수에서 읽는 각 인수, 그리고 내보내기가 지정하는 프로바이더를 선언합니다. Recipe의 spec.source는 모듈을 가리키고, 그 valuesMapping은 Component의 필러로 각 변수를 채우며, 선택 입력은 Release가 설정한 경우에만 작성합니다. 첫 pull 전에 모듈을 고정하여, 잠금 파일이 그 다이제스트를 기록하도록 합니다.

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

고정되지 않은 Recipe는 pull을 중단시키며 aggrega pin을 알려 줍니다. 모듈을 편집할 때마다 다시 고정합니다.

Aggregate, Manifest, Release의 항목은 Azure 사례와 같으며, 초안으로 작성된 이름과 프로바이더 자체의 infra를 사용합니다. Terraform Release는 Component가 선언하는 곳에서 region과 같은 프로바이더의 배치 키의 이름을 지정합니다.

카탈로그에 이미 있는 Component

카탈로그에 해당 서비스의 Component가 있고 사용하는 프로바이더의 Recipe만 없을 때는 설정에서 그 Component의 이름을 지정합니다. 그러면 가져오기는 Component의 필러에 맞추어 작성한 Recipe만 초안으로 작성합니다. resource_types의 각 항목은 타입 이름이거나, 타입과 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는 카탈로그에 이미 있는 Recipe의 이름을 가져가는 일이 없도록 Component를 따라 identity-microsoft-managedidentity-userassignedidentities라는 이름을 갖습니다. 타입의 속성과 같은 이름의 values 키를 선언하는 카탈로그 Component는 그 속성을 values에서 읽으며, 벤더가 요구하지만 Component에 해당 키가 없는 속성은 infra.overrides에서 읽습니다. 이때 Release가 값을 설정할 때까지 빌드를 중단시키는 어서션이 함께 작성됩니다. Component가 제공하는 키 중 이름이 읽기 전용 속성과 일치하는 키는 작성됩니다. 그 밖의 모든 키에 대해서는 초안이 키 이름을 밝히며 실패하는 템플릿을 작성하므로, 사용자가 매핑할 때까지 빌드가 중단되며 가져오기가 경고합니다.

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는 이 속성을 properties 아래에 중첩하므로, 작성해야 할 줄은 해당 타입의 전체 초안에 담긴 줄입니다.

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

그 줄을 작성하면, Release는 위와 같이 Aggregate에서 Component를, Manifest에서 Recipe를 지정하고 infra.overrides.location 아래에 배치를 설정하며, 검증과 빌드를 거쳐 같은 템플릿을 만듭니다.

카탈로그에 Component가 없는 이름은 그 이름의 새 Component로 초안이 작성되며 가져오기가 경고하므로, Component의 이름을 잘못 입력한 경우가 새 Component로 오인되지 않습니다.

다음 단계

  • 코어 임포터는 각 임포터가 읽는 것, 여러 타입과 여러 프로바이더 사이에서 선택하는 방법, 분리의 전체 내용, 각 대상이 초안으로 작성하는 것, 그리고 세 임포터가 보고하는 진단을 설명합니다.
  • arm 프로바이더는 Azure 초안이 병합되는 템플릿과 배포되는 범위를 설명합니다.
  • aggrega import는 이 명령의 전체 레퍼런스입니다.