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

events_targets: (Python) got an unexpected keyword argument 'enable_execute_command' #27336

Closed
pascalgulikers opened this issue Sep 28, 2023 · 3 comments
Labels
@aws-cdk/aws-events-targets bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@pascalgulikers
Copy link

pascalgulikers commented Sep 28, 2023

Describe the bug

It looks like the enable_execute_command boolean is not correctly ported to the Python CDK version.
The documentation states: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_events_targets/EcsTask.html

Code:

rule.add_target(targets.EcsTask(
    cluster=cluster,
    task_definition=task_definition,
    task_count=1,
    container_overrides=[targets.ContainerOverride(
        container_name="TheContainer",
        command=["echo", events.EventField.from_path("$.detail.event")]
    )],
    enable_execute_command=True
))

results in:

                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/_work/_tool/Python/3.11.5/x64/lib/python3.11/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: EcsTask.__init__() got an unexpected keyword argument 'enable_execute_command'

Subprocess exited with error 1

Expected Behavior

Accept the enable_execute_command boolean parameter

Current Behavior

rule.add_target(events_targets.EcsTask(
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/_work/_tool/Python/3.11.5/x64/lib/python3.11/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: EcsTask.__init__() got an unexpected keyword argument 'enable_execute_command'

Subprocess exited with error 1

Reproduction Steps

In Python:

from aws_cdk import aws_events_targets as events_targets

rule.add_target(targets.EcsTask(
    cluster=cluster,
    task_definition=task_definition,
    task_count=1,
    container_overrides=[targets.ContainerOverride(
        container_name="TheContainer",
        command=["echo", events.EventField.from_path("$.detail.event")]
    )],
    enable_execute_command=True
))

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.99.0

Framework Version

No response

Node.js Version

18

OS

Ubuntu Linux

Language

Python

Language Version

3.11.5

Other information

No response

@pascalgulikers pascalgulikers added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2023
@pascalgulikers
Copy link
Author

The same thing happens with the tags parameter:
TypeError: EcsTask.init() got an unexpected keyword argument 'tags'

@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2023
@khushail
Copy link
Contributor

khushail commented Sep 28, 2023

Hi @pascalgulikers , i tried to reproduce the same error but it deployed successfully -
Screenshot 2023-09-28 at 12 23 56 PM

Here is a snippet of deployed resources -
Screenshot 2023-09-28 at 12 25 25 PM

Could you please check if you have installed the required libraries and imported properly.

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Sep 28, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 30, 2023
@github-actions github-actions bot added closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 5, 2023
@github-actions github-actions bot closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events-targets bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants