File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 ===
151151aws 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 ===
You can’t perform that action at this time.
0 commit comments