-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[New Resource]: AWS SSM tunnel #40249
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
This would be amazing. I wrote a custom provider to do exactly this, but there are some edge cases where a keepalive resource is needed to keep the tunnel alive until resources are modified. Also it doesn't work well when removing resources. See: https://registry.terraform.io/providers/ComplyCo/aws-ssm-tunnels/latest @dm3ch as a note, I use this to manage resources in RDS and EKS in a private VPC. |
@sdemjanenko Thank you I would take a look. To be honest I was going to write provider myself if AWS provider wouldn't have such feature, but I'm happy that it's not needed, cause someone already done this |
@sdemjanenko After a quick look I see that you are using standard resources and not ephemeral ones, isn't it? As far as I understand the conversion of resources to ephemeral (with TF 1.10) would allow to bind to lifecycle hooks that would allow it to use during apply, plan, destroy without any issues. If I right understood initial discussion in hashicorp/terraform#8367 |
@dm3ch yes, i am planning on switching to ephemeral once 1.10 hits GA. I am not certain that the lifecycle will be properly tracked (allowing removal of the keepalive resources). That is something I need to test. From my cursory understanding of ephemeral resources, I believe it will only allow me to get rid of the UUID trick I do to force the tunnel to get set up in the Apply step (https://github.com/ComplyCo/terraform-provider-aws-ssm-tunnels/blob/main/internal/provider/remote_tunnel_resource.go#L192). But this is something I plan on testing to see how much it can simplify and improve the developer experience of the provider. |
Description
In some cases you may need to connect terraform provider to for example database that are unavailable from the machine running terraform. AWS have aws ssm port-forwarding as a default proposed method to access resources that are only available via private network.
As maintainer wrote it of comunnity-maintained PostgreSQL provider it would be not effective to make postgres provider to work with cloud specific tunneling solutions for each cloud - cyrilgdn/terraform-provider-postgresql#81 (comment). Cause this functionality can be reused between different providers.
In terraform issue hashicorp/terraform#8367 (comment) itself it was proposed to create separate ephemeral resource for such tunnel. So I propose to consider adding such ephemeral resource to handle aws ssm tunnel creation and later use it in other providers configuration
Requested Resource(s) and/or Data Source(s)
Potential Terraform Configuration
The text was updated successfully, but these errors were encountered: