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

fix(ecs): ecs exec cannot be enabled for ECS Anywhere (ecs.ExternalService) #31374

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented Sep 9, 2024

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 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


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team September 9, 2024 13:24
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Sep 9, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 9, 2024

Exemption Request: unable to execute integ test.

To complete the deployment, an external instance such as a VM is required, but I think this is very difficult in integ test.
In a previous PR for the ExternalService implementation, integ test wasn't inclueded.

#14931 (comment)

I tried running the integration test, but since the external instance did not exist, the deployment could not be completed.

スクリーンショット 2024-09-09 22 15 41

During the deployment, I confirmed that the enableExecuteCommand property of the ExternalService was set to true using the CLI, so I would like to consider this as an alternative.

 % aws ecs describe-services --cluster aws-ecs-integ-external-exec-command-ExternalCluster14BF29C2-1WgNGhaSCe6j --service aws-ecs-integ-external-exec-command-ExternalService9AC5437C-yEbQ87UFPByK  --region us-east-1                           
{
    "services": [
        {
            "serviceArn": "arn:aws:ecs:us-east-1:...
             // omit
            "enableExecuteCommand": true
             // omit
}

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Sep 9, 2024
Copy link
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the description (in your Ec2Service or FargateService) in README?

To enable the ECS Exec feature for your containers, set the boolean flag enableExecuteCommand to true in your Ec2Service or FargateService.

https://github.com/go-to-k/aws-cdk/blob/152f32d887baacecd95d4d3aea7703cb467b1771/packages/aws-cdk-lib/aws-ecs/README.md#ecs-exec-command

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 20, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 20, 2024

@go-to-k
Thanks. I've updated.

@mazyu36 mazyu36 requested a review from go-to-k September 20, 2024 05:24
Copy link
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Sep 20, 2024
GavinZZ
GavinZZ previously approved these changes Oct 7, 2024
@GavinZZ GavinZZ added pr-linter/exempt-integ-test The PR linter will not require integ test changes and removed pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. labels Oct 7, 2024
@GavinZZ GavinZZ changed the title fix(ecs): ECS exec cannot be enabled for ECS Anywhere (ecs.ExternalService) fix(ecs): ecs exec cannot be enabled for ECS Anywhere (ecs.ExternalService) Oct 7, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 7, 2024 19:17

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Oct 7, 2024
Copy link
Contributor

mergify bot commented Oct 7, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@GavinZZ
Copy link
Contributor

GavinZZ commented Oct 7, 2024

@mergify update

Copy link
Contributor

mergify bot commented Oct 7, 2024

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/request-cli-integ-test.yml without workflows permission

@mergify mergify bot dismissed GavinZZ’s stale review October 7, 2024 21:48

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 32696f4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Oct 7, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit cff1fcd into aws:main Oct 7, 2024
13 checks passed
Copy link

github-actions bot commented Oct 7, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2024
@mazyu36 mazyu36 deleted the ecs-external-31181 branch October 7, 2024 23:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/small Small work item – less than a day of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ecs.ExternalService: enableExecuteCommand is shown as not supported (while in fact it is supported)
4 participants