diff --git a/amplitude_api_gateway/providers.tf b/amplitude_api_gateway/providers.tf index 0c435fd5..04dd9bcd 100644 --- a/amplitude_api_gateway/providers.tf +++ b/amplitude_api_gateway/providers.tf @@ -1,6 +1,6 @@ terraform { cloud { - organization = "dydxprotocol" + organization = "dydxopsdao" workspaces { name = ["amplitude-api-gateway"] @@ -10,11 +10,11 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 3.0" + version = "~> 5.32" } } - required_version = "~> 1.3.2" + required_version = "~> 1.5" } provider "aws" { diff --git a/indexer/variables.tf b/indexer/variables.tf index 192754c4..b2dd8d6c 100644 --- a/indexer/variables.tf +++ b/indexer/variables.tf @@ -71,10 +71,10 @@ variable "bugsnag_release_stage" { validation { condition = contains( - ["development", "staging", "testnet"], + ["development", "staging", "testnet", "mainnet"], var.bugsnag_release_stage ) - error_message = "Err: invalid bugsnag release stage. Must be one of {development | staging | testnet}." + error_message = "Err: invalid bugsnag release stage. Must be one of {development | staging | testnet | mainnet}." } } diff --git a/modules/metric_ingestor/ec2.tf b/modules/metric_ingestor/ec2.tf index 1f92004f..74041bb5 100644 --- a/modules/metric_ingestor/ec2.tf +++ b/modules/metric_ingestor/ec2.tf @@ -10,10 +10,6 @@ locals { user_data = <> /etc/ecs/ecs.config EOH diff --git a/modules/metric_ingestor/iam.tf b/modules/metric_ingestor/iam.tf index 38522889..71edc11c 100644 --- a/modules/metric_ingestor/iam.tf +++ b/modules/metric_ingestor/iam.tf @@ -63,3 +63,12 @@ resource "aws_iam_role_policy_attachment" "ecs_list_tags" { role = aws_iam_role.ecs_instance_iam_role.name policy_arn = aws_iam_policy.ecs_list_tags_policy.arn } + +# ----------------------------------------------------------------------------- +# SSM policy for the ECS instance role to support secure management +# ----------------------------------------------------------------------------- + +resource "aws_iam_role_policy_attachment" "ssm_policy_attachment" { + role = aws_iam_role.ecs_instance_iam_role.name + policy_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" +} diff --git a/modules/metric_ingestor/security_group.tf b/modules/metric_ingestor/security_group.tf index 1effe71d..d3da63f6 100644 --- a/modules/metric_ingestor/security_group.tf +++ b/modules/metric_ingestor/security_group.tf @@ -3,15 +3,12 @@ resource "aws_security_group" "main" { name = "${var.environment}-${var.name}-sg" vpc_id = aws_vpc.main.id - # Allow port 22 for "ec2-instance-connect". - # This allows us to SSH into the hosts from the AWS Deveoper console. - # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html ingress { - protocol = "tcp" - from_port = 22 - to_port = 22 - cidr_blocks = ["0.0.0.0/0"] - ipv6_cidr_blocks = ["::/0"] + protocol = "-1" + from_port = 0 + to_port = 0 + cidr_blocks = [] + ipv6_cidr_blocks = [] } # For outgoing traffic, allow all.