Skip to content

Commit

Permalink
r/system_syslog_file: use new provider via framework
Browse files Browse the repository at this point in the history
fix reading 'archive size' when value is a multiple of 1024 (k,m,g)
  • Loading branch information
jeremmfr committed Dec 16, 2023
1 parent 62289d5 commit 9ad7433
Show file tree
Hide file tree
Showing 20 changed files with 1,486 additions and 1,017 deletions.
9 changes: 9 additions & 0 deletions .changes/issue-593.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ FEATURES:

ENHANCEMENTS:

* **resource/junos_system_syslog_file**: resource now use new [terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework)
some of config errors are now sent during Plan instead of during Apply
optional boolean attributes doesn't accept value *false*
optional string attributes doesn't accept *empty* value
the resource schema has been upgraded to have one-blocks in single mode instead of list
* **resource/junos_system_syslog_host**: resource now use new [terraform-plugin-framework](https://github.com/hashicorp/terraform-plugin-framework)
optional boolean attributes doesn't accept value *false*
optional string attributes doesn't accept *empty* value
the resource schema has been upgraded to have one-blocks in single mode instead of list

BUG FIXES:

* **resource/junos_system_syslog_file**: fix reading `archive size` when value is a multiple of 1024 (k,m,g)
2 changes: 1 addition & 1 deletion docs/resources/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ The following arguments are supported:
- **automatic_interval** (Optional, Number)
Automatic interval (1..336 hours).
- **automatic_start_time** (Optional, String)
Automatic start time `YYYY-MM-DD.HH:MM:SS`.
Automatic start time (YYYY-MM-DD.HH:MM:SS).
- **install_ignore_version_check** (Optional, Boolean)
Skip version check when attack database gets installed.
- **proxy_profile** (Optional, String)
Expand Down
26 changes: 13 additions & 13 deletions docs/resources/system_syslog_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,8 @@ The following arguments are supported:
- **no_binary_data** (Optional, Boolean)
Don't mark file as if it contains binary data.
Conflict with `binary_data`.
- **world_readable** (Optional, Boolean)
Allow any user to read the log file.
Conflict with `no_world_readable`.
- **no_world_readable** (Optional, Boolean)
Don't allow any user to read the log file.
Conflict with `world_readable`.
- **files** (Optional, Number)
Number of files to be archived (1..1000)
- **size** (Optional, Number)
Size of files to be archived (65536..1073741824 bytes)
- **start_time** (Optional, String)
Start time for file transmission (yyyy-mm-dd.hh:mm)
- **transfer_interval** (Optional, Number)
Frequency at which to transfer files to archive sites (5..2880 minutes)
Number of files to be archived (1..1000).
- **sites** (Optional, Block List)
For each url, configure an archive site (first declaration is primary URL, failover for others).
- **url** (Required, String)
Expand All @@ -100,6 +88,18 @@ The following arguments are supported:
Password for login into the archive site.
- **routing_instance** (Optional, String)
Routing instance.
- **size** (Optional, Number)
Size of files to be archived (65536..1073741824 bytes).
- **start_time** (Optional, String)
Start time for file transmission (YYYY-MM-DD.HH:MM:SS).
- **transfer_interval** (Optional, Number)
Frequency at which to transfer files to archive sites (5..2880 minutes).
- **world_readable** (Optional, Boolean)
Allow any user to read the log file.
Conflict with `no_world_readable`.
- **no_world_readable** (Optional, Boolean)
Don't allow any user to read the log file.
Conflict with `world_readable`.

**WARNING** All severities need to be
`alert`, `any`, `critical`, `emergency`, `error`, `info`, `none`, `notice` or `warning`.
Expand Down
1 change: 1 addition & 0 deletions internal/providerfwk/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ func (p *junosProvider) Resources(_ context.Context) []func() resource.Resource
newStaticRouteResource,
newSwitchOptionsResource,
newSystemResource,
newSystemSyslogFileResource,
newSystemSyslogHostResource,
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/providerfwk/resource_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ func (rsc *security) Schema(
},
"automatic_start_time": schema.StringAttribute{
Optional: true,
Description: "Automatic start time `YYYY-MM-DD.HH:MM:SS`.",
Description: "Automatic start time (YYYY-MM-DD.HH:MM:SS).",
Validators: []validator.String{
stringvalidator.RegexMatches(
regexp.MustCompile(`^\d{4}\-\d\d?\-\d\d?\.\d{2}:\d{2}:\d{2}$`),
Expand Down
Loading

0 comments on commit 9ad7433

Please sign in to comment.