Skip to content

mcolomerc/terraform-confluent-aws-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS & Confluent Cloud Networking Terraform module

Terraform module which creates VPC resources on AWS and Confluent Cloud networking resources.

AWS Resources

AWS VPC

Options:

  • Use an exisiting VPC, provide aws.vpc.id:
aws = {
  vpc = {
    id = "vpc-1234567890"
  }
}

Enable auto-assign public IPv4 address for Subnets. Module uses map-public-ip-on-launch for subnet selecting.

  • Create a new VPC, provide number_of_public_subnets and number_of_private_subnets:
aws = {
 vpc = {
      number_of_public_subnets = 3
      number_of_private_subnets = 3 
    }
}

Jump Host

Optional: jump host to access the private network.

  • EC2 Instance
    • Security Group
    • Key Pair

Provide instance name and type:

aws = {
 instance = {
      name = "mcolomer-central"
      type = "t2.micro" 
    }
}

Confluent Cloud Network

Options: TRANSITGATEWAY or PRIVATELINK or PEERING

confluent_network = {
    display_name = "confluent-plink-network"
    connection_type = "PRIVATELINK" 
}
  • Connection type: TRANSITGATEWAY

    • Confluent:
      • Transit Gateway network
      • Transit Gateway Attachment
    • AWS:
      • Transit Gateway
      • Transit Gateway Attachment
      • Transit Gateway Route
      • Resource Share (RAM)
  • Connection type: PRIVATELINK

    • Confluent:
      • Private Link Network
      • Private Link Access
    • AWS:
      • Endpoint
      • Service Group
      • Private Hosted Zone (Route53)
  • Connection type: PEERING

    • Confluent:
      • Peering Network
      • Peering Connection
    • AWS:
      • VPC Peering Connection
      • Peering Connection Accepter
      • Route Table
      • Route

## Usage

Tested Scenarios

  • New Confluent Cloud Private Link Network with AWS Provided VPC (vpc_id)
#AWS
aws = {
    region = "eu-central-1",
    prefix = "mcol",
    owner = "[email protected]",
    vpc = {
      id = "vpc-08a7122ab9509d860" 
    } 
    account_id = "492737776546"
}

# Confluent 
environment = "env-zmz2zd"

confluent_network = {
    display_name = "confluent-plink-network"
    connection_type = "PRIVATELINK" 
}
module "network" { 
  source   = "github.com/mcolomerc/terraform-confluent-aws-network" 
  environment = var.confluent.environment.id
  providers = {
    confluent.confluent_cloud = confluent 
    aws = aws
  }
  aws = {
    region = var.confluent.environment.network.aws.region,
    prefix = var.confluent.environment.network.aws.prefix,
    owner  = var.confluent.environment.network.aws.owner,
    vpc = {
      id = var.confluent.environment.network.aws.vpc.id,
    }
    account_id = var.confluent.environment.network.aws.account_id,
  }
  confluent_network = {
    display_name    = var.confluent.environment.network.display_name,
    connection_type = var.confluent.environment.network.connection_type,
  } 
}
  • New Confluent Cloud Private Link Network & New AWS VPC - TODO
  • New Confluent Cloud Private Link Network & New AWS VPC & New Jump Host - TODO
  • New Confluent Cloud Transit Gateway Network with AWS Provided VPC - TODO
  • New Confluent Cloud Transit Gateway Network & New AWS VPC & New Jump Host TODO
  • New Confluent Cloud Peering network with AWS Provided VPC and Jump Host TODO
  • New Confluent Cloud Peering network & New AWS VPC & New Jump Host TODO

Jump Host

mv <prefix>-key-pair.pem ~/.ssh/

cd ~/.ssh/

chmod 400 <prefix>-key-pair.pem

ssh -i "<prefix>-key-pair.pem" ubuntu@<outputs.bastion.public_dns>

Requirements

Name Version
terraform >= 1.3
aws 5.0.1
confluent >=1.51.0
tls ~> 4.0

Providers

No providers.

Modules

Name Source Version
aws_bastion ./modules/aws_bastion n/a
aws_vpc ./modules/aws_vpc n/a
plink ./modules/plink n/a

Resources

No resources.

Inputs

Name Description Type Default Required
aws AWS
object({
region = string
prefix = string
owner = string
vpc = object({
id = optional(string, null) # TODO: If not provided, create a new VPC
number_of_public_subnets = optional(number, 0)
number_of_private_subnets = optional(number, 0)
})
instance = optional(object({ # TODO: If provided, create a new EC2 Instance
name = string
type = string
}))
account_id = optional(string) # TODO: Required for Private Link
})
n/a yes
confluent_cloud_api_key Confluent Cloud API KEY. export TF_VAR_confluent_cloud_api_key="API_KEY" string n/a yes
confluent_cloud_api_secret Confluent Cloud API KEY. export TF_VAR_confluent_cloud_api_secret="API_SECRET" string n/a yes
confluent_network Confluent Network
object({
display_name = string
connection_type = string
cidr = optional(string)
zones = optional(list(string))
dns = optional(string)
})
n/a yes
environment Confluent Environment string "dev" no

Outputs

Name Description
aws_route53_records n/a
aws_route53_zone n/a
bastion n/a
confluent_private_link n/a
private_link_confluent_network Private LINK
private_subnets n/a
public_subnets n/a
vpc n/a

About

Manage Confluent AWS Networks with Terraform

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages