AWS FSx for ONTAP is deployed within an AWS VPC and the management LIFs are only accessible via private IP addresses (and the hostnames for these LIFs are only resolvable via private DNS) from within the VPC. If attempting to use the ONTAP provider from a local machine or from outside of the VPC, there's no means for the underlying REST calls of the ONTAP Provider to reach the management LIFs.
Interested to hear how others may approach this. For now, I'm manually setting up an SSH tunnel with port forwarding through a small EC2 instance within the same VPC as my FSx for ONTAP filesystem:
ssh -i <private_key_file> ec2-user@<instance_hostname> -L 8443:<management_LIF_hostname>:443 -N
Then using the following configuration for the ONTAP provider:
provider "netapp-ontap" {
# A connection profile defines how to interface with an ONTAP cluster or svm.
# At least one is required.
connection_profiles = [
{
name = aws_fsx_ontap_file_system.fsxontap01.id
hostname = "localhost:8443"
username = "fsxadmin"
password = var.fsxadmin_password
validate_certs = false
}
]
}