Skip to content

aws-batch-alpha: EcsJobDefinition.jobDefinitionName returns the ARN #25197

@gael-ft

Description

@gael-ft

Describe the bug

In EcsJobDefinition, looks like at the end of the constructor you override the field "jobDefinitionName" with the CfnJobDefinition ref.
Meaning if we try to access it later, we'll get a different value of what it has been created with.

Expected Behavior

EcsJobDefinition.jobDefinitionName to return the CfnJobDefinition.jobDefinitionName and not the ARN of the resource

Current Behavior

EcsJobDefinition.jobDefinitionNam returns the ARN (+ revision)

Reproduction Steps

const jobDef = new EcsJobDefinition(this, 'Resource', {
  // ...
  jobDefinitionName: 'toto'
  //...
});

jobDef.jobDefinitionName; // a Token which resolves to arn:aws:...:job-definition:toto:1

Possible Solution

Just remove this.jobDefinitionName = this.getResourceNameAttribute(resource.ref);

github link

Additional Information/Context

No response

CDK CLI Version

2.74.0 (build 70e2a33)

Framework Version

No response

Node.js Version

v16.13.0

OS

MacOS

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-batchRelated to AWS BatchbugThis issue is a bug.effort/smallSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions