Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for AWS SSM connection #232

Open
nandac opened this issue Feb 5, 2024 · 0 comments
Open

Support for AWS SSM connection #232

nandac opened this issue Feb 5, 2024 · 0 comments

Comments

@nandac
Copy link

nandac commented Feb 5, 2024

Dear Folks,

I am using EC2 driver and want to use AWS SSM to connect to the instance as SSH is closed off on the images we use at our organization.

I believe the relevant code is here:

def ansible_connection_options(self, instance_name):

which only supports SSH and WinRM.

I can add another if statement here like this in the code but not sure this is the right approach

if conn_opts.get("ansible_connection") == "community.aws.aws_ssm":
    conn_opts["connection"] = "community.aws.aws_ssm"
    conn_opts["user"] = "ssm-user"

Secondly, the ansible_connection_options function is called in login_cmd_template function where it looks like a command to be run in a terminal is returned.

Does this mean that I should return an AWS CLI SSM command from this function to enable login. This poses some issues because a profile and region may need to be sent in to enable access through SSM.

I hope someone can guide me in this regard and I am happy to contribute this code once I have got it working.

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

No branches or pull requests

1 participant