Skip to content

Commit b1d5988

Browse files
Mark Anderson-Trocmeantonbabenko
andauthored
fix: Support for new AWS region (#15)
Co-authored-by: Anton Babenko <[email protected]> Closes #14
1 parent df3ccd8 commit b1d5988

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

examples/pricing-resources/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ provider "aws" {
55
module "pricing" {
66
source = "../../modules/pricing"
77

8-
debug_output = true
8+
debug_output = true
9+
query_all_regions = false
910

1011
resources = {
1112
"aws_instance.this#3" = { # 3 instances

modules/pricing/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ No modules.
6767
| <a name="input_debug_output"></a> [debug\_output](#input\_debug\_output) | Whether to populate more output (useful for debug, but increase verbosity and size of tfstate) | `bool` | `false` | no |
6868
| <a name="input_hourly_price_precision"></a> [hourly\_price\_precision](#input\_hourly\_price\_precision) | Number of digits after comma in hourly price | `number` | `10` | no |
6969
| <a name="input_monthly_price_precision"></a> [monthly\_price\_precision](#input\_monthly\_price\_precision) | Number of digits after comma in monthly price | `number` | `2` | no |
70+
| <a name="input_query_all_regions"></a> [query\_all\_regions](#input\_query\_all\_regions) | If true the source will query all regions regardless of availability | `bool` | `true` | no |
7071
| <a name="input_resources"></a> [resources](#input\_resources) | Map of all resources to calculate price for | `any` | `{}` | no |
7172

7273
## Outputs

modules/pricing/filters.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ locals {
279279
ap-southeast-3 = "APS3-NatGateway-Hours"
280280
ca-central-1 = "CAN1-NatGateway-Hours"
281281
eu-central-1 = "EUC1-NatGateway-Hours"
282+
eu-central-2 = "EUC2-NatGateway-Hours"
282283
eu-west-1 = "EU-NatGateway-Hours"
283284
eu-west-2 = "EUW2-NatGateway-Hours"
284285
eu-west-3 = "EUW3-NatGateway-Hours"
@@ -310,6 +311,7 @@ locals {
310311
ap-southeast-3 = "APS3-LoadBalancerUsage"
311312
ca-central-1 = "CAN1-LoadBalancerUsage"
312313
eu-central-1 = "EUC1-LoadBalancerUsage"
314+
eu-central-2 = "EUC2-LoadBalancerUsage"
313315
eu-west-1 = "EU-LoadBalancerUsage"
314316
eu-west-2 = "EUW2-LoadBalancerUsage"
315317
eu-west-3 = "EUW3-LoadBalancerUsage"
@@ -341,6 +343,7 @@ locals {
341343
ap-southeast-3 = "APS3-EBS:SnapshotUsage"
342344
ca-central-1 = "CAN1-EBS:SnapshotUsage"
343345
eu-central-1 = "EUC1-EBS:SnapshotUsage"
346+
eu-central-2 = "EUC2-EBS:SnapshotUsage"
344347
eu-west-1 = "EU-EBS:SnapshotUsage"
345348
eu-west-2 = "EUW2-EBS:SnapshotUsage"
346349
eu-west-3 = "EUW3-EBS:SnapshotUsage"

modules/pricing/regions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
data "aws_regions" "all" {
2-
all_regions = true
2+
all_regions = var.query_all_regions
33
}
44

55
data "aws_region" "one" {

modules/pricing/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ variable "monthly_price_precision" {
4545
default = 2
4646
}
4747

48+
variable "query_all_regions" {
49+
description = "If true the source will query all regions regardless of availability"
50+
type = bool
51+
default = true
52+
}
53+
4854
# Defaults
4955
variable "aws_default_region" {
5056
description = "Default AWS region to use for resources (if not set) when asking AWS Pricing API"

0 commit comments

Comments
 (0)