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

세션 녹화용 Terraform 패턴

원문 보기 위키 갱신

세션 녹화용 Terraform 패턴 (Terraform patterns for session recording)

Terraform 패턴으로 Boundary 세션 녹화를 활성화할 수 있어요. 스코프에 대한 보존 규칙을 정의하는 스토리지 정책을 만들고, AWS(Amazon Web Services) S3 기반 녹화를 담는 스토리지 버킷을 연결한 다음, 타깃에서 녹화를 활성화합니다.

이 예시는 S3 버킷이나 관련 IAM(Identity and Access Management) 정책을 만드는 것을 다루지 않습니다. AWS 구성 방법은 스토리지 버킷 만들기 문서를 참고하세요.

출처: HashiCorp Boundary docs

본문

사전 요구 사항

이 문서는 독자가 다음을 갖추고 있다고 가정합니다:

  • Terraform 기초에 대한 이해
  • 기존 Boundary 설치
  • Terraform Boundary 프로바이더 구성
  • 만들려는 스토리지 정책에 대한 스코프 생성

스토리지 정책 구성

이 예시는 프로젝트 스코프에 대한 Boundary 스토리지 정책을 만듭니다.

# Create the storage policy. This policy is effective for the attached scope
resource "boundary_policy_storage" "example" {

  # The policy applies to all recordings in this scope
  scope_id = boundary_scope.project.id

  name = "soc2-policy"
  description = "SOC 2 compliant storage policy for session recordings"

  # These define your retention parameters
  retain_for_days = 2557
  retain_for_overridable = false

  delete_after_days = 2657
  delete_after_overridable = true
}

스토리지 버킷 구성

이 예시는 Boundary 스토리지 버킷을 만들고 S3 버킷에 연결합니다.

resource "boundary_storage_bucket" "aws_bucket" {
  name        = "My aws storage bucket with dynamic credentials"
  description = "My first storage bucket"
  scope_id    = boundary_scop.project.id
  plugin_name = "aws"

  # This must match the name of the AWS S3 bucket that stores the recordings
  bucket_name = "mybucket1"

  # The role_arn value must be the same arn used as the instance profile
  # attached to your Boundary Worker ec2 instance
  # https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html
  attributes_json = jsonencode({
    "region"                      = "us-east-1"
    "role_arn"                    = "arn:aws:iam::123456789012:role/S3Access"
    "disable_credential_rotation" = true
  })
}

이제 세션 녹화를 위한 사전 요구 사항이 구성되었습니다. 마지막 작업은 Boundary 타깃에서 녹화를 활성화하는 것입니다.

관련 세션 녹화 및 스토리지 버킷 문서

이 주제에서 언급한 Boundary 리소스에 대한 자세한 내용은 도메인 모델 문서를 참고하세요:

Terraform으로 다음 리소스를 관리하는 방법에 대한 자세한 내용은 Boundary 프로바이더 문서를 참고하세요:

더 알아보기 (Learn more)

세션 녹화 사전 요구 사항을 구성했다면, Boundary 타깃에서 녹화를 활성화할 수 있어요.