Skip to content
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

NIT-795 allow legacy rman in #3140

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion terraform/environments/delius-core/ec2_instance_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ resource "aws_vpc_security_group_egress_rule" "base_ami_test_instance_https_out"
)
}

resource "aws_vpc_security_group_ingress_rule" "db_ec2_instance_rman_in" {
security_group_id = aws_security_group.base_ami_test_instance_sg.id
cidr_ipv4 = local.environment_config_dev.legacy_engineering_vpc_cidr
from_port = 1521
to_port = 1521
ip_protocol = "tcp"
description = "Allow communication in on port 1521 from legacy rman"
tags = merge(local.tags,
{ Name = "legacy-rman-in" }
)
}

# Pre-req - IAM role, attachment for SSM usage and instance profile
data "aws_iam_policy_document" "base_ami_test_instance_iam_assume_policy" {
statement {
Expand Down Expand Up @@ -170,4 +182,3 @@ resource "aws_instance" "base_ami_test_instance" {
{ database = "delius-db-1" }
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ locals {

environment_config_dev = {
migration_environment_vpc_cidr = "10.161.20.0/22"
legacy_engineering_vpc_cidr = "10.161.98.0/25"
ec2_user_ssh_key = file("${path.module}/files/.ssh/${terraform.workspace}-dev/ec2-user.pub")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ resource "aws_vpc_security_group_egress_rule" "db_ec2_instance_https_out" {
)
}

resource "aws_vpc_security_group_ingress_rule" "db_ec2_instance_rman_in" {
security_group_id = aws_security_group.db_ec2_instance_sg.id
cidr_ipv4 = var.environment_config.legacy_engineering_vpc_cidr
from_port = 1521
to_port = 1521
ip_protocol = "tcp"
description = "Allow communication in on port 1521 from legacy rman"
tags = merge(local.tags,
{ Name = "legacy-rman-in" }
)
}

# Pre-reqs - IAM role, attachment for SSM usage and instance profile
data "aws_iam_policy_document" "db_ec2_instance_iam_assume_policy" {
statement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ variable "account_config" {

variable "environment_config" {
type = object({
migration_environment_vpc_cidr = optional(string),
migration_environment_vpc_cidr = optional(string)
legacy_engineering_vpc_cidr = string
ec2_user_ssh_key = string
})
}
Expand Down