An open API service indexing awesome lists of open source software.

https://github.com/jameswoolfenden/terraform-aws-pricing

Get prices from AWS api
https://github.com/jameswoolfenden/terraform-aws-pricing

aws module pricing prototype terraform

Last synced: 25 days ago
JSON representation

Get prices from AWS api

Awesome Lists containing this project

README

          

# terraform-aws-pricing

[![Build Status](https://github.com/JamesWoolfenden/terraform-aws-pricing/workflows/Verify/badge.svg?branch=main)](https://github.com/JamesWoolfenden/terraform-aws-pricing)
[![Latest Release](https://img.shields.io/github/release/JamesWoolfenden/terraform-aws-pricing.svg)](https://github.com/JamesWoolfenden/terraform-aws-pricing/releases/latest)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/JamesWoolfenden/terraform-aws-pricing.svg?label=latest)](https://github.com/JamesWoolfenden/terraform-aws-pricing/releases/latest)
![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.14.0-blue.svg)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![checkov](https://img.shields.io/badge/checkov-verified-brightgreen)](https://www.checkov.io/)

Prototype pricing module.

---

It's 100% Open Source and licensed under the [APACHE2](LICENSE).

## Usage

Include this repository as a module in your existing Terraform code:

```hcl
module "pricing" {
source = "JamesWoolfenden/pricing/aws"
filters = var.filters
service_code = var.service_code
}
```

## Requirements

No requirements.

## Providers

| Name | Version |
| ---- | ------- |
| [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
| ---- | ---- |
| [aws_pricing_product.example](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/pricing_product) | data source |

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| [filters](#input\_filters) | Filters for the service\_code | `list` |

[
{
"field": "productFamily",
"value": "Storage"
},
{
"field": "location",
"value": "US East (N. Virginia)"
},
{
"field": "volumeType",
"value": "Standard"
},
{
"field": "availability",
"value": "99.99%"
},
{
"field": "storageClass",
"value": "General Purpose"
}
]
| no |
| [service\_code](#input\_service\_code) | The Product calls to query AmazonS3 | `string` | n/a | yes |

## Outputs

| Name | Description |
| ---- | ----------- |
| [price](#output\_price) | n/a |

## Prototype work on aws pricing

Can I price up my Terraform as I design it?

```shell
aws pricing describe-services --region us-east-1
$services=aws pricing describe-services --region us-east-1|convertfrom-json

$services.Services
$services.Services.AmazonEC2
($data|where {$_.ServiceCode -eq "AmazonEc2"}).AttributeNames

aws pricing get-attribute-values --service-code AmazonEC2 --attribute-name location --region us-east-1

($data|where {$_.ServiceCode -eq "AmazonS3"}).AttributeNames

aws pricing get-attribute-values --service-code AmazonEC2 --attribute-name productFamily --region us-east-1
```

## Related Projects

Check out these related projects.

- [terraform-aws-codebuild](https://github.com/jameswoolfenden/terraform-aws-codebuild) - Making a Build pipeline

## Help

**Got a question?**

File a GitHub [issue](https://github.com/jameswoolfenden/terraform-aws-pricing/issues).

## Contributing

### Bug Reports & Feature Requests

Please use the [issue tracker](https://github.com/jameswoolfenden/terraform-aws-pricing/issues) to report any bugs or file feature requests.

## Copyrights

Copyright © 2019-2023 James Woolfenden

## License

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

See [LICENSE](LICENSE) for full details.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

### Contributors

[![James Woolfenden][jameswoolfenden_avatar]][jameswoolfenden_homepage]
[James Woolfenden][jameswoolfenden_homepage]

[jameswoolfenden_homepage]: https://github.com/jameswoolfenden
[jameswoolfenden_avatar]: https://github.com/jameswoolfenden.png?size=150