diff --git a/infrastructure/applications/.terraform.lock.hcl b/infrastructure/applications/.terraform.lock.hcl index 7fadab67ea..80d4e8ee6d 100644 --- a/infrastructure/applications/.terraform.lock.hcl +++ b/infrastructure/applications/.terraform.lock.hcl @@ -2,44 +2,44 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/aws" { - version = "5.64.0" - constraints = "5.64.0" + version = "5.70.0" + constraints = "5.70.0" hashes = [ - "h1:Xasb457vfMG/1SGu6KSApCzAqUHMlsL028OQu3dZVv8=", - "zh:1d361f8062c68c9d5ac14b0aa8390709542129b8a9b258e61bbbabc706078b44", - "zh:39dcbf53e3896bdd77071384c8fad4a5862c222c73f3bcf356aca488101f22fd", - "zh:3fad63505f0c5b6f01cc9a6ef02b2226983b79424126a9caf6eb724f654299f4", - "zh:53a8b90d00829cc27e3171a13a8ff1404ee0ea018e73f31d3f916d246cc39613", - "zh:5734c25ef5a04b40f3c1ac5f817f11e42ee3328f74dbc141c0e64afbb0acc834", - "zh:66ea14dbd87f291ce4a877123363933d3ca4022f209f885807a6689c22c24e80", - "zh:68e79654ad0894a3d93134c3377748ace3058d5fad5ec09d1e9a8f8f9b8a47ea", - "zh:7b74259d0ceef0c49cea6bcd171df997b6bad141085bbadded15b440faeb0eee", - "zh:988ebfb5d115dc57070b5abf2e4200ad49cde535f27fd2ba5e34cf9ab336a57f", + "h1:LKnWZnujHcQPm3MAk4elP3H9VXNjlO6rNqlO5s330Yg=", + "zh:09cbec93c324e6f03a866244ecb2bae71fdf1f5d3d981e858b745c90606b6b6d", + "zh:19685d9f4c9ddcfa476a9a428c6c612be4a1b4e8e1198fbcbb76436b735284ee", + "zh:3358ee6a2b24c982b7c83fac0af6898644d1bbdabf9c4e0589e91e427641ba88", + "zh:34f9f2936de7384f8ed887abdbcb54aea1ce7b0cf2e85243a3fd3904d024747f", + "zh:4a99546cc2140304c90d9ccb9db01589d4145863605a0fcd90027a643ea3ec5d", + "zh:4da32fec0e10dab5aa3dea3c9fe57adc973cc73a71f5d59da3f65d85d925dc3f", + "zh:659cf94522bc38ce0af70f7b0371b2941a0e0bcad02d17c1a7b264575fe07224", + "zh:6f1c172c9b98bc86e4f0526872098ee3246c2620f7b323ce0c2ce6427987f7d2", + "zh:79bf8fb8f37c308742e287694a9de081ff8502b065a390d1bcfbd241b4eca203", "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:a0a2d4efe2835f0101a0a5024e044a3f28c00e10a8d87fce89c707ef6db75cea", - "zh:aecb3e4b9121771dee9cac7975bf5d0657b5f3e8b57788c455beaeb0f3c48d93", - "zh:d2d3393170b8ef761d3146f39f6788c4a3e876e6c5d4cedca4870c2680688ae6", - "zh:daba5a005c1baa4a5eefbfb86d43ccf880eb5b42e8136f0d932f55886d72bda0", - "zh:de16a6ff3baacdaf9609a0a89aa1913fc19cccaf5ee0fc1c49c5a075baa47c02", + "zh:b7a5e1dfd9e179d70a169ddd4db44b56da90309060e27d36b329fe5fb3528e29", + "zh:c2cc728cb18ffd5c4814a10c203452c71f5ab0c46d68f9aa9183183fa60afd87", + "zh:c89bb37d2b8947c9a0d62b0b86ace51542f3327970f4e56a68bf81d9d0b8b65b", + "zh:ef2a61e8112c3b5e70095508aadaadf077e904b62b9cfc22030337f773bba041", + "zh:f714550b858d141ea88579f25247bda2a5ba461337975e77daceaf0bb7a9c358", ] } provider "registry.terraform.io/hashicorp/external" { - version = "2.3.3" + version = "2.3.4" hashes = [ - "h1:H+3QlVPs/7CDa3I4KU/a23wYeGeJxeBlgvR7bfK1t1w=", - "zh:03d81462f9578ec91ce8e26f887e34151eda0e100f57e9772dbea86363588239", - "zh:37ec2a20f6a3ec3a0fd95d3f3de26da6cb9534b30488bc45723e118a0911c0d8", - "zh:4eb5b119179539f2749ce9de0e1b9629d025990f062f4f4dddc161562bb89d37", - "zh:5a31bb58414f41bee5e09b939012df5b88654120b0238a89dfd6691ba197619a", - "zh:6221a05e52a6a2d4f520ffe7cbc741f4f6080e0855061b0ed54e8be4a84eb9b7", + "h1:XWkRZOLKMjci9/JAtE8X8fWOt7A4u+9mgXSUjc4Wuyo=", + "zh:037fd82cd86227359bc010672cd174235e2d337601d4686f526d0f53c87447cb", + "zh:0ea1db63d6173d01f2fa8eb8989f0809a55135a0d8d424b08ba5dabad73095fa", + "zh:17a4d0a306566f2e45778fbac48744b6fd9c958aaa359e79f144c6358cb93af0", + "zh:298e5408ab17fd2e90d2cd6d406c6d02344fe610de5b7dae943a58b958e76691", + "zh:38ecfd29ee0785fd93164812dcbe0664ebbe5417473f3b2658087ca5a0286ecb", + "zh:59f6a6f31acf66f4ea3667a555a70eba5d406c6e6d93c2c641b81d63261eeace", "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8bb068496b4679bef625e4710d9f3432e301c3a56602271f04e60eadf7f8a94c", - "zh:94742aa5378bab626ce34f79bcef6a373e4f86ea7a8b762e9f71270a899e0d00", - "zh:a485831b5a525cd8f40e8982fa37da40ff70b1ae092c8b755fcde123f0b1238d", - "zh:a647ff16d071eabcabd87ea8183eb90a775a0294ddd735d742075d62fff09193", - "zh:b74710c5954aaa3faf262c18d36a8c2407862d9f842c63e7fa92fa4de3d29df6", - "zh:fa73d83edc92af2e551857594c2232ba6a9e3603ad34b0a5940865202c08d8d7", + "zh:ad0279dfd09d713db0c18469f585e58d04748ca72d9ada83883492e0dd13bd58", + "zh:c69f66fd21f5e2c8ecf7ca68d9091c40f19ad913aef21e3ce23836e91b8cbb5f", + "zh:d4a56f8c48aa86fc8e0c233d56850f5783f322d6336f3bf1916e293246b6b5d4", + "zh:f2b394ebd4af33f343835517e80fc876f79361f4688220833bc3c77655dd2202", + "zh:f31982f29f12834e5d21e010856eddd19d59cd8f449adf470655bfd19354377e", ] } diff --git a/infrastructure/applications/applications.tf b/infrastructure/applications/applications.tf index bc3b66554e..5fd88fdcb5 100644 --- a/infrastructure/applications/applications.tf +++ b/infrastructure/applications/applications.tf @@ -1,12 +1,10 @@ locals { is_prod = terraform.workspace == "production" deploy_pretix = local.is_prod - enable_proxy = local.is_prod ? false : false # AMI # Built from https://github.com/aws/amazon-ecs-ami # Using 8GB as storage. - ecs_x86_ami = "ami-04467750a630d1f7c" # make al2023 ecs_arm_ami = "ami-0bd650c1ca04cc1a4" # make al2023arm } @@ -15,14 +13,11 @@ locals { module "pretix" { source = "./pretix" count = local.deploy_pretix ? 1 : 0 - enable_proxy = local.enable_proxy - ecs_x86_ami = local.ecs_x86_ami ecs_arm_ami = local.ecs_arm_ami } module "pycon_backend" { source = "./pycon_backend" - enable_proxy = local.enable_proxy ecs_arm_ami = local.ecs_arm_ami providers = { @@ -35,7 +30,6 @@ module "pycon_backend" { module "database" { source = "./database" - enable_proxy = local.enable_proxy } module "emails" { diff --git a/infrastructure/applications/config.tf b/infrastructure/applications/config.tf index 4628880be0..f123e44746 100644 --- a/infrastructure/applications/config.tf +++ b/infrastructure/applications/config.tf @@ -2,7 +2,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "5.64.0" + version = "5.70.0" configuration_aliases = [aws.us] } } diff --git a/infrastructure/applications/database/db.tf b/infrastructure/applications/database/db.tf index afb5f5cad6..ed0a45ed0a 100644 --- a/infrastructure/applications/database/db.tf +++ b/infrastructure/applications/database/db.tf @@ -18,7 +18,7 @@ resource "aws_db_instance" "database" { identifier = "pythonit-${terraform.workspace}" allow_major_version_upgrade = true engine_version = "14.12" - instance_class = local.is_prod ? "db.t4g.micro" : "db.t4g.micro" + instance_class = "db.t4g.micro" db_name = "${local.normalized_workspace}backend" username = "root" password = module.common_secrets.value.database_password diff --git a/infrastructure/applications/database/proxy.tf b/infrastructure/applications/database/proxy.tf deleted file mode 100644 index ee005a7967..0000000000 --- a/infrastructure/applications/database/proxy.tf +++ /dev/null @@ -1,92 +0,0 @@ -data "aws_secretsmanager_secret" "credentials" { - count = var.enable_proxy ? 1 : 0 - name = "/pythonit/${terraform.workspace}/common/database" -} - -data "aws_vpc" "default" { - filter { - name = "tag:Name" - values = ["pythonit-vpc"] - } -} - -data "aws_subnets" "private" { - filter { - name = "vpc-id" - values = [data.aws_vpc.default.id] - } - - tags = { - Type = "private" - } -} - - -resource "aws_db_proxy" "proxy" { - count = var.enable_proxy ? 1 : 0 - name = "pythonit-${terraform.workspace}-database-proxy" - debug_logging = false - engine_family = "POSTGRESQL" - idle_client_timeout = 1800 - require_tls = false - role_arn = aws_iam_role.proxy_role[0].arn - vpc_security_group_ids = [data.aws_security_group.rds.id] - vpc_subnet_ids = data.aws_subnets.private.ids - - auth { - auth_scheme = "SECRETS" - description = "auth" - iam_auth = "DISABLED" - secret_arn = data.aws_secretsmanager_secret.credentials[0].arn - } -} - -resource "aws_iam_role" "proxy_role" { - count = var.enable_proxy ? 1 : 0 - name = "pythonit-${terraform.workspace}-proxy-role" - assume_role_policy = <