mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 19:46:07 -04:00
cli: allow tagging cloud resources with custom tags (#3033)
This commit is contained in:
parent
f60c133724
commit
b187966581
27 changed files with 172 additions and 42 deletions
|
@ -68,7 +68,7 @@ resource "random_password" "init_secret" {
|
|||
|
||||
resource "aws_vpc" "vpc" {
|
||||
cidr_block = "192.168.0.0/16"
|
||||
tags = merge(local.tags, { Name = "${local.name}-vpc" })
|
||||
tags = merge(local.tags, var.additional_tags, { Name = "${local.name}-vpc" })
|
||||
}
|
||||
|
||||
module "public_private_subnet" {
|
||||
|
@ -79,7 +79,7 @@ module "public_private_subnet" {
|
|||
cidr_vpc_subnet_internet = "192.168.0.0/20"
|
||||
zone = var.zone
|
||||
zones = local.zones
|
||||
tags = local.tags
|
||||
tags = merge(local.tags, var.additional_tags)
|
||||
}
|
||||
|
||||
resource "aws_eip" "lb" {
|
||||
|
@ -89,14 +89,14 @@ resource "aws_eip" "lb" {
|
|||
# control-plane.
|
||||
for_each = var.internal_load_balancer ? [] : toset([var.zone])
|
||||
domain = "vpc"
|
||||
tags = merge(local.tags, { "constellation-ip-endpoint" = each.key == var.zone ? "legacy-primary-zone" : "additional-zone" })
|
||||
tags = merge(local.tags, var.additional_tags, { "constellation-ip-endpoint" = each.key == var.zone ? "legacy-primary-zone" : "additional-zone" })
|
||||
}
|
||||
|
||||
resource "aws_lb" "front_end" {
|
||||
name = "${local.name}-loadbalancer"
|
||||
internal = var.internal_load_balancer
|
||||
load_balancer_type = "network"
|
||||
tags = local.tags
|
||||
tags = merge(local.tags, var.additional_tags)
|
||||
security_groups = [aws_security_group.security_group.id]
|
||||
|
||||
dynamic "subnet_mapping" {
|
||||
|
@ -123,7 +123,7 @@ resource "aws_security_group" "security_group" {
|
|||
name = local.name
|
||||
vpc_id = aws_vpc.vpc.id
|
||||
description = "Security group for ${local.name}"
|
||||
tags = local.tags
|
||||
tags = merge(local.tags, var.additional_tags)
|
||||
|
||||
egress {
|
||||
from_port = 0
|
||||
|
@ -171,7 +171,7 @@ module "load_balancer_targets" {
|
|||
healthcheck_path = each.value.name == "kubernetes" ? "/readyz" : ""
|
||||
vpc_id = aws_vpc.vpc.id
|
||||
lb_arn = aws_lb.front_end.arn
|
||||
tags = local.tags
|
||||
tags = merge(local.tags, var.additional_tags)
|
||||
}
|
||||
|
||||
module "instance_group" {
|
||||
|
@ -194,6 +194,7 @@ module "instance_group" {
|
|||
enable_snp = var.enable_snp
|
||||
tags = merge(
|
||||
local.tags,
|
||||
var.additional_tags,
|
||||
{ Name = "${local.name}-${each.value.role}" },
|
||||
{ constellation-role = each.value.role },
|
||||
{ constellation-node-group = each.key },
|
||||
|
@ -212,4 +213,5 @@ module "jump_host" {
|
|||
ports = [for port in local.load_balancer_ports : port.port]
|
||||
security_groups = [aws_security_group.security_group.id]
|
||||
iam_instance_profile = var.iam_instance_profile_name_worker_nodes
|
||||
additional_tags = var.additional_tags
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue