hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.45k stars 4.53k forks source link

Support for SSH private key auth in azurerm_data_factory_linked_service_sftp #11040

Open dkutetsky opened 3 years ago

dkutetsky commented 3 years ago

Community Note

Description

It will be great to add SSH private key auth ability in the Azure Data Factory Linked SFTP server. For now, we can use only Anonymous and Basic auth. Specific fields and references could be found in the Data Factory SFTP connector docs

New or Affected Resource(s)

azurerm_data_factory_linked_service_sftp

Potential Terraform Configuration

resource "azurerm_data_factory_linked_service_sftp" "sftp" {
  name                = "sftp"
  resource_group_name = "resource-group-name"
  data_factory_name   = "data-factory-name"

  authentication_type = "SshPublicKey"
  host                = "ftp.example.com"
  port                = 22
  username            = "foo"
  pass_phrase          = "pass phrase"

  # option 1: ssh public key content
  ssh_private_key_content      = "ssh-rsa AAAAB3...."

  # option 2: ssh private key file
  ssh_private_key_path      = "/var/ssh/rsa_private_key"
}

References

derekpurdy commented 4 days ago

@dkutetsky I see this issue is farily old and not yet implemented, I just came across it myself.

If I am reading it correctly, it appears supported in the go-azure-sdk (https://github.com/hashicorp/go-azure-sdk/blob/8d014f722092fbb3c0eea5582351d21ee79fbc43/resource-manager/datafactory/2018-06-01/linkedservices/model_sftpserverlinkedservicetypeproperties.go#L19) but it's not yet supported within the schema map for the terraform provider azurerm https://github.com/hashicorp/terraform-provider-azurerm/blob/ed57cfd8acd2f98227d30c407fd71b5df6064dd8/internal/services/datafactory/data_factory_linked_service_sftp_resource.go#L41