Skip to content
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

Using service_registries with py in ecs.Service #77

Open
caffeinate opened this issue Mar 8, 2024 · 5 comments
Open

Using service_registries with py in ecs.Service #77

caffeinate opened this issue Mar 8, 2024 · 5 comments
Labels
customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec

Comments

@caffeinate
Copy link

using ecs.Service(..)

This arg-
service_registries=[ecs.ServiceServiceRegistriesArgs(registry_arn=http_namespace.arn)],

causes-
AssertionError: Unexpected type. Expected 'list' got '<class 'pulumi_aws.ecs._inputs.ServiceServiceRegistriesArgs'>'

The service_registries are being supplied as a list.

Expected behavior

This code was used as a starting point-
https://www.pulumi.com/ai/answers/1eTQsUEuD7z6y4iEJWxa3d/implementing-service-discovery-for-ai-workloads-on-aws-ecs

I've reduced the original plan to used exactly the same servicediscovery.HttpNamespace as in the example code.

Current behavior

Throws an exception.

Steps to reproduce

I'm using Pulumi 3.109.0 and pulumi_aws 6.25.0

  1. This commit Aye-Aye-Dev/Aye-Aye-Recipes@c66a3dc
  2. Uncomment line 193 of aws_fargate/cluster/main.py
  3. pulumi up

Context (Environment)

Make the IP addresses (ideally using PrivateDnsNamespace available to another ECS service).

Affected feature

@caffeinate caffeinate added customer/feedback Feedback from customers needs-triage Needs attention from the triage team labels Mar 8, 2024
@meagancojocar meagancojocar transferred this issue from pulumi/pulumi-cloud-requests Mar 11, 2024
@iwahbe
Copy link
Member

iwahbe commented Mar 13, 2024

Hi @caffeinate. I'm sorry you're hitting that. It's definitely confusing. The correct type for service_registries is ecs.ServiceServiceRegistriesArgs (docs):

https://github.com/pulumi/pulumi-aws/blob/b82e03002e0c3b7bdc584fae396d7de7d4c7729d/sdk/python/pulumi_aws/ecs/service.py#L42

Could you provide the line number for the assertion error? If that's coming from Pulumi code, we would like to fix the error.

@iwahbe iwahbe removed the needs-triage Needs attention from the triage team label Mar 13, 2024
@AaronFriel
Copy link

AaronFriel commented Mar 13, 2024

Hey, sorry about that - it looks like in this case we need to improve our retrieval augmented generation for Pulumi AI. I'll move this to the AI repo, though I think we won't have an immediate fix for this.

@iwahbe is correct, the right code should be service_registries=aws.ecs.ServiceServiceRegistriesArgs.

@AaronFriel AaronFriel transferred this issue from pulumi/pulumi-aws Mar 13, 2024
@AaronFriel AaronFriel added the kind/bug Some behavior is incorrect or out of spec label Mar 13, 2024
@caffeinate
Copy link
Author

Just to confirm- If I use a list as per the example I get the assertion error which originates from-

     File "/Users/si/.local/share/virtualenvs/aws_fargate-vnPX2j61/lib/python3.10/site-packages/pulumi/runtime/rpc.py", line 168, in _get_list_element_type
        raise AssertionError(f"Unexpected type. Expected 'list' got '{typ}'")

If I use a single ServiceServiceRegistriesArgs I get-

error: 1 error occurred:
* creating ECS Service (rabbitmq-service-8e97823): InvalidParameterException: The format of the supplied service registry ARN is invalid: arn:aws:servicediscovery:eu-west-2:000000000000:namespace/ns-g4el2rhxjbpp3pp4.

The ARN is from this-

http_namespace = servicediscovery.HttpNamespace(
    "fossa_http_namespace",
    name="fossa_workloads",
    description="HTTP Namespace for Fossa",
)

Which is pretty close to the example.

Thanks for looking into this.

@AaronFriel
Copy link

@caffeinate We've just shipped some improvements here to the prompting for list types. Due to the search issues mentioned before, though, I'm not confident it would result in better code generation here. We're tracking an issue for improving resource retrieval and grounding results.

@caffeinate
Copy link
Author

Thanks @AaronFriel , I can confirm that this hasn't yet solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants