This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Construct } from "constructs"; | |
import { Stack, StackProps, Duration, RemovalPolicy } from "aws-cdk-lib"; | |
import { Config, EnvironmentConfig } from "../config/config"; | |
import { Vpc } from "aws-cdk-lib/aws-ec2"; | |
import * as ecs from "aws-cdk-lib/aws-ecs"; | |
import * as ssm from "aws-cdk-lib/aws-ssm"; | |
import * as ecr from "aws-cdk-lib/aws-ecr"; | |
import * as logs from "aws-cdk-lib/aws-logs"; | |
import * as iam from "aws-cdk-lib/aws-iam"; | |
import * as ecs_patterns from "aws-cdk-lib/aws-ecs-patterns"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// export class RelayerServiceStack etc etc... | |
// and importing vpc and cluster above | |
const listener = props.relayerLoadBalancer.addListener("RelayerListener", { | |
port: 80, | |
protocol: elbv2.ApplicationProtocol.HTTP, | |
open: true, | |
}); | |
listener.connections.allowFromAnyIpv4(ec2.Port.allTraffic()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class RelayerTaskDefinition extends Stack { | |
public readonly taskDefinition: ecs.TaskDefinition; | |
constructor(scope: Construct, id: string, props: MyStackProps) { | |
super(scope, id, props); | |
const relayerLogGroup = new logs.LogGroup(this, "RelayerLogGroup", { | |
removalPolicy: RemovalPolicy.RETAIN, | |
retention: logs.RetentionDays.ONE_WEEK, | |
}); |