Skip to content

Commit

Permalink
docs: replace HCL code with correct language specific code (#8)
Browse files Browse the repository at this point in the history
* docs: replaced HCL code with correct language specific code

* docs: removed a couple of excessive closing curly braces for the choosable Hugo element and removed left over HCL code which should be YAML

---------

Co-authored-by: Thomas Meckel <tmeckel@users.noreply.github.com>
  • Loading branch information
tmeckel and tmeckel authored Apr 5, 2024
1 parent f1c5452 commit 04d8ad3
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 42 deletions.
2 changes: 1 addition & 1 deletion docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This is a community maintained provider. Please file issues and feature requests

{{< chooser language "typescript,python,go,csharp,yaml" >}}

{{% choosable language typescript %}}}
{{% choosable language typescript %}}

```typescript
import * as pulumi from "@pulumi/pulumi";
Expand Down
195 changes: 154 additions & 41 deletions docs/installation-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Replace the version string `<version>` with your desired version.

{{< chooser language "typescript,python,go,csharp,yaml" >}}

{{% choosable language typescript %}}}
{{% choosable language typescript %}}

```typescript
import * as pulumi from "@pulumi/pulumi";
Expand Down Expand Up @@ -220,7 +220,7 @@ If it is used for testing, you can set `insecure` to `true` and unset

{{< chooser language "typescript,python,go,csharp,yaml" >}}

{{% choosable language typescript %}}}
{{% choosable language typescript %}}

```typescript
import * as pulumi from "@pulumi/pulumi";
Expand Down Expand Up @@ -413,7 +413,7 @@ be added.

{{< chooser language "typescript,python,go,csharp,yaml" >}}

{{% choosable language typescript %}}}
{{% choosable language typescript %}}

```typescript
import * as pulumi from "@pulumi/pulumi";
Expand Down Expand Up @@ -635,7 +635,7 @@ The following arguments are supported:

{{< chooser language "typescript,python,go,csharp,yaml" >}}

{{% choosable language typescript %}}}
{{% choosable language typescript %}}

```typescript
import * as fortios from "@pulumiverse/fortios";
Expand Down Expand Up @@ -830,7 +830,7 @@ following example as a reference:

{{< chooser language "typescript,python,go,csharp,yaml" >}}

{{% choosable language typescript %}}}
{{% choosable language typescript %}}

```typescript
import * as pulumi from "@pulumi/pulumi";
Expand Down Expand Up @@ -1293,52 +1293,165 @@ If the port is changed or intended to be changed, refer to the details below
1. Configure the Firewall's admin_sport to 8443 manually.

1. Configure the Provider part of the configuration file, add the 8443 port
number to the hostname/IP and separate them with a colon, as follows:
number to the hostname/IP and separate them with a colon, as follows in the
`Pulumi.yaml` file:

```hcl
provider "fortios" {
hostname = "192.168.52.111:8443"
token = "nx6nbGn8tnFddaa3Qy79jpjfsyw1"
...
}
```yaml
name: Fortios
runtime: yaml
config:
fortios:hostname:
value: 192.168.52.111:8443
fortios:token:
value: nx6nbGn8tnFddaa3Qy79jpjfsyw1
```

### Option II

1 Configure the admin_sport port in the Pulumi configuration file as follows:
1. Configure the admin_sport port as follows:

```hcl
provider "fortios" {
hostname = "192.168.52.111"
token = "nx6nbGn8tnFddaa3Qy79jpjfsyw1"
insecure = "true"
}
Pulumi.yaml:

resource "fortios_system_global" "fglobal" {
admintimeout = 240
hostname = "testhostname"
timezone = "33"
admin_sport = 8443
admin_ssh_port = 22
}
```
```yaml
name: Fortios
runtime: yaml
config:
fortios:hostname:
value: 192.168.52.111
fortios:insecure:
value: "true"
fortios:token:
value: nx6nbGn8tnFddaa3Qy79jpjfsyw1
```

Then execute "Pulumi init; Pulumi plan; Pulumi apply". After a few seconds or
more (depending on your network situation), then press Ctrl+C to end the apply
command. If your network is okay, the admin_sport will be successfully set to
8443.
Language dependent resource:

2 Change the Provider part of the configuration file, add the 8443 port number
to the hostname and separate them with a colon, as follows, then re-apply
Pulumi:
{{< chooser language "typescript,python,go,csharp,yaml" >}}

```hcl
provider "fortios" {
hostname = "192.168.52.111:8443"
token = "nx6nbGn8tnFddaa3Qy79jpjfsyw1"
insecure = "true"
}
```
{{% choosable language typescript %}}

```typescript
import * as pulumi from "@pulumi/pulumi";
import * as fortios from "@pulumiverse/fortios";
const fglobal = new fortios.system.Global("fglobal", {
admintimeout: 240,
hostname: "testhostname",
timezone: "33",
adminSport: 8443,
adminSshPort: 22,
});
```

{{% /choosable %}}

{{% choosable language python %}}

```python
import pulumi
import pulumiverse_fortios as fortios
fglobal = fortios.system.Global("fglobal",
admintimeout=240,
hostname="testhostname",
timezone="33",
admin_sport=8443,
admin_ssh_port=22)
```

{{% /choosable %}}

{{% choosable language go %}}

```go
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-fortios/sdk/go/fortios/system"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := system.NewGlobal(ctx, "fglobal", &system.GlobalArgs{
Admintimeout: pulumi.Int(240),
Hostname: pulumi.String("testhostname"),
Timezone: pulumi.String("33"),
AdminSport: pulumi.Int(8443),
AdminSshPort: pulumi.Int(22),
})
if err != nil {
return err
}
return nil
})
}
```

{{% /choosable %}}

{{% choosable language csharp %}}

```csharp
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fortios = Pulumiverse.Fortios;
return await Deployment.RunAsync(() =>
{
var fglobal = new Fortios.System.Global("fglobal", new()
{
Admintimeout = 240,
Hostname = "testhostname",
Timezone = "33",
AdminSport = 8443,
AdminSshPort = 22,
});
});
```

{{% /choosable %}}

{{% choosable language yaml %}}

```yaml
resources:
fglobal:
type: fortios:system:Global
properties:
admintimeout: 240
hostname: testhostname
timezone: '33'
adminSport: 8443
adminSshPort: 22
```

{{% /choosable %}}

{{< /chooser >}}

Then execute "Pulumi init; Pulumi plan; Pulumi apply". After a few seconds
or more (depending on your network situation), then press `Ctrl+C` to end
the apply command. If your network is okay, the `adminSport` will be
successfully set to `8443`.

2. Change the Provider part of the configuration file `Pulumi.yaml`, add the
8443 port number to the hostname and separate them with a colon, as follows,
then re-apply Pulumi:

```yaml
name: Fortios
runtime: yaml
config:
fortios:hostname:
value: 192.168.52.111:8443
fortios:insecure:
value: "true"
fortios:token:
value: nx6nbGn8tnFddaa3Qy79jpjfsyw1
```

## Sort security policies

Expand Down

0 comments on commit 04d8ad3

Please sign in to comment.