1 package org.kuali.common.devops.aws;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import org.kuali.common.aws.model.AwsAccount;
7 import org.kuali.common.util.Assert;
8
9 public enum Accounts {
10
11 FOUNDATION("foundation", "U2FsdGVkX1/FDB8m4fjGCedORbbrwamkL5froZVyXwI=", "The Kuali Foundation Inc."),
12 STUDENT("student", "U2FsdGVkX1/mw7uS4Rxy9xMoPqYCieZGcCIn34k6yf8=", "Kuali Student"),
13 RICE("rice", "U2FsdGVkX1/oWHrYsZP9jwQOV1PLWY5VE2gg75KV0wE=", "Kuali Rice"),
14 OLE("ole", "U2FsdGVkX19s1I/9y0vHVLzm5VeSHwu0U8qmI2Cjva0=", "Kuali OLE");
15
16 private final AwsAccount account;
17
18 private Accounts(String name, String accountNumber, String description) {
19 Assert.noBlanks(name, accountNumber, description);
20 this.account = new AwsAccount.Builder(name, accountNumber).description(description).build();
21 }
22
23 public AwsAccount getAccount() {
24 return account;
25 }
26
27 public static Map<String, AwsAccount> asMap() {
28 Map<String, AwsAccount> map = new HashMap<String, AwsAccount>();
29 for (Accounts accounts : values()) {
30 AwsAccount account = accounts.getAccount();
31 map.put(account.getName(), account);
32 }
33 return map;
34 }
35 }