aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.42k stars 397 forks source link

Issue with the existing ALB #5863

Closed alxjzx100 closed 6 days ago

alxjzx100 commented 1 week ago

Hello, I have an issue trying to deploy a backend service with a predefined ALB. No matter what I do, it always creates a new ALB instead of attaching a new rule to the existing one. Also, it is exposing port 80, but the documentation says that it is supposed to use the port from the image section.

What i'm doing wrong?

Here is the service manifest file i'm using:


# Read the full specification for the "Backend Service" type at:
#  https://aws.github.io/copilot-cli/docs/manifest/backend-service/

# Your service name will be used in naming your resources like log groups, ECS services, etc.
name: nodejs-sso
type: Backend Service

http:
  path: '/'
  alb: 'ARN:ALB'

# Your service is reachable at "http://nodejs-sso.${COPILOT_SERVICE_DISCOVERY_ENDPOINT}:12345" but is not public.

# Configuration for your containers and service.
image:
  # Docker build arguments. For additional overrides: https://aws.github.io/copilot-cli/docs/manifest/backend-service/#image-build
  build: Dockerfile
  # Port exposed through your container to route traffic to it.
  port: 12345

cpu: 256       # Number of CPU units for the task.
memory: 512    # Amount of memory in MiB used by the task.
platform: linux/x86_64     # See https://aws.github.io/copilot-cli/docs/manifest/backend-service/#platform
count: 1       # Number of tasks that should be running in your service.
exec: true     # Enable running commands in your container.
network:
  vpc:
    placement: private
  connect: true # Enable Service Connect for intra-environment traffic between services.

variable:
  NODE_ENV: 'dev'

# storage:
  # readonly_fs: true       # Limit to read-only access to mounted root filesystems.

# Optional fields for more advanced use-cases.
#
#variables:                    # Pass environment variables as key value pairs.
#  LOG_LEVEL: info

#secrets:                      # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
#  GITHUB_TOKEN: GITHUB_TOKEN  # The key is the name of the environment variable, the value is the name of the SSM parameter.

# You can override any of the values defined above by environment.
#environments:
#  test:
#    count: 2               # Number of tasks to run for the "test" environment.
#    deployment:            # The deployment strategy for the "test" environment.
#       rolling: 'recreate' # Stops existing tasks before new ones are started for faster deployments.```
Lou1415926 commented 1 week ago

Hi! Importing alb for a backend service is not released yet. That is http.alb is not a working field for backend services - yet. We will keep you updated when we release it (soon)!

dannyrandall commented 6 days ago

Hey @alxjzx100, this feature was released in v1.34.0 a couple days ago! :blush: Try it out and let us know if you run into any issues!