// Copyright © 2020 Banzai Cloud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package eks

// AMIs taken form https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
// nolint: gochecknoglobals
var defaultImages = ImageSelectors{
	KubernetesVersionImageSelector{ // Kubernetes Version 1.21
		Constraint: mustConstraint("1.21"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0e55038b16719eb0b",
			"ap-northeast-2": "ami-014ca7719d6166f28",
			"ap-northeast-3": "ami-0c8243269e3dd7ac0",
			"ap-southeast-1": "ami-02c432d96f51e5832",
			"ap-southeast-2": "ami-04cd06c84c2cee4c4",
			"ap-south-1":     "ami-09a3ebc18faf67c69",
			"ca-central-1":   "ami-05bfc70641adb9529",
			"eu-central-1":   "ami-08c86de312838cfb6",
			"eu-north-1":     "ami-04cded4b4f0c755e0",
			"eu-west-1":      "ami-08850ac468211be43",
			"eu-west-2":      "ami-0e40b85f2046a3ec9",
			"eu-west-3":      "ami-0fd6fcfb92295df16",
			"sa-east-1":      "ami-02c55b95a1b7d815d",
			"us-east-1":      "ami-065e0db5b710c2eae",
			"us-east-2":      "ami-0136f2e4cb92702e4",
			"us-west-1":      "ami-09338de954b9db016",
			"us-west-2":      "ami-02ff2f92f13947cbf",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.22
		Constraint: mustConstraint("1.22"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-04793106ad0d79fbd",
			"ap-northeast-2": "ami-0171653eda904c279",
			"ap-northeast-3": "ami-0e8ce20909593e5ce",
			"ap-southeast-1": "ami-0c94b5eaf8fe499cb",
			"ap-southeast-2": "ami-040ec9839830d8c16",
			"ap-south-1":     "ami-054f6aa46bb004895",
			"ca-central-1":   "ami-0bf569ba0b3c2b378",
			"eu-central-1":   "ami-064e78680931e0410",
			"eu-north-1":     "ami-0fe48a55ae9329d25",
			"eu-west-1":      "ami-0d03a7d6c90136f2d",
			"eu-west-2":      "ami-07cde542b7df60c27",
			"eu-west-3":      "ami-0f513d07d2f4c8f52",
			"sa-east-1":      "ami-0df23421106149a45",
			"us-east-1":      "ami-07e6147adfae7f7b3",
			"us-east-2":      "ami-03a2890313006791d",
			"us-west-1":      "ami-083987c922ff0a959",
			"us-west-2":      "ami-09e699c6b8fc5a5ad",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.23
		Constraint: mustConstraint("1.23"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0db453df658d2e5a2",
			"ap-northeast-2": "ami-0d35aabb05c2cedb4",
			"ap-northeast-3": "ami-0f0a87aeda9a6efdd",
			"ap-southeast-1": "ami-095096d807a38046c",
			"ap-southeast-2": "ami-06eb8d7d0eb5ee68e",
			"ap-south-1":     "ami-0379619c3785c4c5d",
			"ca-central-1":   "ami-015a6cf6707c0106b",
			"eu-central-1":   "ami-015882f8fa6c62b02",
			"eu-north-1":     "ami-0c03ed1913e6c3d59",
			"eu-west-1":      "ami-0de933c15c9b49fb5",
			"eu-west-2":      "ami-089ae1775d322e3dc",
			"eu-west-3":      "ami-04ff3788958603d77",
			"sa-east-1":      "ami-0cf7e538c86a94ecb",
			"us-east-1":      "ami-0c9424a408e18bcc9",
			"us-east-2":      "ami-0fcd72f3118e0dd88",
			"us-west-1":      "ami-0109642eee1718e95",
			"us-west-2":      "ami-043ae9e91af48f40a",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.24
		Constraint: mustConstraint("1.24"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0598f79bef5beea67",
			"ap-northeast-2": "ami-0cf0feb43fac2c960",
			"ap-northeast-3": "ami-01892ec4f8e3f8410",
			"ap-southeast-1": "ami-01bb732da5029d896",
			"ap-southeast-2": "ami-0a82b187cbc547a5a",
			"ap-south-1":     "ami-0e48b4b0d884bb96d",
			"ca-central-1":   "ami-006896cca61b2f43e",
			"eu-central-1":   "ami-0b91bb7bbae0d0c6e",
			"eu-north-1":     "ami-0d611b43b3cb42be9",
			"eu-west-1":      "ami-0209251d863e91768",
			"eu-west-2":      "ami-0c5a6a57a98e2c797",
			"eu-west-3":      "ami-036fb586333095621",
			"sa-east-1":      "ami-014dc0e5bc180d1cf",
			"us-east-1":      "ami-0c84934009677b6d5",
			"us-east-2":      "ami-0f49ec39b0f6fff05",
			"us-west-1":      "ami-0443329c7502ec56d",
			"us-west-2":      "ami-0aa47045fd54e61cd",
		},
	},
}

// GPU accelerated AMIs taken form https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
// nolint: gochecknoglobals
var defaultAcceleratedImages = ImageSelectors{
	KubernetesVersionImageSelector{ // Kubernetes Version 1.21
		Constraint: mustConstraint("1.21"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0e05827c08fb47615",
			"ap-northeast-2": "ami-0f7af492291e5ce0a",
			"ap-northeast-3": "ami-04b97c0ee777c0712",
			"ap-southeast-1": "ami-0c7a8bfbf8cfce115",
			"ap-southeast-2": "ami-03109368073d20b1f",
			"ap-south-1":     "ami-0b5dafca58cec47a5",
			"ca-central-1":   "ami-038071d91cf3bc9d8",
			"eu-central-1":   "ami-072cb5ca855bff5eb",
			"eu-north-1":     "ami-06e4e607dbbf2a81b",
			"eu-west-1":      "ami-0b22e7694a125d933",
			"eu-west-2":      "ami-0760c14dddefc96f1",
			"eu-west-3":      "ami-0abf4a494bb2944a2",
			"sa-east-1":      "ami-0b88f4b7b01307f15",
			"us-east-1":      "ami-00e0a485932542546",
			"us-east-2":      "ami-04b7146439000fb74",
			"us-west-1":      "ami-0932869eeb80ad7b7",
			"us-west-2":      "ami-04f7c925030d86d54",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.22
		Constraint: mustConstraint("1.22"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-09da133fbf2b6c1d0",
			"ap-northeast-2": "ami-00fe81929311464b7",
			"ap-northeast-3": "ami-05d114f0779a59c23",
			"ap-southeast-1": "ami-088db2989606d80d6",
			"ap-southeast-2": "ami-06731232e140e9e45",
			"ap-south-1":     "ami-0152523ba9253eed6",
			"ca-central-1":   "ami-0f6684d38c436c573",
			"eu-central-1":   "ami-08d36816e4c326287",
			"eu-north-1":     "ami-08d9899e610678717",
			"eu-west-1":      "ami-087c43dc81077be35",
			"eu-west-2":      "ami-02925bdc95544b3b1",
			"eu-west-3":      "ami-0660e4f0cd4e1ae39",
			"sa-east-1":      "ami-0f372e68a9d88c552",
			"us-east-1":      "ami-0a6876a592b3b14ef",
			"us-east-2":      "ami-042ea78c74c0a72b4",
			"us-west-1":      "ami-01f256ec988701223",
			"us-west-2":      "ami-00656e2591afbbab3",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.23
		Constraint: mustConstraint("1.23"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0cbd81d5220146dd4",
			"ap-northeast-2": "ami-0079645a5621f2cc6",
			"ap-northeast-3": "ami-0726aa849ffc7a70e",
			"ap-southeast-1": "ami-01ffad15a67686321",
			"ap-southeast-2": "ami-07ea3ff14cecbebb3",
			"ap-south-1":     "ami-0762f3fafab6b8796",
			"ca-central-1":   "ami-0013225e9d23fc8f1",
			"eu-central-1":   "ami-0fb71164235a4b06e",
			"eu-north-1":     "ami-0b9ba219d7f55fdd6",
			"eu-west-1":      "ami-0733de5edd0653735",
			"eu-west-2":      "ami-0aea80965a964ee3e",
			"eu-west-3":      "ami-00f74d7d08b2f15c8",
			"sa-east-1":      "ami-09f0abd9dd3d51534",
			"us-east-1":      "ami-0ec05bbcd751ab0e6",
			"us-east-2":      "ami-02d762e0d49015a77",
			"us-west-1":      "ami-08e2b444e2f03c7af",
			"us-west-2":      "ami-0f7f7ced0aaba64e9",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.24
		Constraint: mustConstraint("1.24"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-00f4f166da55f0d6e",
			"ap-northeast-2": "ami-09d5c8d61b9e87739",
			"ap-northeast-3": "ami-0df16ab334e210b7f",
			"ap-southeast-1": "ami-03565892f98868e7f",
			"ap-southeast-2": "ami-0be03be77705ef214",
			"ap-south-1":     "ami-05a2d2f30a2d1c89b",
			"ca-central-1":   "ami-03b39843711e6ba27",
			"eu-central-1":   "ami-0cbe40e9c0fbc96ec",
			"eu-north-1":     "ami-0e1ec1bcdd8858c28",
			"eu-west-1":      "ami-0d713cb60cdc3abe3",
			"eu-west-2":      "ami-09776d0da242e5714",
			"eu-west-3":      "ami-03959c46633cbdde6",
			"sa-east-1":      "ami-08b1660c57d19d85c",
			"us-east-1":      "ami-0033719b7cbee477f",
			"us-east-2":      "ami-04751d33e844b6371",
			"us-west-1":      "ami-0b8e84e35e27d750c",
			"us-west-2":      "ami-0f1ef4730f89a72b0",
		},
	},
}

// ARM architecture AMIs taken form https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
// nolint: gochecknoglobals
var defaultARMImages = ImageSelectors{
	KubernetesVersionImageSelector{ // Kubernetes Version 1.21
		Constraint: mustConstraint("1.21"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0011282ff88fcb3ee",
			"ap-northeast-2": "ami-0d080756f3f28067b",
			"ap-northeast-3": "ami-0df08c6c0c1d27b9a",
			"ap-southeast-1": "ami-039ca7d6311109bc6",
			"ap-southeast-2": "ami-0ce570c56abd85e49",
			"ap-south-1":     "ami-0993675dda12b30a9",
			"ca-central-1":   "ami-0149f03bb43b84bf5",
			"eu-central-1":   "ami-0ea0491892b9626e2",
			"eu-north-1":     "ami-043a51460f1f24ac6",
			"eu-west-1":      "ami-025630de4eb054426",
			"eu-west-2":      "ami-01762bc080020e5c3",
			"eu-west-3":      "ami-089accf9f98a14316",
			"sa-east-1":      "ami-051bdb1bf120eeb85",
			"us-east-1":      "ami-0aa7fc304982a8e17",
			"us-east-2":      "ami-08bc195cdbeca3d16",
			"us-west-1":      "ami-0af27f9f6477ec225",
			"us-west-2":      "ami-0feb00ba334177fc3",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.22
		Constraint: mustConstraint("1.22"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-017bdd5d1cbb1c422",
			"ap-northeast-2": "ami-05ce7912d93b1a676",
			"ap-northeast-3": "ami-04b022cfbcb217ad6",
			"ap-southeast-1": "ami-06eda305638eba7ff",
			"ap-southeast-2": "ami-021be7617fcd49010",
			"ap-south-1":     "ami-0e270c8513a9e05de",
			"ca-central-1":   "ami-01c8d7da7f54d439e",
			"eu-central-1":   "ami-0c036d1a979c3f3ae",
			"eu-north-1":     "ami-07046cf45d7a67b41",
			"eu-west-1":      "ami-0fbb195c4d25f27d8",
			"eu-west-2":      "ami-0984bf10c5a8e83ad",
			"eu-west-3":      "ami-0a1aeaa4cac901d48",
			"sa-east-1":      "ami-00c600fe0a516fe5e",
			"us-east-1":      "ami-0d050320dfd5d1be2",
			"us-east-2":      "ami-0456615c133513273",
			"us-west-1":      "ami-029541de66eccc48d",
			"us-west-2":      "ami-0853950ed6c7c947d",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.23
		Constraint: mustConstraint("1.23"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-04abf0899d949a063",
			"ap-northeast-2": "ami-031edd8e214914974",
			"ap-northeast-3": "ami-0ac15e3dbf6b47041",
			"ap-southeast-1": "ami-092d7876f94d299fb",
			"ap-southeast-2": "ami-012fd675271597a71",
			"ap-south-1":     "ami-09f98597c491fcdf1",
			"ca-central-1":   "ami-0964382c4d7b33ec3",
			"eu-central-1":   "ami-05a157aac9c1ee1d7",
			"eu-north-1":     "ami-077420d4538739c5e",
			"eu-west-1":      "ami-0a00c264a2b5c4435",
			"eu-west-2":      "ami-000f38e0d88c3d14c",
			"eu-west-3":      "ami-0d84261fa19455520",
			"sa-east-1":      "ami-05d30dfd1ff92bd5e",
			"us-east-1":      "ami-0ec45ac341d2e44b9",
			"us-east-2":      "ami-08577b6b086f201e0",
			"us-west-1":      "ami-084ad38ad78a6055e",
			"us-west-2":      "ami-0fa3a16bac5b18ce8",
		},
	},
	KubernetesVersionImageSelector{ // Kubernetes Version 1.24
		Constraint: mustConstraint("1.24"),
		ImageSelector: RegionMapImageSelector{
			"ap-northeast-1": "ami-0c02ba2d7aa6a5b09",
			"ap-northeast-2": "ami-088ffb72f1424f60e",
			"ap-northeast-3": "ami-0b331f96027aea028",
			"ap-southeast-1": "ami-02936ac40a99a1c40",
			"ap-southeast-2": "ami-0bb9bf591dd5a9754",
			"ap-south-1":     "ami-0a9db93b3b4f2e09f",
			"ca-central-1":   "ami-047f8e0594b9f742a",
			"eu-central-1":   "ami-0bda0bcbd565df138",
			"eu-north-1":     "ami-0bea0bfc968d924b5",
			"eu-west-1":      "ami-0f2d9de75f8d1f1e9",
			"eu-west-2":      "ami-0ea2dd5fe1bdc0f29",
			"eu-west-3":      "ami-0eefd72a86005a408",
			"sa-east-1":      "ami-0d10abee5ba9c3fb7",
			"us-east-1":      "ami-0ec7db14333294144",
			"us-east-2":      "ami-0597d54bccfbb93aa",
			"us-west-1":      "ami-09bbeccf9cea6848c",
			"us-west-2":      "ami-02565d6b881653ea7",
		},
	},
}
