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/project id remains the same. The resource and corresponding endpoints use the term groups.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved

### 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 service endpoint ID provided.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `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) State the connection is in.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `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/project id remains the same. The resource and corresponding endpoints use the term groups.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved

### 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 service endpoint ID provided.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `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/project id remains the same. The resource and corresponding endpoints use the term groups.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `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) State the connection is in.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `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

- `dns_domain` (String) Domain name of Privatelink connected cluster.
- `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/project id remains the same. The resource and corresponding endpoints use the term groups.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `provider_name` (String) Provider where the Kafka cluster is deployed.
- `region` (String) Domain name of Confluent cluster.
- `service_endpoint_id` (String) Service Endpoint ID.
- `vendor` (String) Vendor who manages the Kafka cluster.

### Optional

- `dns_sub_domain` (List of String) Sub-Domain name of Confluent cluster. These are typically your availability zones.

### Read-Only

- `id` (String) The ID of the Private Link connection.
- `interface_endpoint_id` (String) Interface endpoint ID that is created from the service endpoint ID provided.
oarbusi marked this conversation as resolved.
Show resolved Hide resolved
- `state` (String) State the connection is in.

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
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
resource "confluent_environment" "staging" {
display_name = "Staging"
}

resource "confluent_network" "private-link" {
EspenAlbert marked this conversation as resolved.
Show resolved Hide resolved
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
}
Loading
Loading