-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: Add module to migrate from public dns to private setting #325
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this first iteration, I think it's fine we make the customer input all data from their private network. We can improve it in the future and create all all of these things if the customer do not supply the network configuration.
Main changes here are:
- Ensure to use the dynamic configuration from main module to configure the ALB. Making it tied to a string concatenation is very fragile, so we need to ensure we're pointing to something that exists in the main module without worry about names.
- Do not use the private network from the main module in the examples. They are used by Kubernetes Cluster and we don't want to mix the subnets. Leave this decision for the customners.
@@ -0,0 +1,82 @@ | |||
# get alb arn from the output of data | |||
data "aws_lb" "alb" { | |||
name = "${var.namespace}-alb-k8s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the output from the main module or make this an env var.
Example: If this is part of the main module, we may want to use local.lb_name_truncated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, updated code
variable "private_hosted_zone_id" { | ||
description = "Private hosted zone id if migrating from public to private" | ||
type = string | ||
default = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I leave this an empty string, what is the result?
It should be mandatory, or a new private hosted zone will be created if empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes, made this params mandatory
examples/public-dns-external/main.tf
Outdated
vpc_id = module.wandb_infra.network_id | ||
subnet_ids = module.wandb_infra.network_private_subnets | ||
vpc_cidr_block = module.wandb_infra.network_cidr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These network configurations from the main module are used to configure the Kubernetes cluster.
The example shouldn't use it, but the network configuration from where the Customer will access the service.
If the customer wants to use the same network as the Kubernetes cluster, that's okay, but I don't recommend putting the Kubernetes and the VMs that will use the service in the same subnet.
We must let the customer decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, updated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add the same instructions you added to the PR to a README.md inside the module and in the example folder?
Feat: Adding a new module here so that users who have setup an AWS External DNS WandB stack can migrate it to a private stack (which is only accessible inside AWS network)
Assumptions/Pre-reqs:
New Module added -
migrate-public-to-private
. This module will create following resources and will not touch any of the current external stack resources, so this will be a plug and play solution that introduces no drift in current terraform.If users need to migrate to private they can just add this module. If they want to revert to original public setting, simply remove this module.
Below is a list of resources that will be created for private access:
New flow should look like this:

And the new sample tfvars with variables introduced:
Attaching output and screenshot

out.log