README WIP

pull/52/head
Stephen Kirby 2 years ago
parent 76644e0f1a
commit 1b51d08d21

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

@ -9,8 +9,49 @@ tags: [helper, parameter, fly]
# Fly.io Region # Fly.io Region
A parameter with all fly.io regions. This allows developers to select the region closest to them. This module adds Fly.io regions to your Coder template. Regions can be whitelisted using the `regions` argument and given custom names and custom icons with their respective map arguments (`custom_names`, `custom_icons`).
## Examples ## Examples
TODO ### Using default settings
```hcl
module "fly-region" {
source = "https://registry.coder.com/modules/fly-region"
}
```
[]()
### Using region whitelist
The regions argument can be used to display only the desired regions in the Coder parameter.
```hcl
module "fly-region" {
source = "https://registry.coder.com/modules/fly-region"
default = "ams"
regions = ["ams", "arn", "atl"]
}
```
TODO: Add screenshot filtered_flyio.png
### Using custom icons and names
Set custom icons and names with their respective maps.
```hcl
module "fly-region" {
source = "https://registry.coder.com/modules/fly-region"
default = "ams"
custom_icons = {
"ams" = "/emojis/1f90e.png"
}
custom_names = {
"ams" = "We love the Netherlands!"
}
}
```

@ -270,7 +270,7 @@ data "coder_parameter" "fly_region" {
name = "flyio_region" name = "flyio_region"
display_name = var.display_name display_name = var.display_name
description = var.description description = var.description
default = var.default default = (var.default != null && var.default != "") && (contains(var.regions, var.default) || length(var.regions) == 0) ? var.default : null
mutable = var.mutable mutable = var.mutable
dynamic "option" { dynamic "option" {
for_each = { for k, v in local.regions : k => v if anytrue([for d in var.regions : k == d ]) || length(var.regions) == 0 } for_each = { for k, v in local.regions : k => v if anytrue([for d in var.regions : k == d ]) || length(var.regions) == 0 }

Loading…
Cancel
Save