> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/panther/terraform/http.md).

# Terraform으로 HTTP 로그 소스 관리

## 개요

Panther를 사용하여 Terraform에서 HTTP 로그 소스를 정의할 수 있습니다 [Terraform 공급자](https://registry.terraform.io/providers/panther-labs/panther/latest).

HTTP 로그 소스를 만드는 다른 방법으로는 다음이 있습니다 [Panther API를 사용하여](/ko/panther/api/rest/log-sources.md) 직접 [Panther Console에서 수동으로 생성하는 방법](/ko/data-onboarding/data-transports/http.md).

## Terraform에서 Panther HTTP 로그 소스를 정의하는 방법

다음 섹션에서는 HashiCorp Configuration Language(HCL)에서 HTTP 로그 소스를 정의하는 방법을 설명합니다.

### 사전 요구 사항

* 시작하기 전에, 다음 권한이 있는 API URL과 토큰을 가지고 있는지 확인하세요 `로그 소스 관리` 권한. 이는 완료하는 데 필요합니다 [3단계](#step-3-provide-values-for-the-defined-variables).
  * 필요한 경우, 다음을 따르세요 [Panther Console에서 API 토큰을 생성하는 방법에 대한 이 지침](/ko/panther/api.md#how-to-create-a-panther-api-token).

### 1단계: 인증 방법 선택

* HTTP 엔드포인트에 대한 인증 방법을 다음에서 선택하세요 [HTTP Source에 나열된 옵션](/ko/data-onboarding/data-transports/http.md#authentication).

선택한 인증 방법에 따라 아래 2단계에서 정의할 변수가 결정됩니다.

### 2단계: 변수 정의

* 다음 파일을 정의하세요 `다음 AWS 및 Panther 변수가 포함된 variables.tf` 아래 코드 블록에 표시된 Panther 변수가 포함된 파일을

```hcl
variable "panther_api_token" {
  description = "Panther API 토큰"
  type        = string
}

variable "panther_api_url" {
  description = "Panther API URL"
  type        = string
}

variable "integration_label" {
  description = "통합의 이름."
  type        = string
}

variable "auth_method" {
  description = "사용된 인증 방법."
  type        = string
}

// 인증 변수는 auth_method에 따라 다릅니다. 아래 표를 참조하세요
variable "auth_header_key" {
  description = "인증 헤더의 키입니다."
  type        = string
}

variable "auth_secret_value" {
  description = "인증 비밀 값입니다."
  type        = string
  sensitive   = true
}

// (선택 사항) log_stream_type = "JsonArray"일 때만 관련 있음
variable "json_array_envelope_field" {
  description = "JSON 배열 스트림의 봉투 필드"
  type        = string
}
```

#### 인증 방법별 변수

귀하의 `다음 AWS 및 Panther 변수가 포함된 variables.tf` 파일에 다음의 값을 포함하세요 **추가 변수** 1단계에서 선택한 인증 방법에 대한 아래 열

<table><thead><tr><th width="243">인증 방법</th><th width="204">auth_method 값</th><th>추가 변수</th></tr></thead><tbody><tr><td><a href="/pages/870f6dc04081a3b22b886ba096ae60d3e6e424a6#shared-secret">공유 비밀</a></td><td><code>SharedSecret</code></td><td><code>auth_header_key</code>, <code>auth_secret_value</code></td></tr><tr><td><a href="/pages/870f6dc04081a3b22b886ba096ae60d3e6e424a6#hmac">HMAC</a></td><td><code>HMAC</code></td><td><code>auth_header_key</code>, <code>auth_secret_value</code></td></tr><tr><td><a href="/pages/870f6dc04081a3b22b886ba096ae60d3e6e424a6#bearer">Bearer</a></td><td><code>Bearer</code></td><td><code>auth_bearer_token</code></td></tr><tr><td><a href="/pages/870f6dc04081a3b22b886ba096ae60d3e6e424a6#basic">기본</a></td><td><code>기본</code></td><td><code>auth_username</code>, <code>auth_password</code></td></tr><tr><td><a href="/pages/870f6dc04081a3b22b886ba096ae60d3e6e424a6#none">없음</a> (권장하지 않음)</td><td><code>없음</code></td><td></td></tr></tbody></table>

### 3단계: 정의한 변수에 값을 제공

* 다음을 추가하세요 `*.tfvars` 2단계에서 정의한 변수에 값을 할당하는 파일입니다. 이 섹션을 완료하려면 다음에 설명된 API URL과 토큰이 필요합니다. [전제 조건 섹션](#prerequisite).
  * 사용자의 `panther_api_url` 값은 루트 API URL이어야 합니다. 이는 다음 중 하나입니다:
    * A [GraphQL API URL](/ko/panther/api/graphql.md#step-1-identify-your-panther-graphql-api-url) 다음 없이 `/public/graphql` 접미사
    * A [REST API URL](/ko/panther/api/rest.md#step-1-identify-your-panther-rest-api-url) 그대로 사용 (REST URL에는 루트 URL 뒤에 접미사가 없습니다)

```hcl
panther_api_token         = "XXXXXXXXXX"
panther_api_url           = "https://your-panther-url/v1"
integration_label         = "test-integration"
auth_method               = "SharedSecret" // SharedSecret, HMAC, Bearer, Basic 또는 None
// 인증 변수는 auth_method에 따라 다릅니다. 2단계의 표를 참조하세요
auth_header_key           = "x-api-key"
auth_secret_value         = "XXXXXXXXXX"
json_array_envelope_field = "records"
```

### 4단계: Terraform 공급자 정의

* 다음을 추가하세요 [Panther](https://registry.terraform.io/providers/panther-labs/panther/latest) Terraform 공급자.

```hcl
terraform {
  required_providers {
    panther = {
      source = "panther-labs/panther"
      version = "~> 0.2.10"
    }
  }
}
```

### 5단계: Panther HTTP 로그 소스 정의

다음 HCL 구성은 Panther에서 HTTP 로그 소스를 정의합니다.

```hcl
provider "panther" {
  token = var.panther_api_token
  url   = var.panther_api_url
}

resource "panther_httpsource" "demo_http_source" {
  integration_label = var.integration_label
  log_stream_type   = "JSON" // 옵션: JSON, JsonArray, Auto, Lines 및 CloudWatchLogs
  log_types         = ["AWS.CloudTrail"]
  auth_method       = var.auth_method
  // 인증 변수는 auth_method에 따라 다릅니다. 2단계의 표를 참조하세요
  auth_header_key   = var.auth_header_key
  auth_secret_value = var.auth_secret_value
  // (선택 사항) log_stream_type = "JsonArray"일 때만 관련 있음
  log_stream_type_options = {
    json_array_envelope_field = var.json_array_envelope_field
  }
}
```

### 6단계: 드롭오프 알러트 구성(선택 사항)

로그 소스가 데이터 수신을 중단할 때 알러트를 트리거하려면 다음을 추가하세요 `panther_log_source_alarm` 위에서 생성한 HTTP 소스를 가리키는 리소스:

```hcl
resource "panther_log_source_alarm" "demo_alarm" {
  source_id         = panther_httpsource.demo_http_source.id
  type              = "SOURCE_NO_DATA"
  minutes_threshold = 60
}
```

전체 인수 참조 및 가져오기 구문은 다음을 참조하세요 [Terraform으로 로그 소스 알람 관리](/ko/panther/terraform/log-source-alarms.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/ko/panther/terraform/http.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
