Skip to content
Open
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
6 changes: 3 additions & 3 deletions amplitude_api_gateway/providers.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
terraform {
cloud {
organization = "dydxprotocol"
organization = "dydxopsdao"

workspaces {
name = ["amplitude-api-gateway"]
Expand All @@ -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" {
Expand Down
4 changes: 2 additions & 2 deletions indexer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
}
}

Expand Down
4 changes: 0 additions & 4 deletions modules/metric_ingestor/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ locals {
user_data = <<EOH
#!/bin/bash

# Install ECS instance connect
yum update -y
yum install ec2-instance-connect -y

# Register this EC2 instance to the ECS cluster
echo ECS_CLUSTER=${aws_ecs_cluster.main.name} >> /etc/ecs/ecs.config
EOH
Expand Down
9 changes: 9 additions & 0 deletions modules/metric_ingestor/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
13 changes: 5 additions & 8 deletions modules/metric_ingestor/security_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down