copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

[Bug]: Services which are explicitly configured to be placed in private subnets are deployed in public subnets.

Open oakhan3 opened this issue 1 year ago • 2 comments

Description:

I have created a worker service with following configuration:

name: ...
type: Worker Service

network:
 vpc:
   placement: 'private'

image:
  build: ../Dockerfile
  healthcheck:
    command: [ "CMD-SHELL", "python run.py || exit 1" ]
    interval: 60s
    retries: 2
    timeout: 30s

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/worker-service/#platform
exec: true     # Enable running commands in your container.

Details:

copilot version: v1.33.2
host os: mac OS Ventura Version 13.5.2 
aws regions include us-east-1 and us-east-2

Observed result:

It seems like the configuration for placement is ignored - the service/tasks are placed in a public subnet with public IPs.

Expected result:

I would expect the service/tasks to be deployed in the private subnets associated with the env and without any public IP.

Thank you

oakhan3 avatar May 06 '24 18:05 oakhan3

Note that the VPC i'm using was not copilot generated but I do explicitly supply 2 public and 2 private subnets from the VPC in the env config.

oakhan3 avatar May 06 '24 18:05 oakhan3

Hello @oakhan3. There's a missing space before vpc and vpc.placement in your manifest. Can you check if it works if you fix the manifest?

network:
  vpc:
    placement: 'private'

iamhopaul123 avatar May 10 '24 16:05 iamhopaul123

This issue is stale because it has been open 60 days with no response activity. Remove the stale label, add a comment, or this will be closed in 14 days.

github-actions[bot] avatar Jul 21 '24 00:07 github-actions[bot]

This issue is closed due to inactivity. Feel free to reopen the issue if you have any further questions!

github-actions[bot] avatar Aug 05 '24 00:08 github-actions[bot]