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

EcsService: network_configuration incorrectly typed as a Sequence #2918

Closed
1 task
mark-ship-it opened this issue Jun 4, 2023 · 3 comments
Closed
1 task
Labels
bug Something isn't working

Comments

@mark-ship-it
Copy link

Expected Behavior

    ecs_service.EcsService(self, "service",
        name=project,
        cluster=cluster,
        task_definition=task,
        desired_count=1,
        launch_type="FARGATE",
        network_configuration={
            "subnets": [subnet.id],
            "security_groups": [sg],
            "assign_public_ip": False
        },
    )

should allow me to generate a plan

Actual Behavior

I get an error:

TypeError: type of argument security_groups must be one of (Sequence[str], NoneType); got list instead

Steps to Reproduce

Spin up a simple ECS Service and pass it a list of subnets

Versions

cdktf 0.16.2

Providers

┌───────────────┬──────────────────┬─────────┬────────────┬──────────────────────────┬─────────────────┐
│ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │
├───────────────┼──────────────────┼─────────┼────────────┼──────────────────────────┼─────────────────┤
│ aws │ 4.66.1 │ │ = 4.66.1 │ │ │
├───────────────┼──────────────────┼─────────┼────────────┼──────────────────────────┼─────────────────┤
│ aws │ 4.66.1 │ ^0.16.0 │ │ cdktf-cdktf-provider-aws │ 14.0.4 │
└───────────────┴──────────────────┴─────────┴────────────┴──────────────────────────┴─────────────────┘

Gist

No response

Possible Solutions

change the type of subnets in network configuration from sequence to list

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@mark-ship-it mark-ship-it added bug Something isn't working new Un-triaged issue labels Jun 4, 2023
@mark-ship-it
Copy link
Author

was able to make progress. 5.1.0 seems to run plan/apply much slower than 4.x

was able to fix it:

            name=project,
            cluster=cluster.name,
            task_definition=task.arn,
            desired_count=1,
            launch_type="FARGATE",
            network_configuration={
                "subnets": ["subnet-11111111111"],
                "security_groups": [sg.id],
                "assign_public_ip": False
            },

but then i get:
creating ECS Service (cdktf-ecs-template): InvalidParameterException: Creation of service was not idempotent.

@mark-ship-it
Copy link
Author

had to remove the manually created ecs service and then this worked

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
@DanielMSchmidt DanielMSchmidt removed the new Un-triaged issue label Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants