Trouble with the creation of direct connect resource creation

Hello there,
With regards to DX connection creation in AWS provider, t here seems to a tricky part in this resource:

resource "aws_dx_connection" "hoge" {
name = "tf-dx-connection"
bandwidth = "1Gbps"
location = "EqDC2"
}
The parameter “location” uses a location code which could be fetched from “describelocations” API whose output could be as follows :
[
{
"region": "us-west-2",
"locations": [
{
"locationCode" = "EqSe2-EQ",
"locationName" = "Westin Building Exchange, Seattle, WA Equinix, SE2, Seattle, WA"
},
{
"locationCode": "EqSe2-EQ",
"locationName": "Westin Building Exchange, Seattle, WA Westin Building Exchange - SEA10 - Main FMMR, Seattle, WA"
},
{
"locationCode": "EqSe2-EQ",
"locationName": "Switch SUPERNAP 8, Las Vegas, NV"
},
{
"locationCode": "EqSe2-EQ",
"locationName": "EdgeConnex, Hillsboro, OR"
},

Now, if you could see the location code remains the same and differential part which is location name cannot be passed as a complete string and not even as a map variable… It just takes the “locationcode” and executes it sequential order… So… if I want to get the third location, it is getting deployed only in the third go… how could this be resolved without having to deploy the code multiple times?

Has anyone came across the same scenario and have a tweak for the same? Thanks in advance.