-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS ECS Task Definition Port Mapping Name ignored by pulumi #2968
Comments
I only started using Pulumi last night and looking at the source today, so I'm not sure at all but looking at the code, pulumi-aws/sdk/nodejs/ecs/container.ts Lines 189 to 193 in 4c3960c
|
@chan-vince Thank you for filing this issue. I think your analysis is basically correct and we need to add missing properties to |
@mikhailshilkov |
Some background: Pulumi has It would be extremely helpful to have a self-contained repro program that uses only |
Hello guys, I'm having the same problem here, trying to use But I think the error also applies when you try using the network mode
|
I believe this should be fixed now that #3043 is merged. |
What happened?
I want to create a containerised service on AWS ECS Fargate, where I want a port mapping on a container in the Task Definition, which works.
However there is also an optional
name
argument (e.g. here in python awsx) which can be added to the port mapping but this does not appear to work - there is no error but it's like it is ignored. I don't think Pulumi is reading/using/applying it, as the diff doesn't pick up on changes either.The ability to name a port mapping is probably an unusual use case - typically you'd only care about which ports/protocols you're mapping into the container - there's no obvious reason to want to name it. The reason why it is important to me is because a named port mapping is how ECS Service Connect works - without it, it cannot register a service instance in AWS Cloud Map. It is described here in the AWS docs that it exists for Service Connect.
Whether I use
awsx.ecs.FargateService()
or theaws.ecs.*
resources directly, seems to make no difference. But to be more concise here, I'll use theawsx
example. I am using python and I have only used python, so I am unable to determine whether this is an issue specific to the python runtime or not.Example
Note the port name of
"this-should-be-present"
is defined in the containerport_mappings
port, and is referenced by the service asport_name
inservice_connect_configuration
. It is this link that enables ECS Service Connect to do service discovery on the containers.pulumi up
to create it. It will fail because the port name in the port mapping is not applied, and so the service can't find a port with that name.It fails with this AWS error in the diagnostics when it tries to apply:
So comment out the
FargateService.service_connect_configuration
to skip it for now, then it will work."this-should-be-present"
. Alternatively, use the awscli with jq to see the same issue:aws ecs describe-task-definition --task-definition task-definition-name-here | jq -r '.taskDefinition.containerDefinitions[].portMappings[]'
The output is:
but I expected it to be:
Output of
pulumi about
CLI
Version 3.92.0
Go Version go1.21.3
Go Compiler gc
Plugins
NAME VERSION
python unknown
Host
OS darwin
Version 14.1
Arch arm64
This project is written in python: executable='/Users/vince/.pyenv/shims/python3' version='3.11.4'
Current Stack: organization/project/dev
TYPE URN
[omitted]
Found no pending operations associated with dev
Backend
Name Vinces-Macbook-Pro.local
URL s3://sandbox-vc-pulumi/pulumi?region=eu-west-1&awssdk=v2
User vince
Organizations
Token type personal
Dependencies:
NAME VERSION
black 23.10.1
pip 23.2.1
pylint 2.17.5
pytest 7.4.3
ruff 0.1.4
setuptools 65.5.0
Pulumi locates its logs in /var/folders/w5/nm4wxtn55sg2szxyrlxd6vv80000gn/T/ by default
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: