Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version of the API function to update and query migrated infrastructure cost information in AWS. #11

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

hippo-an
Copy link
Contributor

@hippo-an hippo-an commented Aug 14, 2024

작업 내용

  • 마이그레이션 된 인프라의 정보를 사용자에게 받아 aws 의 사용자 비용 데이터 조회 및 저장
  • 저장된 가격 정보에 대해서 일별, 주간별, 월별 비용 데이터 조회

리소스 타입 및 필요 정보

  • VM

    • i-xxxxx 형식의 resource id
  • VNet

    • eni-xxxxxx 형식의 ENI resource id
    • eipalloc-xxxxx 형식의 elastic ip resource id
      • eni , eip 에 대한 비용 데이터를 업데이트 하는 경우 실제 필터링이 가능한 리소스 아이디 조합을 위하여 아래 데이터를 필수로 넘겨줘야합니다.
      type AwsAdditionalInfoReq struct {
        OwnerId string   `json:"ownerId"`  // 12자리 숫자값
        Regions []string `json:"regions"`
      }
      
  • DataDisk

    • vol-xxxx 형식의 EBS 볼륨 resource id
  • CostExplorer

    • cost explorer api 는 페이지 요청당 0.01$ 의 과금을 청구하며 사용자의 credential 을 사용하여 cost explorer 를 호출하는 것이기 때문에 해당 resource type 은 추가하였습니다.
  • Tax

상세 내용

  • 로컬에서 개발한 spider 의 anycall handler 를 통하여 호출 테스트를 진행하였으며, aws 의 cost explorer api 를 통해 가격 정보를 호출합니다.
  • spider 의 aws anycall handler 에서 해당 기능이 머지된 후 해당 api 는 정상적으로 사용이 가능합니다.
    • 해당 기능에 대해선 로컬에서 작업한 내용을 보완하여 spider pr 예정입니다.
  • cost explorer 에 resource Id 를 통한 조회 기능은 오늘 기준으로 최대 2주내의 정보에 대해서만 조회 가능합니다.
    • aws cost explorer 의 정책이기 때문에 바꿀 수 없음
  • cost explorer api 의 getCostAndUsageWithResources api 를 사용해서 마이그레이션 된 리소스 정보에 대한 가격 정보만 조회합니다.

개선 가능 사항

  • 만일 workflow id 를 통해 마이그레이션 된 resource 에 대한 정보를 제공하는 api 가 서브시스템에 생긴다면 migration id 를 통해 특정 migration 에서 생성된 resource 정보를 조회함으로써 비용 업데이트시 필요한 요청 정보가 줄어들 수 있습니다.
    • resource id, owner id, region, connection 에 대한 정보가 필요 없어질 것으로 예상됩니다.
  • 비용데이터가 일정 기간 이상 쌓이는 경우 시계열 데이터 예측 모델을 적용하여 비용 데이터에 대한 예측 비용을 제공 가능성도 있어보입니다.

@hippo-an hippo-an changed the title proto version of update and query infra cost information Initial version of the API function to update and query migrated infrastructure cost information in AWS. Aug 14, 2024
@MZC-CSC MZC-CSC merged commit 2191bd3 into cloud-barista:main Aug 19, 2024
2 checks passed
MZC-CSC pushed a commit that referenced this pull request Oct 2, 2024
…rator-bug

update tumblebug response model and bug fix for load generator server save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants