Amazon EventBridge에서 이벤트 JSON으로부터 스키마 생성 - Amazon EventBridge

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

Amazon EventBridge에서 이벤트 JSON으로부터 스키마 생성

이벤트의 JSON이 있는 경우 해당 이벤트 유형에 대한 스키마를 자동으로 생성할 수 있습니다.

이벤트의 JSON을 기반으로 스키마를 생성하려면
  1. https://console.aws.amazon.com/events/에서 Amazon EventBridge 콘솔을 엽니다.

  2. 탐색 창에서 스키마를 선택한 다음, 스키마 생성을 선택합니다.

  3. (선택 사항) 스키마 레지스트리를 선택하거나 생성합니다.

  4. Schema details(스키마 세부 정보)에서 스키마의 이름을 입력합니다.

  5. (선택 사항) 생성한 스키마에 대한 설명을 입력합니다.

  6. 스키마 유형에는 OpenAPI 3.0을 선택합니다.

    이벤트의 JSON에서 스키마를 생성할 때는 JSONSchema를 사용할 수 없습니다.

  7. Discover from JSON(JSON에서 검색)을 선택합니다.

  8. JSON 아래의 텍스트 상자에서 이벤트의 JSON 소스를 붙여넣거나 끌어옵니다.

    예를 들어 실패한 실행에 대해 이 AWS Step Functions 이벤트의 소스를 붙여넣을 수 있습니다.

    { "version": "0", "id": "315c1398-40ff-a850-213b-158f73e60175", "detail-type": "Step Functions Execution Status Change", "source": "aws.states", "account": "012345678912", "time": "2019-02-26T19:42:21Z", "region": "us-east-1", "resources": [ "arn:aws:states:us-east-1:012345678912:execution:state-machine-name:execution-name" ], "detail": { "executionArn": "arn:aws:states:us-east-1:012345678912:execution:state-machine-name:execution-name", "stateMachineArn": "arn:aws:states:us-east-1:012345678912:stateMachine:state-machine", "name": "execution-name", "status": "FAILED", "startDate": 1551225146847, "stopDate": 1551225151881, "input": "{}", "output": null } }
  9. Discover schema(스키마 발견)를 선택합니다.

  10. EventBridge는 이벤트에 대한 OpenAPI 스키마를 생성합니다. 예를 들어 이전 Step Functions 이벤트에 대해 다음 스키마가 생성됩니다.

    { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "StepFunctionsExecutionStatusChange" }, "paths": {}, "components": { "schemas": { "AWSEvent": { "type": "object", "required": ["detail-type", "resources", "detail", "id", "source", "time", "region", "version", "account"], "x-amazon-events-detail-type": "Step Functions Execution Status Change", "x-amazon-events-source": "aws.states", "properties": { "detail": { "$ref": "#/components/schemas/StepFunctionsExecutionStatusChange" }, "account": { "type": "string" }, "detail-type": { "type": "string" }, "id": { "type": "string" }, "region": { "type": "string" }, "resources": { "type": "array", "items": { "type": "string" } }, "source": { "type": "string" }, "time": { "type": "string", "format": "date-time" }, "version": { "type": "string" } } }, "StepFunctionsExecutionStatusChange": { "type": "object", "required": ["output", "input", "executionArn", "name", "stateMachineArn", "startDate", "stopDate", "status"], "properties": { "executionArn": { "type": "string" }, "input": { "type": "string" }, "name": { "type": "string" }, "output": {}, "startDate": { "type": "integer", "format": "int64" }, "stateMachineArn": { "type": "string" }, "status": { "type": "string" }, "stopDate": { "type": "integer", "format": "int64" } } } } } }
  11. 스키마가 생성된 후 생성을 선택합니다.