import * as region_info from "@aws-cdk/region-info";

export const COST_DISTRIBUTION_TAG_KEY = "Project";
export const SLACK_WORKSPACE_ID = "TMLL5FCBS";

export const officeIps = [
  "109.236.12.74/32", // shinjuku
  "198.144.175.187/32", // shinjuku sub
  "109.236.12.82/32", // toranomonn Hills
  "116.67.153.55/32", // toranomonn Hills sub
  "160.86.254.201/32", // osaka, nagoya, hiroshima, fukuoka, shinjuku sub2, toranomonn Hills sub2
];

// see https://whipro.service-now.com/sp?id=kb_article_view&sysparm_article=KB0010670&sys_kb_id=8d8a7aad1b4468d062c4a9f6ec4bcb2a&spa=1
export const netskopeIps = [
  "158.95.54.196/32",
  "158.95.54.197/32",
  "158.95.55.212/32",
  "158.95.55.213/32",
  "158.95.56.189/32",
  "158.95.56.190/32",
  "158.95.130.80/32",
  "158.95.130.81/32",
];

type User = {
  userName: string;
  mailAddress: string;
  cidrs: string[];
};

export const operators: User[] = [
  {
    userName: "kato_f",
    mailAddress: "kato_f@works-hi.co.jp",
    cidrs: [],
  },
  {
    userName: "yoshida_h",
    mailAddress: "yoshida_h@works-hi.co.jp",
    cidrs: ["219.104.103.58/32"],
  },
  {
    userName: "sato_c",
    mailAddress: "sato_c@works-hi.co.jp",
    cidrs: ["124.18.77.228/32"],
  },
  {
    userName: "hara_io",
    mailAddress: "hara_io@works-hi.co.jp",
    cidrs: ["223.133.134.87/32"],
  },
  {
    userName: "namba_ya",
    mailAddress: "namba_ya@works-hi.co.jp",
    cidrs: [],
  },
  {
    userName: "okada_taku",
    mailAddress: "okada_taku@works-hi.co.jp",
    cidrs: ["106.72.43.33/32"],
  },
  {
    userName: "ogawa_kot",
    mailAddress: "ogawa_kot@works-hi.co.jp",
    cidrs: [],
  },
  {
    userName: "fukuba_y",
    mailAddress: "fukuba_y@works-hi.co.jp",
    cidrs: [],
  },
];

export const watchers: User[] = [
  {
    userName: "katsuki_c",
    mailAddress: "katsuki_c@works-hi.co.jp",
    cidrs: [],
  },
];

export const trustRoleArns = [
  "arn:aws:iam::343953862039:role/aws-reserved/sso.amazonaws.com/ap-northeast-1/AWSReservedSSO_BasicAccessRights_c1fae4a97c57e774", // aiunit-dev
  "arn:aws:iam::381491827239:role/aws-reserved/sso.amazonaws.com/ap-northeast-1/AWSReservedSSO_BasicAccessRights_4316db2e99de0743", // genai-profile-dev
  "arn:aws:iam::686255989062:role/aws-reserved/sso.amazonaws.com/ap-northeast-1/AWSReservedSSO_BasicAccessRights_ff606434c9b8b398", // Product_CCoE_ForJumpRole
];

const disabledRegions = [
  "af-south-1",
  "eu-south-1",
  "me-south-1",
  "ap-east-1",
  "me-central-1",
  "il-central-1",
  "ap-south-2",
  "ca-west-1",
  "eu-south-2",
  "ap-southeast-3",
  "ap-southeast-4",
  "eu-central-2",
];

export const regions = region_info.RegionInfo.regions
  .filter(
    (region) =>
      region.cdkMetadataResourceAvailable && region.partition === "aws" && !disabledRegions.includes(region.name),
  )
  .map((region) => region.name);
