Skip to content

Commit 9940952

Browse files
authored
fix(stepfunctions-tasks): cluster creation fails with unresolved release labels (#18288)
Skipping validation in case the `props.releaseLabel` is unresolved. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 77488cf commit 9940952

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/@aws-cdk/aws-stepfunctions-tasks/lib/emr/emr-create-cluster.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class EmrCreateCluster extends sfn.TaskStateBase {
202202

203203
this.taskPolicies = this.createPolicyStatements(this._serviceRole, this._clusterRole, this._autoScalingRole);
204204

205-
if (this.props.releaseLabel !== undefined) {
205+
if (this.props.releaseLabel !== undefined && !cdk.Token.isUnresolved(this.props.releaseLabel)) {
206206
this.validateReleaseLabel(this.props.releaseLabel);
207207
}
208208

packages/@aws-cdk/aws-stepfunctions-tasks/test/emr/emr-create-cluster.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ beforeEach(() => {
3434
);
3535
});
3636

37+
test('Create Cluster with an unresolved release label', () => {
38+
new EmrCreateCluster(stack, 'Task', {
39+
instances: {},
40+
name: 'Cluster',
41+
releaseLabel: cdk.Token.asString({}),
42+
});
43+
});
44+
3745
test('Create Cluster with FIRE_AND_FORGET integrationPattern', () => {
3846
// WHEN
3947
const task = new EmrCreateCluster(stack, 'Task', {

0 commit comments

Comments
 (0)