Skip to content

Commit 64f808a

Browse files
Update API key expiry example
1 parent fdb838e commit 64f808a

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

ns1/examples/apikey.tf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ resource "ns1_apikey" "apikey" {
88
#permissions are available at the top level
99
}
1010

11-
# Example: API key with automatic secret rotation
12-
resource "ns1_apikey" "rotating_key" {
13-
name = "rotating-api-key"
11+
# Example: API key with secret expiration
12+
resource "ns1_apikey" "expiring_key" {
13+
name = "expiring-api-key"
1414

15-
# Enable automatic secret rotation every 30 days
16-
# Valid values: "10d", "30d", "90d"
15+
# Set secret expiration period to 30 days
16+
# Secrets will expire after this period and must be manually renewed
17+
# Accepts any duration in '<number>d' format (e.g., "10d", "30d", "90d")
1718
expiry_duration = "30d"
1819

1920
# Configure permissions
2021
dns_view_zones = true
2122
dns_manage_zones = true
2223
}
2324

24-
# The secrets are automatically managed and can be viewed in the state
25-
output "rotating_key_secrets" {
26-
value = ns1_apikey.rotating_key.secrets
25+
# The secrets metadata can be viewed in the state
26+
output "expiring_key_secrets" {
27+
value = ns1_apikey.expiring_key.secrets
2728
sensitive = true
2829
}

0 commit comments

Comments
 (0)