|
| 1 | +/* |
| 2 | +Copyright AppsCode Inc. and Contributors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package controller |
| 18 | + |
| 19 | +// This list generated using scripts/ami.sh file and |
| 20 | +// https://cloud-images.ubuntu.com/locator/ec2/ |
| 21 | +var amiIDs = map[string]string{ |
| 22 | + "ap-south-1": "ami-0fc76d1fc60a822e2", |
| 23 | + "eu-north-1": "ami-09619f1544394c186", |
| 24 | + "eu-west-3": "ami-0e7bc13af71a7ace1", |
| 25 | + "eu-west-2": "ami-0ef73863dbddaa97f", |
| 26 | + "eu-west-1": "ami-07e2abe41a3dd4483", |
| 27 | + "ap-northeast-3": "ami-06c6d2fb039aedeb2", |
| 28 | + "ap-northeast-2": "ami-0e73d7a01dba794a4", |
| 29 | + "ap-northeast-1": "ami-07ac8e5b1fefaa9e5", |
| 30 | + "ca-central-1": "ami-0cd354c076a038948", |
| 31 | + "sa-east-1": "ami-07f5d4171b892af81", |
| 32 | + "ap-southeast-1": "ami-09329fa58ea564a19", |
| 33 | + "ap-southeast-2": "ami-0266d373beca3c7fa", |
| 34 | + "eu-central-1": "ami-0b6226e8488760b25", |
| 35 | + "us-east-1": "ami-0111190769c4329ae", |
| 36 | + "us-east-2": "ami-0b00f5183519c196c", |
| 37 | + "us-west-1": "ami-0b1da0df74f3b4b0b", |
| 38 | + "us-west-2": "ami-03ab9db8dada95e36", |
| 39 | + "me-central-1": "ami-0170c48a53a986edc", |
| 40 | + "eu-south-1": "ami-0494d18a3b83a9b91", |
| 41 | + "il-central-1": "ami-079087d4fb0b82225", |
| 42 | + "af-south-1": "ami-01015442638eed255", |
| 43 | + "cn-northwest-1": "ami-00978db6a05d06273", |
| 44 | + "cn-north-1": "ami-0b820a65426833e1f", |
| 45 | + "ap-east-1": "ami-06aacaba45deda8f5", |
| 46 | + "ca-west-1": "ami-0989e7880da01e922", |
| 47 | + "me-south-1": "ami-004a63c72a7208abc", |
| 48 | + "eu-south-2": "ami-0de5f498466655517", |
| 49 | + "eu-central-2": "ami-0868b61eaac7c1688", |
| 50 | + "ap-south-2": "ami-09fd1f9e60e374015", |
| 51 | + "ap-southeast-3": "ami-002fde9f4f8bf8faf", |
| 52 | + "ap-southeast-4": "ami-010a2c002f5940231", |
| 53 | +} |
| 54 | + |
| 55 | +func (r *MachineReconciler) getAMIIDArg() []string { |
| 56 | + args := []string{} |
| 57 | + region := r.machineObj.Spec.Parameters[awsRegionField] |
| 58 | + if amiIDs[region] != "" { |
| 59 | + args = append(args, "--amazonec2-ami", amiIDs[region]) |
| 60 | + } |
| 61 | + |
| 62 | + return args |
| 63 | +} |
0 commit comments