diff --git a/packages/api/deployment/deployment-files/legacy-pusher-cloudformation-template.json b/packages/api/deployment/deployment-files/legacy-pusher-cloudformation-template.json deleted file mode 100644 index ef95a5fa..00000000 --- a/packages/api/deployment/deployment-files/legacy-pusher-cloudformation-template.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "A CloudFormation template for deploying the Pusher on AWS.", - "Parameters": { - "airnodeMnemonic": { - "Type": "String", - "MinLength": 10, - "Description": "Mnemonic phrase of your Airnode address." - }, - "nodaryApiKey": { - "Type": "String", - "MinLength": 10, - "Description": "Nodary API key." - } - }, - "Resources": { - "CloudWatchLogsGroup": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "PusherLogGroup", - "RetentionInDays": 7 - } - }, - "AppDefinition": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "NetworkMode": "awsvpc", - "Cpu": 256, - "Memory": 512, - "ExecutionRoleArn": { - "Ref": "ECSTaskRole" - }, - "RequiresCompatibilities": ["FARGATE"], - "ContainerDefinitions": [ - { - "Name": "Pusher-8feb122755282d6450e5529205e5ad8565d35f33", - "Image": "siegrift/api3-pusher:8feb122755282d6450e5529205e5ad8565d35f33", - "Environment": [ - { - "Name": "SECRETS_ENV", - "Value": { - "Fn::Join": [ - "", - [ - "WALLET_MNEMONIC", - "=", - { - "Ref": "airnodeMnemonic" - }, - "\\n", - "NODARY_API_KEY", - "=", - { - "Ref": "nodaryApiKey" - }, - "\\n", - "STAGE", - "=", - "aws-1700482577" - ] - ] - } - }, - { - "Name": "LOG_LEVEL", - "Value": "debug" - } - ], - "EntryPoint": [ - "/bin/sh", - "-c", - "echo -e $SECRETS_ENV >> ./config/secrets.env && wget -O - https://raw.githubusercontent.com/api3dao/signed-api/deployment-template/packages/api/deployment/nodary-pusher.json >> ./config/pusher.json && node dist/src/index.js" - ], - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "CloudWatchLogsGroup" - }, - "awslogs-region": { - "Ref": "AWS::Region" - }, - "awslogs-stream-prefix": "siegrift-pusher-1700482577" - } - } - } - ] - } - }, - "AppCluster": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "ClusterName": "PusherCluster-1700482577" - } - }, - "AppService": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "AppCluster" - }, - "ServiceName": "PusherService", - "DesiredCount": 1, - "LaunchType": "FARGATE", - "TaskDefinition": { - "Ref": "AppDefinition" - }, - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "ENABLED", - "Subnets": [ - { - "Ref": "InstanceSubnet" - } - ] - } - }, - "DeploymentConfiguration": { - "MinimumHealthyPercent": 100, - "MaximumPercent": 200 - } - } - }, - "InstanceVPC": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsSupport": true, - "EnableDnsHostnames": true - } - }, - "InstanceInternetGateway": { - "Type": "AWS::EC2::InternetGateway" - }, - "InstanceVPCGatewayAttachment": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "InstanceVPC" - }, - "InternetGatewayId": { - "Ref": "InstanceInternetGateway" - } - } - }, - "InstancePublicRouteTable": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "InstanceVPC" - } - } - }, - "InstancePublicRoute": { - "Type": "AWS::EC2::Route", - "DependsOn": "InstanceVPCGatewayAttachment", - "Properties": { - "RouteTableId": { - "Ref": "InstancePublicRouteTable" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "InstanceInternetGateway" - } - } - }, - "InstanceSubnet": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/24", - "VpcId": { - "Ref": "InstanceVPC" - }, - "MapPublicIpOnLaunch": true - } - }, - "InstancePublicSubnet1RouteTableAssociation": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "InstancePublicRouteTable" - }, - "SubnetId": { - "Ref": "InstanceSubnet" - } - } - }, - "ECSTaskRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": { - "Effect": "Allow", - "Principal": { - "Service": ["ecs-tasks.amazonaws.com"] - }, - "Action": ["sts:AssumeRole"] - } - }, - "Policies": [ - { - "PolicyName": "ECSTaskExecutionRolePolicy", - "PolicyDocument": { - "Statement": { - "Effect": "Allow", - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Resource": "*" - } - } - } - ] - } - } - } -} diff --git a/packages/api/deployment/deployment-files/nodary.pusher.json b/packages/api/deployment/deployment-files/nodary.pusher.json deleted file mode 100644 index d8a2692a..00000000 --- a/packages/api/deployment/deployment-files/nodary.pusher.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "templates": { - "0xcc35bd1800c06c12856a87311dd95bfcbb3add875844021d59a929d79f3c99bd": { - "endpointId": "0x3528e42b017a5fbf9d2993a2df04efc3ed474357575065a111b054ddf9de2acc", - "parameters": [{ "type": "string32", "name": "name", "value": "WTI/USD" }] - }, - "0x086130c54864b2129f8ac6d8d7ab819fa8181bbe676e35047b1bca4c31d51c66": { - "endpointId": "0x3528e42b017a5fbf9d2993a2df04efc3ed474357575065a111b054ddf9de2acc", - "parameters": [{ "type": "string32", "name": "name", "value": "XAG/USD" }] - }, - "0x1d65c1f1e127a41cebd2339f823d0290322c63f3044380cbac105db8e522ebb9": { - "endpointId": "0x3528e42b017a5fbf9d2993a2df04efc3ed474357575065a111b054ddf9de2acc", - "parameters": [{ "type": "string32", "name": "name", "value": "XAU/USD" }] - } - }, - "endpoints": { - "0x3528e42b017a5fbf9d2993a2df04efc3ed474357575065a111b054ddf9de2acc": { - "endpointName": "feed", - "oisTitle": "Nodary" - } - }, - "triggers": { - "signedApiUpdates": [ - { - "signedApiName": "aws-signed-api", - "templateIds": [ - "0xcc35bd1800c06c12856a87311dd95bfcbb3add875844021d59a929d79f3c99bd", - "0x086130c54864b2129f8ac6d8d7ab819fa8181bbe676e35047b1bca4c31d51c66", - "0x1d65c1f1e127a41cebd2339f823d0290322c63f3044380cbac105db8e522ebb9" - ], - "fetchInterval": 5, - "updateDelay": 30 - } - ] - }, - "signedApis": [ - { - "name": "aws-signed-api", - "url": "http://signed-api-elb-256792608.us-east-1.elb.amazonaws.com/" - } - ], - "ois": [ - { - "oisFormat": "2.2.0", - "title": "Nodary", - "version": "0.2.0", - "apiSpecifications": { - "components": { - "securitySchemes": { - "NodarySecurityScheme1ApiKey": { "in": "header", "name": "x-nodary-api-key", "type": "apiKey" } - } - }, - "paths": { - "/feed/latest": { "get": { "parameters": [{ "in": "query", "name": "name" }] } }, - "/feed/latestV2": { "get": { "parameters": [{ "in": "query", "name": "names" }] } } - }, - "servers": [{ "url": "https://api.nodary.io" }], - "security": { "NodarySecurityScheme1ApiKey": [] } - }, - "endpoints": [ - { - "fixedOperationParameters": [], - "name": "feed", - "operation": { "method": "get", "path": "/feed/latestV2" }, - "parameters": [{ "name": "name", "operationParameter": { "in": "query", "name": "names" } }], - "reservedParameters": [ - { "name": "_type", "fixed": "int256" }, - { "name": "_times", "fixed": "1000000000000000000" } - ], - "preProcessingSpecifications": [ - { - "environment": "Node", - "value": "const output = {};", - "timeoutMs": 5000 - } - ], - "postProcessingSpecifications": [ - { - "environment": "Node", - "value": "const output = input[endpointParameters.name].value;", - "timeoutMs": 5000 - } - ] - } - ] - } - ], - "apiCredentials": [ - { - "oisTitle": "Nodary", - "securitySchemeName": "NodarySecurityScheme1ApiKey", - "securitySchemeValue": "${NODARY_API_KEY}" - } - ], - "nodeSettings": { - "nodeVersion": "0.1.0", - "airnodeWalletMnemonic": "${WALLET_MNEMONIC}", - "stage": "${STAGE}" - } -} diff --git a/packages/api/deployment/deployment-files/original-pusher-template.json b/packages/api/deployment/deployment-files/original-pusher-template.json deleted file mode 100644 index 12115700..00000000 --- a/packages/api/deployment/deployment-files/original-pusher-template.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "A CloudFormation template for deploying the Pusher on AWS.", - "Parameters": { - "airnodeMnemonic": { - "Type": "String", - "MinLength": 10, - "Description": "Mnemonic phrase of your Airnode address." - }, - "grafanaLokiUser": { - "Type": "String", - "MinLength": 2, - "Description": "Username for authenticating Loki API (This should be handed to you)." - }, - "grafanaLokiToken": { - "Type": "String", - "MinLength": 10, - "Description": "Token for authenticating Loki API (This should be handed to you)." - }, - "grafanaLokiEndpoint": { - "Type": "String", - "MinLength": 10, - "Description": "Loki endpoint (This should be handed to you)." - }, - "apiKey1": { - "Type": "String", - "MinLength": 10, - "Description": "API secret 1." - }, - "apiKey2": { - "Type": "String", - "MinLength": 10, - "Description": "API secret 2." - } - }, - "Resources": { - "CloudWatchLogsGroup": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "PusherLogGroup", - "RetentionInDays": 7 - } - }, - "AppDefinition": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "NetworkMode": "awsvpc", - "Cpu": 256, - "Memory": 512, - "ExecutionRoleArn": { - "Ref": "ECSTaskRole" - }, - "RequiresCompatibilities": ["FARGATE"], - "ContainerDefinitions": [ - { - "Essential": true, - "Image": "grafana/fluent-bit-plugin-loki:2.9.1-amd64", - "Name": "PusherLogForwarder", - "FirelensConfiguration": { - "Type": "fluentbit", - "Options": { - "enable-ecs-log-metadata": "true" - } - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "CloudWatchLogsGroup" - }, - "awslogs-region": { - "Ref": "AWS::Region" - }, - "awslogs-create-group": "true", - "awslogs-stream-prefix": "firelens" - } - }, - "MemoryReservation": 50 - }, - { - "Name": "Pusher", - "Image": "", - "Environment": [ - { - "Name": "SECRETS_ENV", - "Value": { - "Fn::Join": [ - "", - [ - "WALLET_MNEMONIC", - "=", - { - "Ref": "airnodeMnemonic" - }, - "\\n", - "APIKEY1_VALUE", - "=", - { - "Ref": "apiKey1" - }, - "\\n", - "APIKEY2_VALUE", - "=", - { - "Ref": "apiKey2" - }, - "\\n", - "STAGE", - "=", - "aws", - "\\n", - "LOG_LEVEL", - "=", - "debug" - ] - ] - } - } - ], - "EntryPoint": [ - "/bin/sh", - "-c", - "echo -e $SECRETS_ENV >> ./config/secrets.env && wget -O - >> ./config/pusher.json && node dist/src/index.js" - ], - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "grafana-loki", - "Url": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "grafanaLokiUser" - }, - ":", - { - "Ref": "grafanaLokiToken" - }, - "@", - { - "Ref": "grafanaLokiEndpoint" - }, - "/loki/api/v1/push" - ] - ] - }, - "Labels": "{app=\"pusher\",airnode=\"\"}", - "RemoveKeys": "container_id,container_name,ecs_task_definition,source,ecs_cluster", - "LabelKeys": "ecs_task_arn", - "LineFormat": "json" - } - } - } - ] - } - }, - "AppCluster": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "ClusterName": "PusherCluster" - } - }, - "AppService": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "AppCluster" - }, - "ServiceName": "PusherService", - "DesiredCount": 1, - "LaunchType": "FARGATE", - "TaskDefinition": { - "Ref": "AppDefinition" - }, - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "ENABLED", - "Subnets": [ - { - "Ref": "InstanceSubnet" - } - ] - } - }, - "DeploymentConfiguration": { - "MinimumHealthyPercent": 100, - "MaximumPercent": 200 - } - } - }, - "InstanceVPC": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsSupport": true, - "EnableDnsHostnames": true - } - }, - "InstanceInternetGateway": { - "Type": "AWS::EC2::InternetGateway" - }, - "InstanceVPCGatewayAttachment": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "InstanceVPC" - }, - "InternetGatewayId": { - "Ref": "InstanceInternetGateway" - } - } - }, - "InstancePublicRouteTable": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "InstanceVPC" - } - } - }, - "InstancePublicRoute": { - "Type": "AWS::EC2::Route", - "DependsOn": "InstanceVPCGatewayAttachment", - "Properties": { - "RouteTableId": { - "Ref": "InstancePublicRouteTable" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "InstanceInternetGateway" - } - } - }, - "InstanceSubnet": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/24", - "VpcId": { - "Ref": "InstanceVPC" - }, - "MapPublicIpOnLaunch": true - } - }, - "InstancePublicSubnet1RouteTableAssociation": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "InstancePublicRouteTable" - }, - "SubnetId": { - "Ref": "InstanceSubnet" - } - } - }, - "ECSTaskRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": { - "Effect": "Allow", - "Principal": { - "Service": ["ecs-tasks.amazonaws.com"] - }, - "Action": ["sts:AssumeRole"] - } - }, - "Policies": [ - { - "PolicyName": "ECSTaskExecutionRolePolicy", - "PolicyDocument": { - "Statement": { - "Effect": "Allow", - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Resource": "*" - } - } - } - ] - } - } - } -} diff --git a/packages/api/deployment/deployment-files/pusher-cloudformation-template.json b/packages/api/deployment/deployment-files/pusher-cloudformation-template.json deleted file mode 100644 index 0ff97343..00000000 --- a/packages/api/deployment/deployment-files/pusher-cloudformation-template.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "A CloudFormation template for deploying the Pusher on AWS.", - "Parameters": { - "airnodeMnemonic": { - "Type": "String", - "MinLength": 10, - "Description": "Mnemonic phrase of your Airnode address." - }, - "grafanaLokiUser": { - "Type": "String", - "MinLength": 2, - "Description": "Username for authenticating Loki API (This should be handed to you)." - }, - "grafanaLokiToken": { - "Type": "String", - "MinLength": 10, - "Description": "Token for authenticating Loki API (This should be handed to you)." - }, - "grafanaLokiEndpoint": { - "Type": "String", - "MinLength": 10, - "Description": "Loki endpoint (This should be handed to you)." - }, - "nodaryApiKey": { - "Type": "String", - "MinLength": 10, - "Description": "Nodary API key." - } - }, - "Resources": { - "CloudWatchLogsGroup": { - "Type": "AWS::Logs::LogGroup", - "Properties": { - "LogGroupName": "PusherLogGroup-1700644945", - "RetentionInDays": 7 - } - }, - "AppDefinition": { - "Type": "AWS::ECS::TaskDefinition", - "Properties": { - "NetworkMode": "awsvpc", - "Cpu": 256, - "Memory": 512, - "ExecutionRoleArn": { - "Ref": "ECSTaskRole" - }, - "RequiresCompatibilities": ["FARGATE"], - "ContainerDefinitions": [ - { - "Essential": true, - "Image": "grafana/fluent-bit-plugin-loki:2.9.1-amd64", - "Name": "PusherLogForwarder-1700644945", - "FirelensConfiguration": { - "Type": "fluentbit", - "Options": { - "enable-ecs-log-metadata": "true" - } - }, - "LogConfiguration": { - "LogDriver": "awslogs", - "Options": { - "awslogs-group": { - "Ref": "CloudWatchLogsGroup" - }, - "awslogs-region": { - "Ref": "AWS::Region" - }, - "awslogs-create-group": "true", - "awslogs-stream-prefix": "firelens" - } - }, - "MemoryReservation": 50 - }, - { - "Name": "Pusher-8feb122755282d6450e5529205e5ad8565d35f33", - "Image": "siegrift/api3-pusher:8feb122755282d6450e5529205e5ad8565d35f33", - "Environment": [ - { - "Name": "SECRETS_ENV", - "Value": { - "Fn::Join": [ - "", - [ - "WALLET_MNEMONIC", - "=", - { - "Ref": "airnodeMnemonic" - }, - "\\n", - "NODARY_API_KEY", - "=", - { - "Ref": "nodaryApiKey" - }, - "\\n", - "STAGE", - "=", - "aws-1700644945" - ] - ] - } - }, - { - "Name": "LOG_LEVEL", - "Value": "debug" - } - ], - "EntryPoint": [ - "/bin/sh", - "-c", - "echo -e $SECRETS_ENV >> ./config/secrets.env && wget -O - https://raw.githubusercontent.com/api3dao/signed-api/8f2740a93c9b9fc90b588ed11c91cad1ffade46c/packages/api/deployment/deployment-files/nodary.pusher.json >> ./config/pusher.json && node dist/src/index.js" - ], - "LogConfiguration": { - "LogDriver": "awsfirelens", - "Options": { - "Name": "grafana-loki", - "Url": { - "Fn::Join": [ - "", - [ - "https://", - { - "Ref": "grafanaLokiUser" - }, - ":", - { - "Ref": "grafanaLokiToken" - }, - "@", - { - "Ref": "grafanaLokiEndpoint" - }, - "/loki/api/v1/push" - ] - ] - }, - "Labels": "{app=\"pusher\",airnode=\"0xF35E2f96544db1A5330A1F68012Fe34C5219EE7b\"}", - "RemoveKeys": "container_id,container_name,ecs_task_definition,source,ecs_cluster", - "LabelKeys": "ecs_task_arn", - "LineFormat": "json" - } - } - } - ] - } - }, - "AppCluster": { - "Type": "AWS::ECS::Cluster", - "Properties": { - "ClusterName": "PusherCluster-1700644945" - } - }, - "AppService": { - "Type": "AWS::ECS::Service", - "Properties": { - "Cluster": { - "Ref": "AppCluster" - }, - "ServiceName": "PusherService-1700644945", - "DesiredCount": 1, - "LaunchType": "FARGATE", - "TaskDefinition": { - "Ref": "AppDefinition" - }, - "NetworkConfiguration": { - "AwsvpcConfiguration": { - "AssignPublicIp": "ENABLED", - "Subnets": [ - { - "Ref": "InstanceSubnet" - } - ] - } - }, - "DeploymentConfiguration": { - "MinimumHealthyPercent": 100, - "MaximumPercent": 200 - } - } - }, - "InstanceVPC": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsSupport": true, - "EnableDnsHostnames": true - } - }, - "InstanceInternetGateway": { - "Type": "AWS::EC2::InternetGateway" - }, - "InstanceVPCGatewayAttachment": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "InstanceVPC" - }, - "InternetGatewayId": { - "Ref": "InstanceInternetGateway" - } - } - }, - "InstancePublicRouteTable": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "InstanceVPC" - } - } - }, - "InstancePublicRoute": { - "Type": "AWS::EC2::Route", - "DependsOn": "InstanceVPCGatewayAttachment", - "Properties": { - "RouteTableId": { - "Ref": "InstancePublicRouteTable" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "InstanceInternetGateway" - } - } - }, - "InstanceSubnet": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "CidrBlock": "10.0.0.0/24", - "VpcId": { - "Ref": "InstanceVPC" - }, - "MapPublicIpOnLaunch": true - } - }, - "InstancePublicSubnet1RouteTableAssociation": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "InstancePublicRouteTable" - }, - "SubnetId": { - "Ref": "InstanceSubnet" - } - } - }, - "ECSTaskRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": { - "Effect": "Allow", - "Principal": { - "Service": ["ecs-tasks.amazonaws.com"] - }, - "Action": ["sts:AssumeRole"] - } - }, - "Policies": [ - { - "PolicyName": "ECSTaskExecutionRolePolicy", - "PolicyDocument": { - "Statement": { - "Effect": "Allow", - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogStreams", - "logs:PutLogEvents" - ], - "Resource": "*" - } - } - } - ] - } - } - } -}