project-koku / nise

A tool for generating sample cost usage data for testing purposes
GNU Affero General Public License v3.0
9 stars 15 forks source link

for AWS marketplace generator added ability to override product_name … #400

Closed ddonahue007 closed 2 years ago

ddonahue007 commented 2 years ago

Added the ability to override 'product_name' & 'legal_entity' to AWS marketplace generator

When running the following commands with not specifying 'product_name' & 'legal_entity' in static.yaml file, you should see the default values be utilized.

default static file:

---
  generators:
    - MarketplaceGenerator:
        start_date: 2022-01-01
        processor_arch: 32-bit
        resource_id: 55555555
        product_sku: VEAJHRNKTJZQ
        region: us-east-1a
        tags:
          resourceTags/aws:createdBy: AssumedRole:AROAYSLL3JVQ6DYUNKWQJ:1637692740557658269
        instance_type:
          inst_type: m5.large
          vcpu: 2
          memory: '8 GiB'
          storage: 'EBS Only'
          family: 'General Purpose'
          cost: 1.000
          rate: 0.500

  accounts:
    payer: 9999999999999
    user:
      - 9999999999999
    currency_code: USD

nise report aws --static-report-file example_aws-marketplace_static_data.yml --aws-s3-report-name None --aws-s3-bucket-name ./local_providers/aws_local

results (snip-snaps)

default_legal_ent

default_product_name

override defaults values for 'product_name' & 'legal_entity' static file:

---
  generators:
    - MarketplaceGenerator:
        start_date: 2022-01-01
        processor_arch: 32-bit
        resource_id: 55555555
        product_sku: VEAJHRNKTJZQ
        product_name: 'TESTING'
        region: us-east-1a
        legal_entity: 'AWS DD'
        tags:
          resourceTags/aws:createdBy: AssumedRole:AROAYSLL3JVQ6DYUNKWQJ:1637692740557658269
        instance_type:
          inst_type: m5.large
          vcpu: 2
          memory: '8 GiB'
          storage: 'EBS Only'
          family: 'General Purpose'
          cost: 1.000
          rate: 0.500

  accounts:
    payer: 9999999999999
    user:
      - 9999999999999
    currency_code: USD

nise report aws --static-report-file example_aws-marketplace_static_data.yml --aws-s3-report-name None --aws-s3-bucket-name ./local_providers/aws_local

results (snip-snaps)

override_legal_ent

override_product_name

codecov[bot] commented 2 years ago

Codecov Report

Merging #400 (05c7486) into main (58d65e2) will increase coverage by 0.0%. The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main    #400   +/-   ##
=====================================
  Coverage   93.9%   93.9%           
=====================================
  Files         57      57           
  Lines       4217    4226    +9     
  Branches     615     617    +2     
=====================================
+ Hits        3961    3970    +9     
  Misses       145     145           
  Partials     111     111