mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
feat: adding custom routes for AWS
This commit is contained in:
committed by
Pierre Mavro
parent
3d3100d7e5
commit
b4402cf03b
@@ -87,6 +87,13 @@ resource "aws_route_table" "eks_cluster" {
|
||||
gateway_id = aws_internet_gateway.eks_cluster.id
|
||||
}
|
||||
|
||||
{% for route in vpc_custom_routing_table %}
|
||||
route {
|
||||
cidr_block = "{{ route.destination }}"
|
||||
gateway_id = "{{ route.target }}"
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
tags = local.tags_eks_vpc_public
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,14 @@ resource "aws_route_table" "eks_cluster" {
|
||||
gateway_id = aws_internet_gateway.eks_cluster.id
|
||||
}
|
||||
|
||||
// todo(pmavro): add tests for it when it will be available in the SDK
|
||||
{% for route in vpc_custom_routing_table %}
|
||||
route {
|
||||
cidr_block = "{{ route.destination }}"
|
||||
gateway_id = "{{ route.target }}"
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
tags = local.tags_eks_vpc
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,13 @@ pub enum VpcQoveryNetworkMode {
|
||||
WithoutNatGateways,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct VpcCustomRoutingTable {
|
||||
description: String,
|
||||
destination: String,
|
||||
target: String,
|
||||
}
|
||||
|
||||
impl fmt::Display for VpcQoveryNetworkMode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:?}", self)
|
||||
@@ -81,6 +88,7 @@ pub struct Options {
|
||||
pub vpc_qovery_network_mode: VpcQoveryNetworkMode,
|
||||
pub vpc_cidr_block: String,
|
||||
pub eks_cidr_subnet: String,
|
||||
pub vpc_custom_routing_table: Vec<VpcCustomRoutingTable>,
|
||||
pub eks_access_cidr_blocks: Vec<String>,
|
||||
pub rds_cidr_subnet: String,
|
||||
pub documentdb_cidr_subnet: String,
|
||||
@@ -416,6 +424,7 @@ impl<'a> EKS<'a> {
|
||||
context.insert("aws_terraform_backend_bucket", "qovery-terrafom-tfstates");
|
||||
context.insert("aws_terraform_backend_dynamodb_table", "qovery-terrafom-tfstates");
|
||||
context.insert("vpc_cidr_block", &vpc_cidr_block);
|
||||
context.insert("vpc_custom_routing_table", &self.options.vpc_custom_routing_table);
|
||||
context.insert("s3_kubeconfig_bucket", &self.kubeconfig_bucket_name());
|
||||
|
||||
// AWS - EKS
|
||||
|
||||
@@ -169,6 +169,7 @@ impl Cluster<AWS, Options> for AWS {
|
||||
vpc_qovery_network_mode: VpcQoveryNetworkMode::WithoutNatGateways,
|
||||
vpc_cidr_block: "10.0.0.0/16".to_string(),
|
||||
eks_cidr_subnet: "20".to_string(),
|
||||
vpc_custom_routing_table: vec![],
|
||||
eks_access_cidr_blocks: secrets
|
||||
.EKS_ACCESS_CIDR_BLOCKS
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user