-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
591096d
commit b86ea25
Showing
3 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# routeros_ip_service (Resource) | ||
|
||
|
||
## Example Usage | ||
```terraform | ||
locals { | ||
tls_service = {"api-ssl" = 8729, "www-ssl" = 443} | ||
disable_service = {"api" = 8728, "ftp" = 21, "telnet" = 23, "www" = 80} | ||
enable_service = {"ssh" = 22, "winbox" = 8291} | ||
} | ||
resource "routeros_system_certificate" "tls_cert" { | ||
name = "tls-cert" | ||
common_name = "Mikrotik Router" | ||
days_valid = 3650 | ||
key_usage = ["key-cert-sign", "crl-sign", "digital-signature", "key-agreement", "tls-server"] | ||
key_size = "prime256v1" | ||
sign { | ||
} | ||
} | ||
# terraform state rm 'routeros_ip_service.tls["www-ssl"]' | ||
# terraform import 'routeros_ip_service.tls["www-ssl"]' www-ssl | ||
resource "routeros_ip_service" "tls" { | ||
for_each = local.tls_service | ||
numbers = each.key | ||
port = each.value | ||
certificate = routeros_system_certificate.tls_cert.name | ||
tls_version = "only-1.2" | ||
disabled = false | ||
} | ||
resource "routeros_ip_service" "disabled" { | ||
for_each = local.disable_service | ||
numbers = each.key | ||
port = each.value | ||
disabled = true | ||
} | ||
resource "routeros_ip_service" "enabled" { | ||
for_each = local.enable_service | ||
numbers = each.key | ||
port = each.value | ||
disabled = false | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `numbers` (String) The name of the service whose settings will be changed ( api, api-ssl, ftp, ssh, telnet, winbox, www, www-ssl ). | ||
- `port` (Number) The port particular service listens on. | ||
|
||
### Optional | ||
|
||
- `address` (String) List of IP/IPv6 prefixes from which the service is accessible. | ||
- `certificate` (String) The name of the certificate used by a particular service. Applicable only for services that depend on certificates ( www-ssl, api-ssl ). | ||
- `disabled` (Boolean) | ||
- `tls_version` (String) Specifies which TLS versions to allow by a particular service. | ||
- `vrf` (String) Specify which VRF instance to use by a particular service. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `invalid` (Boolean) | ||
- `name` (String) Service name. | ||
|
||
## Import | ||
Import is supported using the following syntax: | ||
```shell | ||
#The ID can be found via API or the terminal | ||
#The command for the terminal is -> :put [/ip/service get [print show-ids]] | ||
terraform import routeros_ip_service.www_ssl www-ssl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters