Can I request pricing for GovCloud?
Hello,
Thank you for very helpful module.
Is it possible to query GovCloud for pricing? I have not been able to succeed so far. The code below: client = boto3.client('ec2', aws_access_key_id, aws_secret_access_key, region_name='us-gov-west-1') ec2info = defaultdict() ec2_offer = awspricing.offer('AmazonEC2') gives this error: botocore.exceptions.NoCredentialsError: Unable to locate credentials
Thanks, Irina
I still have a problem in GovCloud. My code works in regular AWS but not in AWS GOV. ec2_offer = awspricing.offer('AmazonEC2') fails with the error: botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the DescribeServices operation: The security token included in the request is invalid.
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY are set in the environment; AWS user has admin permission.
Any suggestion?
Thanks, Irina
I found out that earlier version of awspricing - 1.1.5 does work without throwing the exception. However it does not return pricing either as the EC2 is not in the books. Thus, the result is about the same - i.e. no result. Still throwing an exception seems to be a regression in version 2.0.0 as compared to 1.1.5.
So, awspricing version 1.1.5 + botocore 1.12.107 + boto3 1.9.107 works well. Another caveat for GovCloud is that ec2_offer.ondemand_hourly() call should set region to 'us-west-1' instead of 'us-gov-west-1'.
The earlier version probably works because it doesn't utilize the AWS API itself, but publicly available data files. This isn't a regression as such, since it was an intentional decision to move to the API.
The security token included in the request is invalid. indicates that there is some issue with the credentials. Are you able to make other AWS API calls?
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html would be a good way to debug and the other env variables might provide some hints