This code snippet demonstrates how to set up an infra stack. It includes the creation of a VPC, security group, interfaces, cluster ecs, namespace and certificate. All these resources will be needed for the other stacks.
export class InfraStack extends Stack { constructor(scope: Construct, id: string, props: Props) { super(scope, id, props); // Step 1: Create VPC with 2 subnets, one Public and one Isolated within 2 availability zones. // Step 2: Create Security group to allow HTTPS from VPC to endpoints (ECR, Logs). // Step 3: Add Endpoint to private connectivity within AWS // Gateway endpoint to S3 // Gateway endpoint to DynamoDB // The interface to ECR is needed to get the image of the service from ECR // Interface endpoint to ECR // Interface endpoint to ECR DOCKER // Interface endpoint to CLOUDWATCH_LOGS // Interface endpoint to CLOUDWATCH_MONITORING // Step 4: Create Cluster ECS in the VPC // Step 5: Create private namespace to service discovery // Step 6: Create hostedZone and certificate for domain } }