terraform metadata functions 명령
terraform metadata functions 명령
terraform metadata functions 명령은 현재 Terraform 버전에서 사용할 수 있는 함수의 시그니처를 출력해요. 이 문서는 명령 사용법과 JSON 출력 형식에 대해 설명해요.
출처: 문서
본문
terraform metadata functions 명령은 현재 Terraform 버전에서 사용할 수 있는 함수의 시그니처를 출력해요.
terraform metadata functions는 Terraform v1.4 이상이 필요해요.
사용법
사용법: terraform metadata functions [options]
다음 플래그를 사용할 수 있어요:
-json- 함수 시그니처를 기계가 읽을 수 있는 JSON 형식으로 표시해요.
현재 이 -json 플래그는 필수 옵션이라는 점에 유의하세요. 향후 릴리스에서는 이 명령이 추가 옵션을 허용하도록 확장될 예정이에요.
출력에는 format_version 키가 포함되며, 이 값은 Terraform 1.4.0 기준으로 "1.0"이에요. 이 버전의 의미는 다음과 같아요:
- 하위 호환되는 변경이나 추가 사항에 대해서는 부 버전을 증가시킬 거예요(예:
"1.1"). 향후 부 버전과의 호환성을 유지하려면 인식되지 않는 이름의 객체 속성은 무시하세요. - 하위 호환되지 않는 변경 사항에 대해서는 주 버전을 증가시킬 거예요(예:
"2.0"). 지원되지 않는 주 버전을 보고하는 입력은 거부하세요.
새 주 버전은 Terraform 1.0 호환성 약속의 범위 안에서만 도입할 거예요.
형식 요약
다음 섹션들은 의사(pseudo)-JSON 표기법을 사용해 예시로 JSON 출력 형식을 설명해요. 중요한 요소는 //로 접두어가 붙은 주석으로 설명돼요.
과도한 반복을 피하기 위해 전체 형식을 몇 개의 개별 하위 객체로 나누어 별도의 제목 아래에 설명했어요. 꺾쇠 괄호(0처럼)로 감싼 참조는 실제 출력에서 지정된 하위 객체의 인스턴스로 대체되는 자리 표시자예요.
JSON 출력 형식은 다음 객체와 하위 객체로 구성돼요:
- 함수 시그니처 표현 (Function Signature Representation) -
terraform metadata functions -json이 반환하는 최상위 객체 - 매개변수 표현 (Parameter Representation) - 시그니처의 매개변수를 설명하는 하위 객체
함수 시그니처 표현
{
"format_version": "1.0",
// "function_signatures" describes the signatures for all
// available functions.
"function_signatures": {
// keys in this map are the function names, such as "abs"
"example_function": {
// "description" is an English-language description of
// the purpose and usage of the function in Markdown.
"description": "string",
// "return_type" is a representation of a type specification
// that the function returns.
"return_type": "string",
// "parameters" is an optional list of the positional parameters
// that the function accepts.
"parameters": [
,
…
],
// "variadic_parameter" is an optional representation of the
// additional arguments that the function accepts after those
// matching with the fixed parameters.
"variadic_parameter":
},
"example_function_two": { … }
}
}
매개변수 표현
매개변수 표현은 함수의 매개변수를 설명해요.
{
// "name" is the internal name of the parameter
"name": "string",
// "description" is an optional English-language description of
// the purpose and usage of the parameter in Markdown.
"description": "string",
// "type" is a representation of a type specification
// that the parameter's value must conform to.
"type": "string"
}