-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
ecs.ExternalService: enableExecuteCommand is shown as not supported (while in fact it is supported) #31181
ecs.ExternalService: enableExecuteCommand is shown as not supported (while in fact it is supported) #31181
Comments
Reproducible using customer code.
The exception is thrown due to validation check here. Looking at the commit history, the validation is in place since last 3 years per commit 3592b26. @hrko Good afternoon. Could you please point me to documentation or example which demonstrates that Thanks, |
@ashishdhingra As an example, extract a CfnService from an ExternalService and then enableExecuteCommand can be enabled for that CfnService. The example is shown in the following code: const ecsService = new ecs.ExternalService(this, 'ExternalService', {
serviceName: "EcsAnywhereService",
cluster: EcsAnywhereCluster,
taskDefinition,
desiredCount: 1,
});
+ const cfnService = ecsService.node.defaultChild as ecs.CfnService;
+ cfnService.enableExecuteCommand = true; Once the above example code is deployed, you can use (I did not find either a statement in the documentation that |
@hrko Thanks for sharing your inputs. I was able to run Thanks, |
…rvice) (#31374) ### Issue # (if applicable) Closes #31181. ### Reason for this change In the `ecs.ExternalService` class (ECS Anywhere), the `enableExecuteCommand` property cannot be set to true, so it is not possible to enable ECS exec. However, the [documentation](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) states that ECS Anywhere supports ECS Exec. > ECS Exec is supported for tasks that run on the following infrastructure: > Linux and Windows containers on external instances (Amazon ECS Anywhere) ### Description of changes Remove unnecessary if statement. ### Description of how you validated changes Fix an unit test. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
When creating an ExternalService, specifying the
enableExecuteCommand: true
option for the property will result in the following error when runningcdk synth
.However, the
enableExecuteCommand
option is actually supported by the ExternalService as well, and can be manually enabled using the AWS CLI.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
When creating an ExternalService, the
enableExecuteCommand: true
option can be set for the property.Current Behavior
When creating an ExternalService, setting the
enableExecuteCommand: true
option to the property causes an error when executingcdk synth
.Reproduction Steps
A code snippet that reproduces the problem is like as follows:
Click here to show entire stack code
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.154.0 (build 0fc07f3)
Framework Version
No response
Node.js Version
v20.17.0
OS
Debian GNU/Linux 11 (bullseye)
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: