teleport-discovery-aws Terraform 모듈 참조
Teleport v18.9소스 코드: github.com/gravitational/teleport/tree/master/integrations/terraform-modules/teleport/discovery/aws 이 Terraform 모듈은 Teleport 클러스터가 AWS 리소스를 검색하는 데 필요한 AWS 및 Teleport 클러스터 리소스를 생성합니다.
소스 코드: github.com/gravitational/teleport/tree/master/integrations/terraform-modules/teleport/discovery/aws
AWS Discovery Terraform 모듈#
이 Terraform 모듈은 Teleport 클러스터가 AWS 리소스를 검색하는 데 필요한 AWS 및 Teleport 클러스터 리소스를 생성합니다.
- Teleport Discovery Service가 어슘(assume)할 AWS IAM 역할.
- Teleport가 AWS에서 리소스를 검색하는 데 필요한 AWS 권한을 부여하는, IAM 역할에 연결된 AWS IAM 정책.
- Teleport Discovery Service가 OIDC를 사용하여 IAM 역할을 어슘하기 위한 AWS OIDC 공급자. 이 리소스는 선택 사항이며,
create_aws_iam_openid_connect_provider = false로 설정하면 생성을 비활성화할 수 있습니다. 이 리소스가 선택 사항인 이유는 다음 두 가지 시나리오를 지원하기 위해서입니다:- AWS 계정에 이미 Teleport 클러스터의 프록시 URL을 사용하도록 구성된 AWS IAM OIDC 공급자가 존재하는 경우. AWS는 고유 URL당 하나의 AWS IAM OIDC 공급자만 허용하므로, 이미 해당 공급자를 관리하고 있다면 이 모듈은 동일한 Teleport 클러스터에 대해 또 다른 공급자를 생성할 수 없습니다.
- Teleport 클러스터의 프록시 URL에 접근할 수 없어 AWS IAM OIDC 페더레이션이 불가능한 경우. 이 경우 Teleport Discovery Service 인스턴스에 대해 AWS IAM 역할 자격 증명을 구성하고,
discovery_service_iam_credential_source를 해당 역할을 신뢰하도록 설정해야 합니다.
- AWS 리소스 검색을 위해 Teleport를 구성하는 Teleport
discovery_config클러스터 리소스. - AWS OIDC를 위한 Teleport
integration클러스터 리소스. - Teleport 노드가 AWS IAM 자격 증명을 사용하여 클러스터에 조인할 수 있도록 하는 Teleport
token클러스터 리소스.
사전 요구사항#
사용법#
module "aws_discovery" {
source = "terraform.releases.teleport.dev/teleport/discovery/aws"
# Your Teleport cluster public proxy address - host:port format is required.
teleport_proxy_public_addr = "example.teleport.sh:443"
# Teleport Discovery Service instances in this discovery group will be configured to discover AWS resources.
# "cloud-discovery-group" is the group name of the discovery service instances running in Teleport Cloud clusters.
teleport_discovery_group_name = "cloud-discovery-group"
# apply additional tags to the AWS resources created by the module
apply_aws_tags = {
Terraform = "true"
Env = "dev"
}
# Configure matchers to discover EC2 instances and EKS clusters.
aws_matchers = [
{
types = ["ec2"]
# EC2 discovery supports wildcard to find instances in all regions.
regions = ["*"]
tags = {
origin = ["example"]
}
},
{
types = ["eks"]
regions = ["*"]
tags = {
team = ["platform"]
}
}
]
}
aws_matchers 필드#
| 필드 | 타입 | 기본값 | 설명 |
|---|---|---|---|
types |
list(string) |
(필수) | 검색할 AWS 리소스 타입. 허용되는 값: ec2, eks. |
regions |
list(string) |
(필수) | 검색할 AWS 리전. 모든 리전을 대상으로 하려면 "*"를 사용하세요. |
tags |
map(list(string)) |
{ "*" : ["*"] } |
일치시킬 AWS 리소스 태그. 기본값은 모든 리소스와 일치합니다. |
setup_access_for_arn |
string |
"" |
검색된 EKS 클러스터에 대한 접근을 구성할 ARN. EKS matcher에만 지원됩니다. |
kube_app_discovery |
bool |
null |
Teleport의 Kubernetes App Discovery는 쿠버네티스 클러스터 내에서 실행 중인 Teleport HTTP 애플리케이션을 자동으로 식별하고 등록합니다. |
도움을 받는 방법#
문제가 발생하면 GitHub Discussions를 확인하세요.
이 코드와 관련된 버그는 이슈를 등록해 주세요.
Requirements#
| Name | Version |
|---|---|
| terraform | >= 1.5.7 |
| aws | >= 5.0 |
| http | >= 3.0 |
| teleport | >= 18.8.0 |
| tls | >= 4.0 |
Providers#
| Name | Version |
|---|---|
| aws | >= 5.0 |
| http | >= 3.0 |
| teleport | >= 18.8.0 |
| tls | >= 4.0 |
Modules#
모듈 없음.
Resources#
| Name | Type |
|---|---|
| aws_iam_openid_connect_provider.teleport | resource |
| aws_iam_policy.teleport_discovery_service | resource |
| aws_iam_role.teleport_discovery_service | resource |
| aws_iam_role_policy_attachment.teleport_discovery_service | resource |
| teleport_discovery_config.aws | resource |
| teleport_integration.aws_oidc | resource |
| teleport_provision_token.aws_iam | resource |
| aws_caller_identity.this | data source |
| aws_iam_policy_document.teleport_discovery_service_iam_role_trust | data source |
| aws_iam_policy_document.teleport_discovery_service_single_account | data source |
| aws_partition.this | data source |
| http_http.teleport_ping | data source |
| tls_certificate.teleport_proxy | data source |
Inputs#
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| apply_aws_tags | 생성된 모든 AWS 리소스에 적용할 추가 AWS 태그. | map(string) |
{} |
no |
| apply_teleport_resource_labels | 생성된 모든 Teleport 리소스에 적용할 추가 Teleport 리소스 라벨. | map(string) |
{} |
no |
| aws_iam_policy_document | 리소스 검색을 위해 AWS IAM 역할에 연결된 AWS IAM 정책 문서를 재정의합니다. | string |
"" |
no |
| aws_iam_policy_name | 검색용 AWS IAM 정책의 이름. | string |
"teleport-discovery" |
no |
| aws_iam_policy_use_name_prefix | AWS IAM 정책 이름(aws_iam_policy_name)을 접두사로 사용할지 여부를 결정합니다. |
bool |
true |
no |
| aws_iam_role_name | 검색용 AWS IAM 역할의 이름. | string |
"teleport-discovery" |
no |
| aws_iam_role_use_name_prefix | AWS IAM 역할 이름(aws_iam_role_name)을 접두사로 사용할지 여부를 결정합니다. |
bool |
true |
no |
| aws_matchers | AWS 리소스 검색 matcher. aws_matchers.types에 유효한 값은 ec2, eks, rds입니다. | list(object({ types = list(string) regions = optional(list(string), ["*"]) tags = optional(map(list(string)), { "*" : ["*"] }) setup_access_for_arn = optional(string, "") kube_app_discovery = optional(bool) })) |
[] |
no |
| create | 모든 리소스의 생성 여부를 전환합니다. | bool |
true |
no |
| create_aws_iam_openid_connect_provider | AWS IAM OIDC 공급자 생성 여부를 전환합니다. false로 설정하고 OIDC를 사용하는 경우, AWS IAM OIDC 공급자가 이미 존재해야 합니다. | bool |
true |
no |
| discovery_service_iam_credential_source | Teleport Discovery Service 인스턴스에 대한 AWS 자격 증명 소스를 구성합니다. 기본값은 AWS OIDC 통합을 사용합니다. | object({ use_oidc_integration = optional(bool, true) trust_role = optional(object({ role_arn = string external_id = optional(string, "") })) }) |
{ "trust_role": null, "use_oidc_integration": true } |
no |
| match_aws_regions | 더 이상 사용되지 않는 레거시 입력입니다. 대신 aws_matchers를 사용하세요. 검색할 AWS 리전. 기본값은 모든 AWS 리전과 일치합니다. | list(string) |
[ "*" ] |
no |
| match_aws_resource_types | 더 이상 사용되지 않는 레거시 입력입니다. 대신 aws_matchers를 사용하세요. Teleport로 리소스를 검색할 때 일치시킬 AWS 리소스 타입. | list(string) |
[] |
no |
| match_aws_tags | 더 이상 사용되지 않는 레거시 입력입니다. 대신 aws_matchers를 사용하세요. Teleport로 리소스를 검색할 때 일치시킬 AWS 리소스 태그. 기본값은 검색된 모든 AWS 리소스와 일치합니다. | map(list(string)) |
{ "*": [ "*" ] } |
no |
| teleport_discovery_config_name | teleport_discovery_config 리소스의 이름. |
string |
"discovery" |
no |
| teleport_discovery_config_use_name_prefix | Teleport discovery config 이름(teleport_discovery_config_name)을 접두사로 사용할지 여부를 결정합니다. |
bool |
true |
no |
| teleport_discovery_group_name | 사용할 Teleport discovery 그룹. discovery 구성이 적용되려면 이 이름이 하나 이상의 Teleport Discovery Service 인스턴스에 구성된 discovery_group과 일치해야 합니다. Teleport Cloud 클러스터의 경우 "cloud-discovery-group"을 사용하세요. |
string |
n/a | yes |
| teleport_integration_name | teleport_integration 리소스의 이름. |
string |
"discovery" |
no |
| teleport_integration_use_name_prefix | Teleport integration 이름(teleport_integration_name)을 접두사로 사용할지 여부를 결정합니다. |
bool |
true |
no |
| teleport_provision_token_name | teleport_provision_token 리소스의 이름. |
string |
"discovery" |
no |
| teleport_provision_token_use_name_prefix | Teleport provision token 이름(teleport_provision_token_name)을 접두사로 사용할지 여부를 결정합니다. |
bool |
true |
no |
| teleport_proxy_public_addr | Teleport 클러스터 프록시 공개 주소 host:port. |
string |
n/a | yes |
Outputs#
| Name | Description |
|---|---|
| aws_oidc_provider_arn | Teleport Discovery Service가 OIDC를 사용하여 AWS IAM 역할을 어슘할 수 있도록 하는 AWS OIDC(OpenID Connect) 공급자의 AWS 리소스 이름(ARN). |
| teleport_discovery_config_name | Teleport 동적 discovery_config의 이름. 구성 세부 정보는 tctl get discovery_config/<name>으로 확인할 수 있습니다. Teleport Discovery Service 인스턴스는 discovery_config와 동일한 discovery 그룹에 속해 있으면 이 discovery_config를 사용합니다. |
| teleport_discovery_service_iam_policy_arn | Teleport가 AWS에서 리소스를 검색하는 데 필요한 권한을 부여하는 AWS IAM 정책의 AWS 리소스 이름(ARN). |
| teleport_discovery_service_iam_role_arn | Teleport Discovery Service가 어슘할 AWS IAM 역할의 AWS 리소스 이름(ARN). |
| teleport_integration_name | Teleport integration 리소스의 이름. 이 integration 리소스는 Teleport Discovery Service 인스턴스가 AWS OIDC 페더레이션을 사용하여 검색용 AWS IAM 역할을 어슘하도록 구성합니다. Integration 세부 정보는 tctl get integrations/<name> 명령이나 Teleport 웹 UI의 'Zero Trust Access' > 'Integrations'에서 확인할 수 있습니다. |
| teleport_provision_token_name | Teleport 노드가 AWS IAM 자격 증명을 사용하여 Teleport 클러스터에 조인할 수 있도록 하는 Teleport provision token의 이름. 토큰 세부 정보는 tctl get token/<name>으로 확인할 수 있습니다. |