Skip to content

Improve SSM Session Manager: Add SSH key injection and optimize code#654

Open
mayankgupta57 wants to merge 3 commits intotest-kitchen:mainfrom
mayankgupta57:ssm-session-manager-improvements
Open

Improve SSM Session Manager: Add SSH key injection and optimize code#654
mayankgupta57 wants to merge 3 commits intotest-kitchen:mainfrom
mayankgupta57:ssm-session-manager-improvements

Conversation

@mayankgupta57
Copy link
Contributor

@mayankgupta57 mayankgupta57 commented Jan 23, 2026

  • Add automatic SSH key injection via SSM before each connection
  • Reuse existing code patterns from Instance Connect implementation
  • Create reusable SSM command execution helper method
  • Optimize SSH key injection with duplicate key prevention
  • Update hostname to localhost when using SSM proxy command
  • Update documentation to reflect SSH key injection functionality

Description

Please describe what this change achieves

Issues Resolved

The current implementation of ssm session manager is incomplete, it's not working, the connection get struck while using ssm:

exec bundle exec kitchen login --log-level=debug
D      [AWS SSM Session Manager] Setting up SSM Session Manager overrides
D      Policyfile found at /Users/mayankgu/git_corp/di_infra/cookbook-prometheus/Policyfile.rb, using Policyfile to resolve cookbook dependencies
       [AWS SSM Session Manager] Using proxy command: aws ssm start-session --target i-062f944081df579ff --region us-west-2 --profile oz-dev
D      Login command: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=VERBOSE -o ProxyCommand=aws ssm start-session --target i-062f944081df579ff --region us-west-2 --profile abcd -p 22 root@179.22.130.5 (Options: {})

Type of Change

Our release process assumes you are using Conventional Commit messages.

The most important prefixes you should have in mind are:

  • _fix_: which represents bug fixes, and correlates to a SemVer patch.
  • _feat_: which represents a new feature, and correlates to a SemVer minor.
  • _feat!_:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a major version change.

If you have not included a conventional commit message this can be fixed on merge.

Check List

Mayank Gupta added 3 commits January 23, 2026 11:54
- Add automatic SSH key injection via SSM before each connection
- Reuse existing code patterns from Instance Connect implementation
- Create reusable SSM command execution helper method
- Optimize SSH key injection with duplicate key prevention
- Update hostname to localhost when using SSM proxy command
- Update documentation to reflect SSH key injection functionality
- Add tests for SSH key injection functionality
- Add tests for SSM command execution helper
- Add tests for hostname override to localhost
- Add tests for InSpec override with SSH key injection
- Update existing SSM tests to include new functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant