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

azurerm_data_factory_linked_service_sftp: support for hostkey related properties #11825

Merged
merged 4 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ func resourceDataFactoryLinkedServiceSFTP() *schema.Resource {
},
},

"skip_host_key_validation": {
Type: schema.TypeBool,
Optional: true,
},

"host_key_fingerprint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringIsNotEmpty,
},

"annotations": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -164,6 +175,8 @@ func resourceDataFactoryLinkedServiceSFTPCreateUpdate(d *schema.ResourceData, me
Password: &passwordSecureString,
}

sftpProperties.SkipHostKeyValidation = d.Get("skip_host_key_validation").(bool)
sftpProperties.HostKeyFingerprint = d.Get("host_key_fingerprint").(string)
description := d.Get("description").(string)

sftpLinkedService := &datafactory.SftpServerLinkedService{
Expand Down Expand Up @@ -264,6 +277,16 @@ func resourceDataFactoryLinkedServiceSFTPRead(d *schema.ResourceData, meta inter
}
}

if props := sftp.SftpServerLinkedServiceTypeProperties; props != nil {
if skipHostKeyValidation := props.SkipHostKeyValidation; skipHostKeyValidation != nil {
d.Set("skip_host_key_validation", skipHostKeyValidation.(bool))
}

if hostKeyFingerprint := props.HostKeyFingerprint; hostKeyFingerprint != nil {
d.Set("host_key_fingerprint", hostKeyFingerprint)
}
}

return nil
}

Expand Down
4 changes: 4 additions & 0 deletions website/docs/r/data_factory_linked_service_sftp.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ The following supported arguments are specific to SFTP Linked Service:

* `password` - (Required) Password to logon to the SFTP Server for Basic Authentication.

* `host_key_fingerprint` - (Optional) The host key fingerprint of the SFTP server.

* `skip_host_key_validation` - (Optional) Whether to validate host key fingerprint while connecting. If set to `false`, `host_key_fingerprint` must also be set.

## Attributes Reference

The following attributes are exported:
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/static_site.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ Static Web Apps can be imported using the `resource id`, e.g.

```shell
terraform import azurerm_static_site.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1
```
```