Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Adds examples and docs for mongodbatlas_stream_privatelink_endpoint resource and data sources #2923

Merged
merged 16 commits into from
Dec 23, 2024
Merged
103 changes: 103 additions & 0 deletions docs/data-sources/stream_privatelink_endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Data Source: mongodbatlas_stream_privatelink_endpoint

`mongodbatlas_stream_privatelink_endpoint` describes a Privatelink Endpoint for Streams.

## Example Usages
```terraform
resource "confluent_environment" "staging" {
display_name = "Staging"
}

resource "confluent_network" "private_link" {
display_name = "terraform-test-private-link-network-manual"
cloud = "AWS"
region = var.aws_region
connection_types = ["PRIVATELINK"]
zones = keys(var.subnets_to_privatelink)
environment {
id = confluent_environment.staging.id
}
dns_config {
resolution = "PRIVATE"
}
}

resource "confluent_private_link_access" "aws" {
display_name = "example-private-link-access"
aws {
account = var.aws_account_id
}
environment {
id = confluent_environment.staging.id
}
network {
id = confluent_network.private_link.id
}
}

resource "confluent_kafka_cluster" "dedicated" {
display_name = "example-dedicated-cluster"
availability = "MULTI_ZONE"
cloud = confluent_network.private_link.cloud
region = confluent_network.private_link.region
dedicated {
cku = 2
}
environment {
id = confluent_environment.staging.id
}
network {
id = confluent_network.private_link.id
}
}

resource "mongodbatlas_stream_privatelink_endpoint" "test" {
project_id = var.project_id
dns_domain = confluent_network.private_link.dns_domain
provider_name = "AWS"
region = var.aws_region
vendor = "CONFLUENT"
service_endpoint_id = confluent_network.private_link.aws[0].private_link_endpoint_service
dns_sub_domain = confluent_network.private_link.zonal_subdomains
}

data "mongodbatlas_stream_privatelink_endpoint" "singular_datasource" {
project_id = var.project_id
id = mongodbatlas_stream_privatelink_endpoint.test.id
}

data "mongodbatlas_stream_privatelink_endpoints" "plural_datasource" {
project_id = var.project_id
}

output "interface_endpoint_id" {
value = data.mongodbatlas_stream_privatelink_endpoint.singular_datasource.interface_endpoint_id
}

output "interface_endpoint_ids" {
value = data.mongodbatlas_stream_privatelink_endpoints.plural_datasource.results[*].interface_endpoint_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The ID of the Private Link connection.
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group or project id remains the same. The resource and corresponding endpoints use the term groups.

### Read-Only

- `dns_domain` (String) Domain name of Privatelink connected cluster.
- `dns_sub_domain` (List of String) Sub-Domain name of Confluent cluster. These are typically your availability zones.
- `interface_endpoint_id` (String) Interface endpoint ID that is created from the specified service endpoint ID.
- `provider_name` (String) Provider where the Kafka cluster is deployed.
- `region` (String) Domain name of Confluent cluster.
- `service_endpoint_id` (String) Service Endpoint ID.
- `state` (String) Status of the connection.
- `vendor` (String) Vendor who manages the Kafka cluster.

For more information see: [MongoDB Atlas API - Streams Privatelink](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createPrivateLinkConnection) Documentation.
113 changes: 113 additions & 0 deletions docs/data-sources/stream_privatelink_endpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Data Source: mongodbatlas_stream_privatelink_endpoints

`mongodbatlas_stream_privatelink_endpoints` describes a Privatelink Endpoint for Streams.

## Example Usages
```terraform
resource "confluent_environment" "staging" {
display_name = "Staging"
}

resource "confluent_network" "private_link" {
display_name = "terraform-test-private-link-network-manual"
cloud = "AWS"
region = var.aws_region
connection_types = ["PRIVATELINK"]
zones = keys(var.subnets_to_privatelink)
environment {
id = confluent_environment.staging.id
}
dns_config {
resolution = "PRIVATE"
}
}

resource "confluent_private_link_access" "aws" {
display_name = "example-private-link-access"
aws {
account = var.aws_account_id
}
environment {
id = confluent_environment.staging.id
}
network {
id = confluent_network.private_link.id
}
}

resource "confluent_kafka_cluster" "dedicated" {
display_name = "example-dedicated-cluster"
availability = "MULTI_ZONE"
cloud = confluent_network.private_link.cloud
region = confluent_network.private_link.region
dedicated {
cku = 2
}
environment {
id = confluent_environment.staging.id
}
network {
id = confluent_network.private_link.id
}
}

resource "mongodbatlas_stream_privatelink_endpoint" "test" {
project_id = var.project_id
dns_domain = confluent_network.private_link.dns_domain
provider_name = "AWS"
region = var.aws_region
vendor = "CONFLUENT"
service_endpoint_id = confluent_network.private_link.aws[0].private_link_endpoint_service
dns_sub_domain = confluent_network.private_link.zonal_subdomains
}

data "mongodbatlas_stream_privatelink_endpoint" "singular_datasource" {
project_id = var.project_id
id = mongodbatlas_stream_privatelink_endpoint.test.id
}

data "mongodbatlas_stream_privatelink_endpoints" "plural_datasource" {
project_id = var.project_id
}

output "interface_endpoint_id" {
value = data.mongodbatlas_stream_privatelink_endpoint.singular_datasource.interface_endpoint_id
}

