Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit e4cb9fb

Browse files
committed
Fix docs
1 parent 62e076c commit e4cb9fb

File tree

7 files changed

+30
-7
lines changed

7 files changed

+30
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ terraform {
1515
required_providers {
1616
publicip = {
1717
source = "nxt/publicip"
18-
version = "x"
18+
version = "~> 0.0.3"
1919
}
2020
}
2121
}

docs/data-sources/address.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,27 @@ description: |-
1010

1111
The current (public) IP as reported by the IP information provider.
1212

13+
## Example Usage
1314

15+
```terraform
16+
data "publicip_address" "default" {
17+
}
18+
19+
data "publicip_address" "v4" {
20+
ip_version = "v4"
21+
}
22+
23+
data "publicip_address" "v6" {
24+
ip_version = "v6"
25+
}
26+
```
1427

1528
<!-- schema generated by tfplugindocs -->
1629
## Schema
1730

1831
### Optional
1932

20-
- **ip_version** (String) Whether to use IPv4 or IPv6 only. Valid values: 'V4', 'V6'
33+
- **ip_version** (String) Whether to use IPv4 or IPv6 only. Valid values: 'v6', 'v4'
2134

2235
### Read-Only
2336

docs/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ description: |-
1414

1515
```terraform
1616
provider "publicip" {
17-
provider_url = "https://ifconfig.co/" # default value
17+
provider_url = "https://ifconfig.co/" # optional
18+
timeout = "10s" # optional
19+
20+
# 1 request per 500ms
21+
rate_limit_rate = "500ms" # optional
22+
rate_limit_burst = "1" # optional
1823
}
1924
```
2025

@@ -23,7 +28,7 @@ provider "publicip" {
2328

2429
### Optional
2530

26-
- **provider_url** (String) URL to a ifconfig.co-compatible IP information provider, defaults to `https://ifconfig.co/`.
31+
- **provider_url** (String) URL to an ifconfig.co-compatible IP information provider, defaults to `https://ifconfig.co/`.
2732
- **rate_limit_burst** (Number) Limit the number of the request to the IP information provider. Defines the number of events per rate until the limit is reached. Defaults to `1`.
2833
- **rate_limit_rate** (String) Limit the number of the request to the IP information provider. Defines the time until the limit is reset. Defaults to `500ms`.
2934
- **timeout** (String) Timeout of the request to the IP information provider. Defaults to `5s`.
File renamed without changes.

examples/provider/provider.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
provider "publicip" {
2-
provider_url = "https://ifconfig.co/" # default value
2+
provider_url = "https://ifconfig.co/" # optional
3+
timeout = "10s" # optional
4+
5+
# 1 request per 500ms
6+
rate_limit_rate = "500ms" # optional
7+
rate_limit_burst = "1" # optional
38
}

internal/provider/ip_address_data_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (t ipDataSourceType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagn
3030
Type: types.StringType,
3131
},
3232
"ip_version": {
33-
MarkdownDescription: "Whether to use IPv4 or IPv6 only. Valid values: 'V4', 'V6'",
33+
MarkdownDescription: fmt.Sprintf("Whether to use IPv4 or IPv6 only. Valid values: '%s', '%s'", IPVersion6, IPVersion4),
3434
Optional: true,
3535
Type: types.StringType,
3636
Validators: []tfsdk.AttributeValidator{ipVersionValidator{}},

internal/provider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (p *provider) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagnostics)
161161
Type: types.Int64Type,
162162
},
163163
"provider_url": {
164-
MarkdownDescription: fmt.Sprintf("URL to a ifconfig.co-compatible IP information provider, defaults to `%s`.", DefaultProviderURL),
164+
MarkdownDescription: fmt.Sprintf("URL to an ifconfig.co-compatible IP information provider, defaults to `%s`.", DefaultProviderURL),
165165
Optional: true,
166166
Type: types.StringType,
167167
},

0 commit comments

Comments
 (0)