import { RetentionDays } from 'aws-cdk-lib/aws-logs'; import { TaskEnvironment } from '../../utilities/environment'; import { BaseSettings } from '../base-stack'; /** * These are the container settings that are defined. */ export interface TwinGateServiceSettings extends BaseSettings { /** * VPC will accept either a string or null. If null, we'll create a new * VPC. If you provide a string, we'll import that vpc, or error out */ vpc?: string; /** * If you already have a cluster and want twingate to run as a service * in the existing cluster, you can pass the cluster arn here */ clusterArn?: string; /** * Pass the ARN of a secret store */ secretsARN: string; /** * The name of the service */ twingateName: string; /** * The db needs subnets defined. Provide these two. */ subnet1?: string; /** * Allows the settings to provide custom environment vars */ customEnvironment: TaskEnvironment; /** * Provide an array of resolvable environment secrets where * the key is the env var, and the value is the settings key */ customEnvironmentSecrets: TaskEnvironment; /** * The default tag that this container should pull from */ tag?: string; /** * How many containers are desired */ desired: number; /** * The number of cpu units used by the task. * * Valid values, which determines your range of valid values for the memory parameter: * * 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB * * 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB * * 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB * * 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments * * 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments * * This default is set in the underlying FargateTaskDefinition construct. * * @default 256 */ cpu: number; /** * The amount (in MiB) of memory used by the task. * * This field is required and you must use one of the following values, which determines your range of valid values * for the cpu parameter: * * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) * * 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) * * 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) * * Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU) * * Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU) * * This default is set in the underlying FargateTaskDefinition construct. * * @default 512 */ memory: number; /** * How long should we wait */ gracePeriod?: number; /** * The minimum containers to deploy */ min?: number; /** * The maximum containers to deploy */ max?: number; /** * How Long should logs be retained for */ logRetention?: RetentionDays; /** * The id of the security group for twingate */ securityGroupId?: string; /** * The tenant url */ tenant_url: string; /** * Should we assign a public ip to the stack. Defaults to false */ assignPublicIp?: boolean; }