Skip to content

Commit ab67410

Browse files
Fix SSM Runbook link generation to parse version correctly (#1571)
<!-- Ensure the title clearly reflects what was changed. Provide a clear and concise description of the changes made. The PR should only contain the changes related to the issue, and no other unrelated changes. --> Fixes OPS-2931. This is how aws generated link looks like <img width="1331" height="140" alt="image" src="https://github.com/user-attachments/assets/456f312e-eb25-4454-8212-a254de59ad65" />
1 parent 3885cbe commit ab67410

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/blocks/aws/test/ssm/ssm-generate-runbook-link-action.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('ssmGenerateRunbookLinkAction.run', () => {
5454
const result = (await ssmGenerateRunbookLinkAction.run(ctx)) as RunResult;
5555

5656
expect(result.link).toBe(
57-
'https://ap-south-1.console.aws.amazon.com/systems-manager/automation/execute/My-Runbook?region=ap-south-1&documentVersion=3',
57+
'https://ap-south-1.console.aws.amazon.com/systems-manager/automation/execute/My-Runbook?region=ap-south-1#documentVersion=3',
5858
);
5959
});
6060

packages/openops/src/lib/aws/ssm/generate-ssm-runbook-execution-link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const generateBaseSSMRunbookExecutionLink = (
3232
return `https://${region}.console.aws.amazon.com/systems-manager/automation/execute/${encodeURIComponent(
3333
runbookName,
3434
)}?region=${encodeURIComponent(region)}${
35-
version ? `&documentVersion=${encodeURIComponent(version)}` : ''
35+
version ? `#documentVersion=${encodeURIComponent(version)}` : ''
3636
}`;
3737
};
3838

packages/openops/test/aws/ssm/generate-ssm-runbook-execution-link.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('generateBaseSSMRunbookExecutionLink', () => {
1212
);
1313

1414
expect(url).toBe(
15-
'https://us-east-1.console.aws.amazon.com/systems-manager/automation/execute/AWS-RestartEC2Instance?region=us-east-1&documentVersion=1',
15+
'https://us-east-1.console.aws.amazon.com/systems-manager/automation/execute/AWS-RestartEC2Instance?region=us-east-1#documentVersion=1',
1616
);
1717
});
1818

@@ -36,7 +36,7 @@ describe('generateBaseSSMRunbookExecutionLink', () => {
3636
);
3737

3838
expect(url).toBe(
39-
'https://eu-west-1.console.aws.amazon.com/systems-manager/automation/execute/My%20Runbook%2FName?region=eu-west-1&documentVersion=3%24beta',
39+
'https://eu-west-1.console.aws.amazon.com/systems-manager/automation/execute/My%20Runbook%2FName?region=eu-west-1#documentVersion=3%24beta',
4040
);
4141
});
4242
});

0 commit comments

Comments
 (0)