update AWS privatelink example with the new component type
@@ -7,6 +7,20 @@ resource "aiven_kafka" "kafka-service" {
maintenance_window_dow = "monday"
maintenance_window_time = "10:00:00"
project_vpc_id = "YOUR-AWS-PROJECT-VPC-ID"
+
+ kafka_user_config {
+ privatelink_access {
+ kafka = true
+ }
+
+ public_access {
+ kafka = true
+ }
+
+ kafka_authentication_methods {
+ certificate = true
+ }
+ }
}
# AWS Privatelink service
@@ -14,12 +28,8 @@ resource "aiven_aws_privatelink" "aws_pl" {
project = data.aiven_project.pr1.project
service_name = aiven_kafka.kafka-service.service_name
principals = [
- "arn:aws:iam::012345678901:role/my-privatelink-role"]
- kafka_user_config {
- privatelink_access {
- kafka = true
- }
- }
+ "arn:aws:iam::012345678901:role/my-privatelink-role",
+ ]
}
data "aiven_aws_privatelink" "pl" {
@@ -30,3 +40,16 @@ data "aiven_aws_privatelink" "pl" {
output "aws_privatelink" {
value = aiven_aws_privatelink.aws_pl
}
+
+// After connecting to a VPC Endpoint from your an AWS account new service component is available
+data "aiven_service_component" "kafka_privatelink" {
+ project = aiven_aws_privatelink.aws_pl.project
+ service_name = aiven_aws_privatelink.aws_pl.service_name
+ component = "kafka"
+ route = "privatelink"
+ kafka_authentication_method = "certificate"
+}
+
+output "kafka_privatelink_component" {
+ value = data.aiven_service_component.kafka_privatelink
+}
