Skip to content

Commit a8d2418

Browse files
committed
Improve Cfn output
1 parent 9e04891 commit a8d2418

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

benchmarks/cdk/lib/cdk-stack.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ EOF`,
141141
instances.push(instance);
142142
}
143143

144-
const firstInstance = instances[0]?.instanceId
145144
// Output Session Manager commands for all instances
146145
new CfnOutput(this, 'ConnectCommands', {
147-
value: `\n
148-
export INSTANCE_ID=${firstInstance}
146+
value: `
147+
# === select one instance to connect to ===
148+
${instances.map(_ => `export INSTANCE_ID=${_.instanceId}`).join("\n")}
149149
150-
# === port forward the HTTP ===
150+
# === port forward the HTTP endpoint ===
151151
aws ssm start-session --target $INSTANCE_ID --document-name AWS-StartPortForwardingSession --parameters "portNumber=9000,localPortNumber=9000"
152152
153153
# === open a sh session in the remote machine ===

0 commit comments

Comments
 (0)