output "interface_endpoint_ids" {
value = data.mongodbatlas_stream_privatelink_endpoints.plural_datasource.results[*].interface_endpoint_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group or project id remains the same. The resource and corresponding endpoints use the term groups.

### Read-Only

- `results` (Attributes List) List of documents that MongoDB Cloud returns for this request. (see [below for nested schema](#nestedatt--results))

<a id="nestedatt--results"></a>
### Nested Schema for `results`

Read-Only:

- `dns_domain` (String) Domain name of Privatelink connected cluster.
- `dns_sub_domain` (List of String) Sub-Domain name of Confluent cluster. These are typically your availability zones.
- `id` (String) The ID of the Private Link connection.
- `interface_endpoint_id` (String) Interface endpoint ID that is created from the specified service endpoint ID.
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group or project id remains the same. The resource and corresponding endpoints use the term groups.
- `provider_name` (String) Provider where the Kafka cluster is deployed.
- `region` (String) Domain name of Confluent cluster.
- `service_endpoint_id` (String) Service Endpoint ID.
- `state` (String) Status of the connection.
- `vendor` (String) Vendor who manages the Kafka cluster.

For more information see: [MongoDB Atlas API - Streams Privatelink](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createPrivateLinkConnection) Documentation.
106 changes: 106 additions & 0 deletions docs/resources/stream_privatelink_endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Resource: mongodbatlas_stream_privatelink_endpoint

`mongodbatlas_stream_privatelink_endpoint` describes a Privatelink Endpoint for Streams.

## Example Usages
```terraform
resource "confluent_environment" "staging" {
display_name = "Staging"
}

resource "confluent_network" "private_link" {
display_name = "terraform-test-private-link-network-manual"
cloud = "AWS"
region = var.aws_region
connection_types = ["PRIVATELINK"]
zones = keys(var.subnets_to_privatelink)
environment {
id = confluent_environment.staging.id
}
dns_config {
resolution = "PRIVATE"
}
}

resource "confluent_private_link_access" "aws" {
display_name = "example-private-link-access"
aws {
account = var.aws_account_id
}
environment {
id = confluent_environment.staging.id
}
network {
id = confluent_network.private_link.id
}
}

resource "confluent_kafka_cluster" "dedicated" {
display_name = "example-dedicated-cluster"
availability = "MULTI_ZONE"
cloud = confluent_network.private_link.cloud
region = confluent_network.private_link.region
dedicated {
cku = 2
}
environment {
id = confluent_environment.staging.id
}
network {
id = confluent_network.private_link.id
}
}

resource "mongodbatlas_stream_privatelink_endpoint" "test" {
project_id = var.project_id
dns_domain = confluent_network.private_link.dns_domain
provider_name = "AWS"
region = var.aws_region
vendor = "CONFLUENT"
service_endpoint_id = confluent_network.private_link.aws[0].private_link_endpoint_service
dns_sub_domain = confluent_network.private_link.zonal_subdomains
}

data "mongodbatlas_stream_privatelink_endpoint" "singular_datasource" {
project_id = var.project_id
id = mongodbatlas_stream_privatelink_endpoint.test.id
}

data "mongodbatlas_stream_privatelink_endpoints" "plural_datasource" {
project_id = var.project_id
}

output "interface_endpoint_id" {
value = data.mongodbatlas_stream_privatelink_endpoint.singular_datasource.interface_endpoint_id
}

output "interface_endpoint_ids" {
value = data.mongodbatlas_stream_privatelink_endpoints.plural_datasource.results[*].interface_endpoint_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group or project id remains the same. The resource and corresponding endpoints use the term groups.
- `provider_name` (String) Provider where the Kafka cluster is deployed.
- `vendor` (String) Vendor who manages the Kafka cluster.

### Optional

- `dns_domain` (String) Domain name of Privatelink connected cluster.
- `dns_sub_domain` (List of String) Sub-Domain name of Confluent cluster. These are typically your availability zones.
- `region` (String) Domain name of Confluent cluster.
- `service_endpoint_id` (String) Service Endpoint ID.

### Read-Only

- `id` (String) The ID of the Private Link connection.
- `interface_endpoint_id` (String) Interface endpoint ID that is created from the specified service endpoint ID.
- `state` (String) Status of the connection.

For more information see: [MongoDB Atlas API - Streams Privatelink](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createPrivateLinkConnection) Documentation.
EspenAlbert marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# MongoDB Atlas Provider - AWS Confluent Privatelink for Atlas Streams

This example shows how to use AWS Confluent Privatelink for Atlas Streams with a dedicated Confluent Cluster.

You must set the following variables:

- `public_key`: Public API key to authenticate to Atlas
- `private_key`: Private API key to authenticate to Atlas
- `project_id`: Unique 24-hexadecimal digit string that identifies your project
- `confluent_cloud_api_key`: Public API key to authenticate to Confluent Cloud
- `confluent_cloud_api_secret`: Private API key to authenticate to Confleunt Cloud
- `subnets_to_privatelink`: A map of Zone ID to Subnet ID (i.e.: {\"use1-az1\" = \"subnet-abcdef0123456789a\", ...})
- `aws_account_id`: The AWS Account ID (12 digits)
- `aws_region`: The AWS Region
Loading
Loading