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

feat: adds SSH support + tagging + upgrades ssm-agent 1.0 #13

Merged
merged 5 commits into from
Feb 20, 2024

Conversation

Gowiem
Copy link
Member

@Gowiem Gowiem commented Feb 18, 2024

what

why

  • SSH support was requested in Support Tailscale SSH #10 + it was useful for us on a project when testing Transit Gateways
  • See requested changes in Error: requested tags [tag:prod] are invalid or not permitted #9 regarding the tag the auth key is created with. Tailscale is pretty annoying about "tags" so we want that to be configurable to whatever the consumer created their OAuth client with.
  • More tags on the machine mean the ability to further specify / group machines.
  • Upgrades to the latest ssm-agent module which now will roll the Tailscale instances when new updates are made to the Launch Template

references

@Gowiem Gowiem requested a review from gberenice February 18, 2024 22:14
@Gowiem Gowiem self-assigned this Feb 18, 2024
@Gowiem Gowiem requested a review from a team as a code owner February 18, 2024 22:14
@kevcube
Copy link
Contributor

kevcube commented Feb 19, 2024

@Gowiem Why remove instance_count?

Edit: oh I see now in ssm-agent -- I'll review that first

--authkey=${authkey} \
--hostname=${hostname}
--advertise-routes=${routes} \
--advertise-tags=${tags} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about this change. I assume something could be changed in Tailscale auth/tagging logic, but previously the machine was tagged when authenticated with the pre-authentication Tailnet key, see the comment.
I get why we might want to concat context.tf tags + additional tags provided by a user, but I don't get why we need to add this flag and use different tags for the key and for up command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To recap the conversation we had over a call for history purposes:

  1. We weren't including the primary_tag in this list, which was a mistake on my end. I've now fixed that in a recent push.
  2. We're going to keep this --advertise-tags bit here because it's useful to be explicit since Tailscale is confusing af at times.

@@ -1,3 +1,4 @@
# trunk-ignore-all(trivy/AVD-AWS-0178): We don't need have VPC Flow logs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I was going to update here (and successfully forgot to complete 😑) is to redo the example without referencing to context.tf (maybe worth leaving it commented for the users who utilize this pattern). Do you want me to add this to your branch? Or you'll update it by yourself?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gberenice Hm -- I'm glad you're thinking of this as I always forget to update the example. I think what I'll do is update the readme for the two use-cases: 1) passing primary_tag and 2) passing in context.tf label elements to create the module.this.id

@Gowiem Gowiem requested review from gberenice and kevcube February 19, 2024 18:58
Copy link
Member

@gberenice gberenice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for updating the tags naming in the last iteration - it's definitely easier to understand 👍

@Gowiem Gowiem merged commit fa87d64 into main Feb 20, 2024
@Gowiem Gowiem deleted the feature/support-ssh branch February 20, 2024 20:46
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.

Support Tailscale SSH Error: requested tags [tag:prod] are invalid or not permitted
3 participants