question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws-batch JobDefinition: Support import using 'fromJobDefinitionName'

See original GitHub issue

Currently JobDefinition constructs only supports fromJobDefinitionArn. For using Batch in StepFunctions, we can provide JobDefinition as any one of name, name:revision or ARN (Ref)

Now to import JobDefinition in StepFunctions, we can only use fromJobDefinitionArn which is not flexible since JobDefinitionArn contains the revision as well. This leads to an ARN update after every change in revision (very frequent). The ideal way to handle this would be to import using name instead of the ARN

Hence a method like fromJobDefinitionName would suit this particular use case.

Use Case

Proposed Solution

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ayush987goyalcommented, Apr 12, 2020

@iliapolo What I was trying to refer to in the issue was:

Consider the scenario where the JobDefinition is maintained in a different stack altogether. It has its own lifecycle of code changes and the version is bumped every now and then. We want to use the latest version of the this JobDefinition is another stack for StepFunctions.

To achieve this, let’s say we made a stack export of JobDefinitionArn from the JobDefinition stack and then used it in StepFunctions stack using:

JobDefinition.fromJobDefinitionArn(arn)

Now, when there is a code change and version updates for the JobDefinition, it changes the the ARN (since ARN contains version number). This leads to deployment failure for the JobDefinition stack since it would say the export is currently used in another stack (StepFunctions stack). To resolve this, we would have to remove the reference of that export from the StepFunctions stack and then redeploy. We have to do this for every code change in JobDefinition.

To prevent this issue, StepFunction for Batch supports passing only the JobDefinitionName as well. But this is currently not possible since to import a JobDefinition from one stack to another, it only supports fromJobDefinitionArn. Therefore we would probably need fromJobDefinitionName in Batch.

I hope it was clear.

0reactions
ayush987goyalcommented, Sep 20, 2020

Added a PR https://github.com/aws/aws-cdk/pull/10448 to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::Batch::JobDefinition - AWS CloudFormation
Use the AWS CloudFormation AWS::Batch::JobDefinition resource for Batch. ... For tags with the same name, job tags are given priority over job definitions...
Read more >
aws.batch.JobDefinition - Pulumi
JobDefinition resource with examples, input properties, output properties, ... aws.batch.JobDefinition. Provides a Batch Job Definition resource.
Read more >
AWS::Batch::JobDefinition - Amazon CloudFormation
For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from...
Read more >
aws_batch_job_definition | Resources | hashicorp/aws
Import. Batch Job Definition can be imported using the arn , e.g., $ terraform import aws_batch_job_definition.test arn:aws:batch: ...
Read more >
aws-cdk.aws-batch-alpha 2.56.0a0 - PyPI
All batch jobs are processed within a compute environment, which uses ... To import an existing batch job definition from its name, call...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found