Skip to content

Commit

Permalink
Add tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ivours committed Jul 19, 2024
1 parent 951674a commit 3cecd95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ resource "aws_key_pair" "this" {
}

resource "aws_eip" "this" {
vpc = true
tags = {
Name = "${var.environment}-openvpn"
}
vpc = true
tags = merge(var.tags, { Name = "${var.environment}-openvpn" })
}

resource "aws_autoscaling_group" "this" {
Expand Down Expand Up @@ -52,6 +50,7 @@ resource "aws_security_group" "this" {
name = "${var.environment}-openvpn"
description = "OpenVPN"
vpc_id = var.vpc_id
tags = merge(var.tags, { Name = "${var.environment}-openvpn" })
}

resource "aws_security_group_rule" "ingress_openvpn" {
Expand Down Expand Up @@ -93,17 +92,20 @@ resource "aws_ssm_parameter" "public_key" {
name = "${var.environment}-openvpn-public-ssh-key"
type = "SecureString"
value = base64encode(tls_private_key.this.public_key_openssh)
tags = var.tags
}

resource "aws_ssm_parameter" "private_key" {
name = "${var.environment}-openvpn-private-ssh-key"
type = "SecureString"
tier = "Advanced"
value = base64encode(tls_private_key.this.private_key_pem)
tags = var.tags
}

resource "aws_s3_bucket" "this" {
bucket = "${var.environment}-${var.project}-openvpn"
tags = var.tags
}

resource "aws_s3_bucket_acl" "this" {
Expand Down Expand Up @@ -145,6 +147,8 @@ resource "aws_iam_role" "this" {
]
}
POLICY

tags = var.tags
}

resource "aws_iam_role_policy" "this" {
Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ variable "instance_type" {}
variable "peered_networks" {}
variable "docker_cidr" { description = "IP docker"}
variable "compose_cidr" { description = "IP docker-compose"}
variable "tags" {}

0 comments on commit 3cecd95

Please sign in to comment.