본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

컨슈머 그룹 관리 허용

원문 보기 위키 갱신

컨슈머 그룹 관리 허용 (ACLs: Allow consumer group management)

이 문서에서는 ACL을 사용하여 컨슈머 그룹을 생성하고 삭제하는 방법을 설명해요. Kong Event Gateway에서 ACL 정책을 설정하는 절차를 Konnect API, Terraform, kongctl을 통해 알아볼 수 있어요. 정책을 설정할 때 필요한 리소스와 조건을 이해하는 데 도움을 줘요.

출처: 문서

본문

컨슈머 그룹 관리 허용

주체가 컨슈머 그룹을 생성하고 삭제할 수 있도록 허용해요.

정책 설정하기

클러스터 단계

Konnect API
curl -X POST https://{region}.api.konghq.com/v1/event-gateways/{eventGatewayId}/virtual-clusters/{virtualClusterId}/cluster-policies \
    --header "accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer $KONNECT_TOKEN" \
    --data '
    {
      "name": "acl_policy",
      "type": "acls",
      "config": {
        "rules": [
          {
            "resource_type": "group",
            "action": "allow",
            "operations": [
              {
                "name": "create"
              },
              {
                "name": "delete"
              }
            ],
            "resource_names": [
              {
                "match": "my_resource"
              }
            ]
          }
        ]
      }
    }
    '

다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.

  • region: Kong Konnect가 호스팅되고 운영되는 지리적 리전이에요.

  • KONNECT_TOKEN: Konnect 계정과 연결된 개인 액세스 토큰(PAT)이에요.

  • virtualClusterId: 가상 클러스터의 id예요.

  • eventGatewayId: 이벤트 게이트웨이의 id예요.

  • eventGatewayListenerId: 이벤트 게이트웨이 리스너의 id예요.

리전별 URL과 개인 액세스 토큰에 대해 알아보려면 Konnect Event Gateway API 참조를 확인하세요.

Terraform
전제 조건: 개인 액세스 토큰 설정하기
terraform {
  required_providers {
    konnect-beta = {
      source  = "kong/konnect-beta"
    }
  }
}

provider "konnect-beta" {
  personal_access_token = "$KONNECT_TOKEN"
  server_url            = "https://us.api.konghq.com/"
}

다음을 Terraform 구성에 추가하세요.

resource "konnect_event_gateway_cluster_policy_acls" "my_virtual_cluster_policy_acls" {
  provider = konnect-beta
  type = "acls"
  config = {
    rules = [
      {
        resource_type = "group"
        action = "allow"
        operations = [
          {
            name = "create"
          }, 

          {
            name = "delete"
          }        ]
        resource_names = [
          {
            match = "my_resource"
          }        ]
      }    ]
  }


  virtual_cluster_id = konnect_event_gateway_virtual_cluster.my_virtual_cluster.id

  gateway_id = konnect_event_gateway.my_event_gateway.id
}
kongctl

다음 예제는 새로운 acls 정책을 생성해요.

event_gateways:
  - ref: eventGatewayName
    name: eventGatewayName
    virtual_clusters:
    - ref: virtualClusterName
      name: virtualClusterName
      cluster_policies:
      - ref: acl_policy
        type: acls
        acls:
          name: acl_policy
          config:
            rules:
            - resource_type: group
              action: allow
              operations:
              - name: create
              - name: delete
              resource_names:
              - match: my_resource

{: data-file="event_gateway_policy.yaml" data-tool="kongctl" }

다음 플레이스홀더를 자신의 값으로 바꾸는 것을 잊지 마세요.

  • eventGatewayName: 이벤트 게이트웨이의 name이에요.

  • virtualClusterName: 가상 클러스터의 name이에요.

관련 리소스

더 알아보기 (Learn more)