ECSFargateService

A service hosted on AWS ECS Fargate.

Like all Services, this class configures itself across multiple Environments.

For more information see the official documentation.

Example Usage

1
import launchflow as lf
2
3
# Automatically creates / connects to an ECS Fargate Service in your AWS account
4
service = lf.aws.ECSFargateService("my-service")

NOTE: This will create the following infrastructure in your AWS account:

initialization

Creates a new ECS Fargate service.

Args:

  • name (str): The name of the service.
  • cpu (int): The CPU units to allocate to the container. Defaults to 256.
  • memory (int): The memory to allocate to the container. Defaults to 512.
  • port (int): The port the container listens on. Defaults to 80.
  • desired_count (int): The number of tasks to run. Defaults to 1.
  • build_directory (str): The directory to build the service from. This should be a relative path from the project root where your launchflow.yaml is defined.
  • dockerfile (str): The Dockerfile to use for building the service. This should be a relative path from the build_directory.
  • build_ignore (List[str]): A list of files to ignore when building the service. This can be in the same syntax you would use for a .gitignore.
  • domain (Optional[str]): The domain name to use for the service. This will create an ACM certificate and configure the ALB to use HTTPS.
  • certificate (Optional[ACMCertificate]): An existing ACM certificate to use for the service. This will configure the ALB to use HTTPS.
  • cluster (Optional[ECSCluster]): The ECS cluster to use for the service. If not provided, a new cluster will be created.