Skip to content

Commit

Permalink
fix(stepfunctions-tasks): cluster creation fails with unresolved rele…
Browse files Browse the repository at this point in the history
…ase 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*
  • Loading branch information
otaviomacedo authored Jan 26, 2022
1 parent 77488cf commit 9940952
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class EmrCreateCluster extends sfn.TaskStateBase {

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

if (this.props.releaseLabel !== undefined) {
if (this.props.releaseLabel !== undefined && !cdk.Token.isUnresolved(this.props.releaseLabel)) {
this.validateReleaseLabel(this.props.releaseLabel);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ beforeEach(() => {
);
});

test('Create Cluster with an unresolved release label', () => {
new EmrCreateCluster(stack, 'Task', {
instances: {},
name: 'Cluster',
releaseLabel: cdk.Token.asString({}),
});
});

test('Create Cluster with FIRE_AND_FORGET integrationPattern', () => {
// WHEN
const task = new EmrCreateCluster(stack, 'Task', {
Expand Down

0 comments on commit 9940952

Please sign in to comment.