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
feat(stepfunctions-tasks): task construct to call RunJob
on ECS
#8451
Conversation
packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/ec2-run-task.ts
Outdated
Show resolved
Hide resolved
…g the bind pattern
packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/ec2-run-task.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small nits but the APIs feel right to me. As far as bind
vs base class I would lean towards bind
as well.
packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/run-task-base.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-stepfunctions-tasks/lib/ecs/ec2-run-task.ts
Outdated
Show resolved
Hide resolved
…cs props. folded all the logic in and removed abstract class
Changes lgtm. Will leave approval to @nija-at so it doesn’t auto merge before he gets a second look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at the comment around bind() signature and couple of comments around security groups. These two need to be addressed, a few around code simplification, the rest are just slight adjustments.
for (const override of this.props.containerOverrides ?? []) { | ||
const name = override.containerDefinition.containerName; | ||
if (!cdk.Token.isUnresolved(name)) { | ||
const cont = this.props.taskDefinition.node.tryFindChild(name); | ||
if (!cont) { | ||
throw new Error(`Overrides mention container with name '${name}', but no such container in task definition`); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this can be dropped in favour of -
taskDefinition.containers.includes(override.containerDefinition)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too, but containers
is a protected property and not public
Co-authored-by: Niranjan Jayakar <nija@amazon.com>
Co-authored-by: Niranjan Jayakar <nija@amazon.com>
… into shivlaks/sfn-ecs-tasks
… defaulting to latest
Wait, launchType is now optional. and if omitted the default capacity provider is used: capacity providers are coming to cloudformation soon. should this change be compatible and not assume launch type is EC2 or Fargate? |
@mb-dev - going from required to optional is not a breaking change. My initial instinct is that we can introduce that change when it's more fleshed out or in a follow-on PR. Is there a use case this would preclude today? In that case, I'd push for implementing it (probably in a follow-up PR as well) |
@mb-dev - just saw that you'd already created #7967 a while back. I'll create a PR to introduce that change. I'd like to keep the scope of this PR contained so we can iterate and keep things moving. I don't believe |
@shivlaks what alarmed me is that the PR makes the definition depend more on launch type than before. Currently no launchType might look like:
If Then again, I realize I am late in commenting - this PR is pretty far along. If you have an idea for a clear syntax that can be introduced in a follow up PR, that will be great. Thanks! |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
That's a fair point, let's continue this conversation in #7967 and get ahead of the potential usability issue / user confusion |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Replacement for the current implementation of
ECS
service integration.Merges state and service integration properties and represents them as a
construct.
The notable differences from the current implementation are:
runTask
with an addedlaunchTarget
requiredproperty where the properties specific to the launch type are specified
ref-via-interface
as we need to useTaskDefinition
because properties that are not known for imported task definitions are required
replacement.
Left all of the unit tests (except fargate platform version which was not
previously honored) and integ test expectations verbatim to ensure that
we have not lost fidelity.
BREAKING CHANGE:
containerName
is not supported as an override anymore and has been replaced bycontainerDefinition
Closes #8610
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license