@@ -147,24 +147,28 @@ data "netapp-ontap_networking_ip_interfaces_data_source" "dr_intercluster_lifs"
147147 }
148148}
149149
150+ # For now let's try to get the source and destination IC LIFs via AWS TF provider.
151+ data "aws_fsx_ontap_file_system" "source_fsxn" {
152+ id = var. prime_fsxid
153+ }
150154
151155# Now udse the LIF names and IP addresses to peer the clusters
152156
153- # resource "netapp-ontap_cluster_peers_resource" "cluster_peer" {
154- # cx_profile_name = "primary_clus" # Source cluster profile
155- # peer_cx_profile_name = "dr_clus" # Destination (peer) cluster profile
156- #
157- # remote = {
158- # # Destination cluster (DR) intercluster LIF IPs
159- # ip_addresses = [for lif in data.netapp-ontap_networking_ip_interfaces_data_source.dr_intercluster_lifs.ip_interfaces : lif.ip_address]
160- # }
157+ resource "netapp-ontap_cluster_peers_resource" "cluster_peer" {
158+ cx_profile_name = " primary_clus" # Source cluster profile
159+ peer_cx_profile_name = " dr_clus" # Destination (peer) cluster profile
161160
162- # source_details = {
163- # Source cluster (primary) intercluster LIF IPs
164- # ip_addresses = [for lif in data.netapp-ontap_networking_ip_interfaces_data_source.primary_intercluster_lifs.ip_interfaces : lif.ip_address]
165- # }
161+ remote = {
162+ # Destination cluster (DR) intercluster LIF IPs
163+ ip_addresses = aws_fsx_ontap_file_system.terraform- fsxn.endpoints[0 ].intercluster[0 ].ip_addresses
164+ }
165+
166+ source_details = {
167+ # Source cluster (primary) intercluster LIF IPs
168+ ip_addresses = data.aws_fsx_ontap_file_system.source_fsxn.endpoints[0 ].intercluster[0 ].ip_addresses
169+ }
166170
167171 # Optional: Add authentication, passphrase or any other required settings
168172 # passphrase = var.cluster_peer_passphrase # Optional, if you use passphrase for peering
169- # peer_applications = ["snapmirror"]
170- # }
173+ peer_applications = [" snapmirror" ]
174+ }
0 commit comments