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

adding Los Angeles, ElastiCache CacheNodeType, Elasticsearch InstanceType, and fixing Neptune InstanceClass pricing information #1535

Merged
merged 6 commits into from
May 18, 2020

Conversation

PatMyron
Copy link
Contributor

@PatMyron PatMyron commented May 17, 2020

Offer files for reference: (jq 'del(.terms)' helps for larger files)
https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/index.json
AmazonEC2 (3GB+)
AmazonRedshift
AmazonDAX
AmazonMQ
AmazonRDS
AmazonNeptune
AmazonDocDB
AmazonElastiCache
AmazonES


unrelated to this change, m6g instance types launched this week


moved US West (Los Angeles) from region_exceptions to region_map for us-west-2

which adds i3en.metal-2tb EC2 instance type to src/cfnlint/data/ExtendedSpecs/us-west-2/05_pricing_property_values.json and 37 lines to src/cfnlint/data/AdditionalSpecs/RdsProperties.json


switched AmazonNeptune from parsing usagetype to using instanceType which appends arge to db.r5.\d*xl, which seems correct:

Resources:
  DBCluster:
    Type: AWS::Neptune::DBCluster
  DBInstance:
    Type: AWS::Neptune::DBInstance
    Properties:
      DBInstanceClass: db.r5.xl
      DBClusterIdentifier: !Ref DBCluster

Invalid DB Instance class: db.r5.xl (Service: AmazonNeptune; Status Code: 400; Error Code: InvalidParameterValue)

Resources:
  DBCluster:
    Type: AWS::Neptune::DBCluster
  DBInstance:
    Type: AWS::Neptune::DBInstance
    Properties:
      DBInstanceClass: db.r5.xlarge
      DBClusterIdentifier: !Ref DBCluster

added AmazonElastiCache information for:

AWS::ElastiCache::CacheCluster.CacheNodeType

AWS::ElastiCache::ReplicationGroup.CacheNodeType

added AmazonES information for:

AWS::Elasticsearch::Domain.ElasticsearchClusterConfig.InstanceType


how to test:

brew install github/gh/gh # https://github.com/cli/cli
gh pr checkout 1535
pip3 install -e .
scripts/update_specs_from_pricing.py # requires Boto3 and Credentials, takes forever
cfn-lint --update-specs # https://github.com/aws-cloudformation/cfn-python-lint/pull/1383#issuecomment-629891506
Resources:
  Domain:
    Type: AWS::Elasticsearch::Domain
    Properties:
      ElasticsearchClusterConfig:
        InstanceType: r3.large.elasticsearch # change this for E3030 errors 🎉
  CacheCluster:
    Type: AWS::ElastiCache::CacheCluster
    Properties:
      NumCacheNodes: 1
      Engine: redis
      CacheNodeType: CacheNodeType
  ReplicationGroup:
    Type: AWS::ElastiCache::ReplicationGroup
    Properties:
      ReplicationGroupDescription: ReplicationGroupDescription
      CacheNodeType: CacheNodeType

future work:

more services:
nodetype

instanceclass:

AWSDatabaseMigrationSvc 'Replication Server' for AWS::DMS::ReplicationInstance.ReplicationInstanceClass (dms. prefix missing from instanceType, could parse usagetype)

instancetype:

ElasticMapReduce, ManagedBlockchain, GameLift, AppStream, AmazonSageMaker, AmazonMSK, etc.


cn-north-1 and cn-northwest-1 didn't seem to be picking up any pricing information until #1635

results[region_map[product.get('attributes').get('location')]].add(
usage_type
product.get('attributes').get('usagetype').split(':')[1]
Copy link
Contributor Author

@PatMyron PatMyron May 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -246 to -247
usage_type = product.get('attributes').get('usagetype').split(':')[1]
results[region_map[product.get('attributes').get('location')]].add(usage_type)
Copy link
Contributor Author

@PatMyron PatMyron May 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -145,14 +115,13 @@ def get_mq_pricing():
'mq.m5.2xl': 'mq.m5.2xlarge',
'mq.m5.4xl': 'mq.m5.4xlarge'
Copy link
Contributor Author

@PatMyron PatMyron May 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

results = {}
for page in get_paginator('AmazonMQ'):
for price_item in page.get('PriceList', []):
products = json.loads(price_item)
product = products.get('product', {})
if product:
if product.get('productFamily') == 'Broker Instances':
if product.get('productFamily') in ['Broker Instances']:
if not results.get(region_map[product.get('attributes').get('location')]):
results[region_map[product.get('attributes').get('location')]] = set()
usage_type = product.get('attributes').get('usagetype').split(':')[1]
Copy link
Contributor Author

@PatMyron PatMyron May 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PatMyron PatMyron changed the title Pricing adding Los Angeles and ElastiCache CacheNodeType and fixing Neptune pricing information May 17, 2020
@PatMyron PatMyron marked this pull request as ready for review May 17, 2020 22:50
@PatMyron PatMyron marked this pull request as draft May 17, 2020 23:08
@PatMyron PatMyron marked this pull request as ready for review May 18, 2020 00:11
@PatMyron PatMyron changed the title adding Los Angeles and ElastiCache CacheNodeType and fixing Neptune pricing information adding Los Angeles, ElastiCache CacheNodeType, Elasticsearch InstanceType, and fixing Neptune pricing information May 18, 2020
@PatMyron PatMyron changed the title adding Los Angeles, ElastiCache CacheNodeType, Elasticsearch InstanceType, and fixing Neptune pricing information adding Los Angeles, ElastiCache CacheNodeType, Elasticsearch InstanceType, and fixing Neptune InstanceClass pricing information May 18, 2020
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.

3 participants