diff --git a/docs/resources/confluent_access_point.md b/docs/resources/confluent_access_point.md index fa540c894..ecbf2765d 100644 --- a/docs/resources/confluent_access_point.md +++ b/docs/resources/confluent_access_point.md @@ -152,5 +152,10 @@ $ terraform import confluent_access_point.main env-abc123/ap-abc123 ## Getting Started The following end-to-end examples might help to get started with `confluent_access_point` resource: + * [egress-aws-private-link](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/egress-aws-private-link): AWS Egress Private Link Gateway and Access Point + * [egress-azure-private-link](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/egress-azure-private-link): Azure Egress Private Link Gateway and Access Point + * [ingress-aws-private-link](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/ingress-aws-private-link): AWS Ingress Private Link Gateway and Access Point + * [egress-gcp-private-service-connect](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/egress-gcp-private-service-connect): GCP Egress Private Service Connect Gateway and Access Point + * [pni-aws](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/pni-aws): AWS Private Network Interface Gateway and Access Point * [enterprise-pni-aws-kafka-rbac](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/enterprise-pni-aws-kafka-rbac): _Enterprise_ Kafka cluster on AWS that is accessible via Confluent Private Network Interface (PNI) with authorization using RBAC * [freight-aws-kafka-rbac](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/freight-pni-aws-kafka-rbac): _Freight_ Kafka cluster on AWS that is accessible via Confluent Private Network Interface (PNI) with authorization using RBAC diff --git a/docs/resources/confluent_gateway.md b/docs/resources/confluent_gateway.md index 0f6772bdc..3df5c927d 100644 --- a/docs/resources/confluent_gateway.md +++ b/docs/resources/confluent_gateway.md @@ -77,5 +77,10 @@ $ terraform import confluent_gateway.main env-abc123/gw-abc123 ## Getting Started The following end-to-end examples might help to get started with `confluent_gateway` resource: + * [egress-aws-private-link](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/egress-aws-private-link): AWS Egress Private Link Gateway and Access Point + * [egress-azure-private-link](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/egress-azure-private-link): Azure Egress Private Link Gateway and Access Point + * [ingress-aws-private-link](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/ingress-aws-private-link): AWS Ingress Private Link Gateway and Access Point + * [egress-gcp-private-service-connect](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/egress-gcp-private-service-connect): GCP Egress Private Service Connect Gateway and Access Point + * [pni-aws](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/networking/pni-aws): AWS Private Network Interface Gateway and Access Point * [enterprise-pni-aws-kafka-rbac](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/enterprise-pni-aws-kafka-rbac): _Enterprise_ Kafka cluster on AWS that is accessible via Confluent Private Network Interface (PNI) with authorization using RBAC * [freight-aws-kafka-rbac](https://github.com/confluentinc/terraform-provider-confluent/tree/master/examples/configurations/freight-pni-aws-kafka-rbac): _Freight_ Kafka cluster on AWS that is accessible via Confluent Private Network Interface (PNI) with authorization using RBAC diff --git a/examples/configurations/networking/egress-aws-private-link/main.tf b/examples/configurations/networking/egress-aws-private-link/main.tf new file mode 100644 index 000000000..28fe16ced --- /dev/null +++ b/examples/configurations/networking/egress-aws-private-link/main.tf @@ -0,0 +1,48 @@ +terraform { + required_providers { + confluent = { + source = "confluentinc/confluent" + version = "2.62.0" + } + } +} + +provider "confluent" { + cloud_api_key = var.confluent_cloud_api_key + cloud_api_secret = var.confluent_cloud_api_secret +} + +resource "confluent_environment" "staging" { + display_name = "Staging" + + stream_governance { + package = "ESSENTIALS" + } +} + +resource "confluent_gateway" "main" { + display_name = "aws-egress-private-link-gateway" + environment { + id = confluent_environment.staging.id + } + aws_egress_private_link_gateway { + region = var.region + } +} + +resource "confluent_access_point" "main" { + display_name = "aws-egress-private-link-access-point" + environment { + id = confluent_environment.staging.id + } + gateway { + id = confluent_gateway.main.id + } + aws_egress_private_link_endpoint { + vpc_endpoint_service_name = var.vpc_endpoint_service_name + enable_high_availability = var.enable_high_availability + } + depends_on = [ + confluent_gateway.main + ] +} diff --git a/examples/configurations/networking/egress-aws-private-link/outputs.tf b/examples/configurations/networking/egress-aws-private-link/outputs.tf new file mode 100644 index 000000000..f3f7f1db8 --- /dev/null +++ b/examples/configurations/networking/egress-aws-private-link/outputs.tf @@ -0,0 +1,9 @@ +output "gateway" { + description = "The AWS Egress Private Link Gateway" + value = confluent_gateway.main +} + +output "access_point" { + description = "The AWS Egress Private Link Access Point" + value = confluent_access_point.main +} diff --git a/examples/configurations/networking/egress-aws-private-link/variables.tf b/examples/configurations/networking/egress-aws-private-link/variables.tf new file mode 100644 index 000000000..cbba9d711 --- /dev/null +++ b/examples/configurations/networking/egress-aws-private-link/variables.tf @@ -0,0 +1,26 @@ +variable "confluent_cloud_api_key" { + description = "Confluent Cloud API Key (also referred as Cloud API ID)" + type = string +} + +variable "confluent_cloud_api_secret" { + description = "Confluent Cloud API Secret" + type = string + sensitive = true +} + +variable "region" { + description = "The AWS region of the Gateway, for example, us-east-1" + type = string +} + +variable "vpc_endpoint_service_name" { + description = "AWS VPC Endpoint Service Name, for example, com.amazonaws.vpce.us-west-2.vpce-svc-0d3be37e21708ecd3" + type = string +} + +variable "enable_high_availability" { + description = "Whether the Access Point should be provisioned with high availability" + type = bool + default = false +} diff --git a/examples/configurations/networking/egress-azure-private-link/main.tf b/examples/configurations/networking/egress-azure-private-link/main.tf new file mode 100644 index 000000000..e21bfe350 --- /dev/null +++ b/examples/configurations/networking/egress-azure-private-link/main.tf @@ -0,0 +1,48 @@ +terraform { + required_providers { + confluent = { + source = "confluentinc/confluent" + version = "2.62.0" + } + } +} + +provider "confluent" { + cloud_api_key = var.confluent_cloud_api_key + cloud_api_secret = var.confluent_cloud_api_secret +} + +resource "confluent_environment" "staging" { + display_name = "Staging" + + stream_governance { + package = "ESSENTIALS" + } +} + +resource "confluent_gateway" "main" { + display_name = "azure-egress-private-link-gateway" + environment { + id = confluent_environment.staging.id + } + azure_egress_private_link_gateway { + region = var.region + } +} + +resource "confluent_access_point" "main" { + display_name = "azure-egress-private-link-access-point" + environment { + id = confluent_environment.staging.id + } + gateway { + id = confluent_gateway.main.id + } + azure_egress_private_link_endpoint { + private_link_service_resource_id = var.private_link_service_resource_id + private_link_subresource_name = var.private_link_subresource_name + } + depends_on = [ + confluent_gateway.main + ] +} diff --git a/examples/configurations/networking/egress-azure-private-link/outputs.tf b/examples/configurations/networking/egress-azure-private-link/outputs.tf new file mode 100644 index 000000000..7da4dad64 --- /dev/null +++ b/examples/configurations/networking/egress-azure-private-link/outputs.tf @@ -0,0 +1,9 @@ +output "gateway" { + description = "The Azure Egress Private Link Gateway" + value = confluent_gateway.main +} + +output "access_point" { + description = "The Azure Egress Private Link Access Point" + value = confluent_access_point.main +} diff --git a/examples/configurations/networking/egress-azure-private-link/variables.tf b/examples/configurations/networking/egress-azure-private-link/variables.tf new file mode 100644 index 000000000..0b73f1ede --- /dev/null +++ b/examples/configurations/networking/egress-azure-private-link/variables.tf @@ -0,0 +1,26 @@ +variable "confluent_cloud_api_key" { + description = "Confluent Cloud API Key (also referred as Cloud API ID)" + type = string +} + +variable "confluent_cloud_api_secret" { + description = "Confluent Cloud API Secret" + type = string + sensitive = true +} + +variable "region" { + description = "The Azure region of the Gateway, for example, eastus" + type = string +} + +variable "private_link_service_resource_id" { + description = "Resource ID of the Azure Private Link service" + type = string +} + +variable "private_link_subresource_name" { + description = "Name of the subresource for the Private Endpoint to connect to" + type = string + default = "" +} diff --git a/examples/configurations/network-access-point-gcp-private-service-connect/main.tf b/examples/configurations/networking/egress-gcp-private-service-connect/main.tf similarity index 97% rename from examples/configurations/network-access-point-gcp-private-service-connect/main.tf rename to examples/configurations/networking/egress-gcp-private-service-connect/main.tf index e11b59431..962f8943d 100644 --- a/examples/configurations/network-access-point-gcp-private-service-connect/main.tf +++ b/examples/configurations/networking/egress-gcp-private-service-connect/main.tf @@ -62,6 +62,6 @@ resource "confluent_access_point" "private-service-connect" { } depends_on = [ confluent_network.gcp-private-service-connect, - data.confluent_gateway + data.confluent_gateway.main ] } diff --git a/examples/configurations/networking/egress-gcp-private-service-connect/outputs.tf b/examples/configurations/networking/egress-gcp-private-service-connect/outputs.tf new file mode 100644 index 000000000..1cef372d2 --- /dev/null +++ b/examples/configurations/networking/egress-gcp-private-service-connect/outputs.tf @@ -0,0 +1,4 @@ +output "access_point" { + description = "The GCP Egress Private Service Connect Access Point" + value = confluent_access_point.private-service-connect +} diff --git a/examples/configurations/network-access-point-gcp-private-service-connect/variables.tf b/examples/configurations/networking/egress-gcp-private-service-connect/variables.tf similarity index 100% rename from examples/configurations/network-access-point-gcp-private-service-connect/variables.tf rename to examples/configurations/networking/egress-gcp-private-service-connect/variables.tf diff --git a/examples/configurations/networking/ingress-aws-private-link/main.tf b/examples/configurations/networking/ingress-aws-private-link/main.tf new file mode 100644 index 000000000..eb6c7c109 --- /dev/null +++ b/examples/configurations/networking/ingress-aws-private-link/main.tf @@ -0,0 +1,47 @@ +terraform { + required_providers { + confluent = { + source = "confluentinc/confluent" + version = "2.62.0" + } + } +} + +provider "confluent" { + cloud_api_key = var.confluent_cloud_api_key + cloud_api_secret = var.confluent_cloud_api_secret +} + +resource "confluent_environment" "staging" { + display_name = "Staging" + + stream_governance { + package = "ESSENTIALS" + } +} + +resource "confluent_gateway" "main" { + display_name = "aws-ingress-private-link-gateway" + environment { + id = confluent_environment.staging.id + } + aws_ingress_private_link_gateway { + region = var.region + } +} + +resource "confluent_access_point" "main" { + display_name = "aws-ingress-private-link-access-point" + environment { + id = confluent_environment.staging.id + } + gateway { + id = confluent_gateway.main.id + } + aws_ingress_private_link_endpoint { + vpc_endpoint_id = var.vpc_endpoint_id + } + depends_on = [ + confluent_gateway.main + ] +} diff --git a/examples/configurations/networking/ingress-aws-private-link/outputs.tf b/examples/configurations/networking/ingress-aws-private-link/outputs.tf new file mode 100644 index 000000000..d1d588fcb --- /dev/null +++ b/examples/configurations/networking/ingress-aws-private-link/outputs.tf @@ -0,0 +1,9 @@ +output "gateway" { + description = "The AWS Ingress Private Link Gateway" + value = confluent_gateway.main +} + +output "access_point" { + description = "The AWS Ingress Private Link Access Point" + value = confluent_access_point.main +} diff --git a/examples/configurations/networking/ingress-aws-private-link/variables.tf b/examples/configurations/networking/ingress-aws-private-link/variables.tf new file mode 100644 index 000000000..658ff81b3 --- /dev/null +++ b/examples/configurations/networking/ingress-aws-private-link/variables.tf @@ -0,0 +1,20 @@ +variable "confluent_cloud_api_key" { + description = "Confluent Cloud API Key (also referred as Cloud API ID)" + type = string +} + +variable "confluent_cloud_api_secret" { + description = "Confluent Cloud API Secret" + type = string + sensitive = true +} + +variable "region" { + description = "The AWS region of the Ingress Private Link Gateway, for example, us-east-1" + type = string +} + +variable "vpc_endpoint_id" { + description = "ID of a VPC Endpoint that will be connected to the VPC Endpoint service, for example, vpce-00000000000000000" + type = string +} \ No newline at end of file diff --git a/examples/configurations/networking/pni-aws/main.tf b/examples/configurations/networking/pni-aws/main.tf new file mode 100644 index 000000000..fd5c71ae8 --- /dev/null +++ b/examples/configurations/networking/pni-aws/main.tf @@ -0,0 +1,49 @@ +terraform { + required_providers { + confluent = { + source = "confluentinc/confluent" + version = "2.62.0" + } + } +} + +provider "confluent" { + cloud_api_key = var.confluent_cloud_api_key + cloud_api_secret = var.confluent_cloud_api_secret +} + +resource "confluent_environment" "staging" { + display_name = "Staging" + + stream_governance { + package = "ESSENTIALS" + } +} + +resource "confluent_gateway" "main" { + display_name = "aws-private-network-interface-gateway" + environment { + id = confluent_environment.staging.id + } + aws_private_network_interface_gateway { + region = var.region + zones = var.availability_zone_ids + } +} + +resource "confluent_access_point" "main" { + display_name = "aws-private-network-interface-access-point" + environment { + id = confluent_environment.staging.id + } + gateway { + id = confluent_gateway.main.id + } + aws_private_network_interface { + network_interfaces = var.network_interface_ids + account = var.aws_account_id + } + depends_on = [ + confluent_gateway.main + ] +} diff --git a/examples/configurations/networking/pni-aws/outputs.tf b/examples/configurations/networking/pni-aws/outputs.tf new file mode 100644 index 000000000..074097696 --- /dev/null +++ b/examples/configurations/networking/pni-aws/outputs.tf @@ -0,0 +1,9 @@ +output "gateway" { + description = "The AWS Private Network Interface Gateway" + value = confluent_gateway.main +} + +output "access_point" { + description = "The AWS Private Network Interface Access Point" + value = confluent_access_point.main +} diff --git a/examples/configurations/networking/pni-aws/variables.tf b/examples/configurations/networking/pni-aws/variables.tf new file mode 100644 index 000000000..122172e42 --- /dev/null +++ b/examples/configurations/networking/pni-aws/variables.tf @@ -0,0 +1,30 @@ +variable "confluent_cloud_api_key" { + description = "Confluent Cloud API Key (also referred as Cloud API ID)" + type = string +} + +variable "confluent_cloud_api_secret" { + description = "Confluent Cloud API Secret" + type = string + sensitive = true +} + +variable "region" { + description = "The AWS region of the Private Network Interface Gateway, for example, us-east-1" + type = string +} + +variable "availability_zone_ids" { + description = "The AWS availability zone IDs for the Private Network Interface Gateway, for example, [\"use1-az1\", \"use1-az2\", \"use1-az4\"]" + type = list(string) +} + +variable "network_interface_ids" { + description = "List of the IDs of the Elastic Network Interfaces" + type = list(string) +} + +variable "aws_account_id" { + description = "The AWS account ID associated with the ENIs, for example, 000000000000" + type = string +}