1. Packages
  2. Fortimanager Provider
  3. API Docs
  4. ObjectSwitchcontrollerManagedswitchCustomcommand
fortimanager 1.14.0 published on Tuesday, Apr 15, 2025 by fortinetdev

fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand

Explore with Pulumi AI

Configuration method to edit FortiSwitch commands to be pushed to this FortiSwitch device upon rebooting the FortiGate switch controller or the FortiSwitch.

This resource is a sub resource for variable custom_command of resource fortimanager.ObjectSwitchcontrollerManagedswitch. Conflict and overwrite may occur if use both of them.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as fortimanager from "@pulumi/fortimanager";

const trnameObjectSwitchcontrollerManagedswitch = new fortimanager.ObjectSwitchcontrollerManagedswitch("trnameObjectSwitchcontrollerManagedswitch", {
    _platform: "FS1D48T418000533",
    switchId: "3",
});
const trnameObjectSwitchcontrollerManagedswitchCustomcommand = new fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand("trnameObjectSwitchcontrollerManagedswitchCustomcommand", {
    managedSwitch: trnameObjectSwitchcontrollerManagedswitch.switchId,
    commandEntry: "customcommand",
}, {
    dependsOn: [trnameObjectSwitchcontrollerManagedswitch],
});
Copy
import pulumi
import pulumi_fortimanager as fortimanager

trname_object_switchcontroller_managedswitch = fortimanager.ObjectSwitchcontrollerManagedswitch("trnameObjectSwitchcontrollerManagedswitch",
    _platform="FS1D48T418000533",
    switch_id="3")
trname_object_switchcontroller_managedswitch_customcommand = fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand("trnameObjectSwitchcontrollerManagedswitchCustomcommand",
    managed_switch=trname_object_switchcontroller_managedswitch.switch_id,
    command_entry="customcommand",
    opts = pulumi.ResourceOptions(depends_on=[trname_object_switchcontroller_managedswitch]))
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/fortimanager/fortimanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		trnameObjectSwitchcontrollerManagedswitch, err := fortimanager.NewObjectSwitchcontrollerManagedswitch(ctx, "trnameObjectSwitchcontrollerManagedswitch", &fortimanager.ObjectSwitchcontrollerManagedswitchArgs{
			_platform: pulumi.String("FS1D48T418000533"),
			SwitchId:  pulumi.String("3"),
		})
		if err != nil {
			return err
		}
		_, err = fortimanager.NewObjectSwitchcontrollerManagedswitchCustomcommand(ctx, "trnameObjectSwitchcontrollerManagedswitchCustomcommand", &fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommandArgs{
			ManagedSwitch: trnameObjectSwitchcontrollerManagedswitch.SwitchId,
			CommandEntry:  pulumi.String("customcommand"),
		}, pulumi.DependsOn([]pulumi.Resource{
			trnameObjectSwitchcontrollerManagedswitch,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Fortimanager = Pulumi.Fortimanager;

return await Deployment.RunAsync(() => 
{
    var trnameObjectSwitchcontrollerManagedswitch = new Fortimanager.ObjectSwitchcontrollerManagedswitch("trnameObjectSwitchcontrollerManagedswitch", new()
    {
        _platform = "FS1D48T418000533",
        SwitchId = "3",
    });

    var trnameObjectSwitchcontrollerManagedswitchCustomcommand = new Fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand("trnameObjectSwitchcontrollerManagedswitchCustomcommand", new()
    {
        ManagedSwitch = trnameObjectSwitchcontrollerManagedswitch.SwitchId,
        CommandEntry = "customcommand",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            trnameObjectSwitchcontrollerManagedswitch,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.fortimanager.ObjectSwitchcontrollerManagedswitch;
import com.pulumi.fortimanager.ObjectSwitchcontrollerManagedswitchArgs;
import com.pulumi.fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand;
import com.pulumi.fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommandArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var trnameObjectSwitchcontrollerManagedswitch = new ObjectSwitchcontrollerManagedswitch("trnameObjectSwitchcontrollerManagedswitch", ObjectSwitchcontrollerManagedswitchArgs.builder()
            ._platform("FS1D48T418000533")
            .switchId(3)
            .build());

        var trnameObjectSwitchcontrollerManagedswitchCustomcommand = new ObjectSwitchcontrollerManagedswitchCustomcommand("trnameObjectSwitchcontrollerManagedswitchCustomcommand", ObjectSwitchcontrollerManagedswitchCustomcommandArgs.builder()
            .managedSwitch(trnameObjectSwitchcontrollerManagedswitch.switchId())
            .commandEntry("customcommand")
            .build(), CustomResourceOptions.builder()
                .dependsOn(trnameObjectSwitchcontrollerManagedswitch)
                .build());

    }
}
Copy
resources:
  trnameObjectSwitchcontrollerManagedswitchCustomcommand:
    type: fortimanager:ObjectSwitchcontrollerManagedswitchCustomcommand
    properties:
      managedSwitch: ${trnameObjectSwitchcontrollerManagedswitch.switchId}
      commandEntry: customcommand
    options:
      dependsOn:
        - ${trnameObjectSwitchcontrollerManagedswitch}
  trnameObjectSwitchcontrollerManagedswitch:
    type: fortimanager:ObjectSwitchcontrollerManagedswitch
    properties:
      _platform: FS1D48T418000533
      switchId: 3
Copy

Create ObjectSwitchcontrollerManagedswitchCustomcommand Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ObjectSwitchcontrollerManagedswitchCustomcommand(name: string, args: ObjectSwitchcontrollerManagedswitchCustomcommandArgs, opts?: CustomResourceOptions);
@overload
def ObjectSwitchcontrollerManagedswitchCustomcommand(resource_name: str,
                                                     args: ObjectSwitchcontrollerManagedswitchCustomcommandArgs,
                                                     opts: Optional[ResourceOptions] = None)

@overload
def ObjectSwitchcontrollerManagedswitchCustomcommand(resource_name: str,
                                                     opts: Optional[ResourceOptions] = None,
                                                     managed_switch: Optional[str] = None,
                                                     adom: Optional[str] = None,
                                                     command_entry: Optional[str] = None,
                                                     command_name: Optional[str] = None,
                                                     object_switchcontroller_managedswitch_customcommand_id: Optional[str] = None,
                                                     scopetype: Optional[str] = None)
func NewObjectSwitchcontrollerManagedswitchCustomcommand(ctx *Context, name string, args ObjectSwitchcontrollerManagedswitchCustomcommandArgs, opts ...ResourceOption) (*ObjectSwitchcontrollerManagedswitchCustomcommand, error)
public ObjectSwitchcontrollerManagedswitchCustomcommand(string name, ObjectSwitchcontrollerManagedswitchCustomcommandArgs args, CustomResourceOptions? opts = null)
public ObjectSwitchcontrollerManagedswitchCustomcommand(String name, ObjectSwitchcontrollerManagedswitchCustomcommandArgs args)
public ObjectSwitchcontrollerManagedswitchCustomcommand(String name, ObjectSwitchcontrollerManagedswitchCustomcommandArgs args, CustomResourceOptions options)
type: fortimanager:ObjectSwitchcontrollerManagedswitchCustomcommand
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ObjectSwitchcontrollerManagedswitchCustomcommandArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ObjectSwitchcontrollerManagedswitchCustomcommandArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ObjectSwitchcontrollerManagedswitchCustomcommandArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ObjectSwitchcontrollerManagedswitchCustomcommandArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ObjectSwitchcontrollerManagedswitchCustomcommandArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var objectSwitchcontrollerManagedswitchCustomcommandResource = new Fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand("objectSwitchcontrollerManagedswitchCustomcommandResource", new()
{
    ManagedSwitch = "string",
    Adom = "string",
    CommandEntry = "string",
    CommandName = "string",
    ObjectSwitchcontrollerManagedswitchCustomcommandId = "string",
    Scopetype = "string",
});
Copy
example, err := fortimanager.NewObjectSwitchcontrollerManagedswitchCustomcommand(ctx, "objectSwitchcontrollerManagedswitchCustomcommandResource", &fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommandArgs{
ManagedSwitch: pulumi.String("string"),
Adom: pulumi.String("string"),
CommandEntry: pulumi.String("string"),
CommandName: pulumi.String("string"),
ObjectSwitchcontrollerManagedswitchCustomcommandId: pulumi.String("string"),
Scopetype: pulumi.String("string"),
})
Copy
var objectSwitchcontrollerManagedswitchCustomcommandResource = new ObjectSwitchcontrollerManagedswitchCustomcommand("objectSwitchcontrollerManagedswitchCustomcommandResource", ObjectSwitchcontrollerManagedswitchCustomcommandArgs.builder()
    .managedSwitch("string")
    .adom("string")
    .commandEntry("string")
    .commandName("string")
    .objectSwitchcontrollerManagedswitchCustomcommandId("string")
    .scopetype("string")
    .build());
Copy
object_switchcontroller_managedswitch_customcommand_resource = fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand("objectSwitchcontrollerManagedswitchCustomcommandResource",
    managed_switch="string",
    adom="string",
    command_entry="string",
    command_name="string",
    object_switchcontroller_managedswitch_customcommand_id="string",
    scopetype="string")
Copy
const objectSwitchcontrollerManagedswitchCustomcommandResource = new fortimanager.ObjectSwitchcontrollerManagedswitchCustomcommand("objectSwitchcontrollerManagedswitchCustomcommandResource", {
    managedSwitch: "string",
    adom: "string",
    commandEntry: "string",
    commandName: "string",
    objectSwitchcontrollerManagedswitchCustomcommandId: "string",
    scopetype: "string",
});
Copy
type: fortimanager:ObjectSwitchcontrollerManagedswitchCustomcommand
properties:
    adom: string
    commandEntry: string
    commandName: string
    managedSwitch: string
    objectSwitchcontrollerManagedswitchCustomcommandId: string
    scopetype: string
Copy

ObjectSwitchcontrollerManagedswitchCustomcommand Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ObjectSwitchcontrollerManagedswitchCustomcommand resource accepts the following input properties:

ManagedSwitch This property is required. string
Managed Switch.
Adom string
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
CommandEntry string
List of FortiSwitch commands.
CommandName string
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
ObjectSwitchcontrollerManagedswitchCustomcommandId string
an identifier for the resource with format {{command_entry}}.
Scopetype string
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
ManagedSwitch This property is required. string
Managed Switch.
Adom string
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
CommandEntry string
List of FortiSwitch commands.
CommandName string
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
ObjectSwitchcontrollerManagedswitchCustomcommandId string
an identifier for the resource with format {{command_entry}}.
Scopetype string
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
managedSwitch This property is required. String
Managed Switch.
adom String
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
commandEntry String
List of FortiSwitch commands.
commandName String
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
objectSwitchcontrollerManagedswitchCustomcommandId String
an identifier for the resource with format {{command_entry}}.
scopetype String
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
managedSwitch This property is required. string
Managed Switch.
adom string
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
commandEntry string
List of FortiSwitch commands.
commandName string
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
objectSwitchcontrollerManagedswitchCustomcommandId string
an identifier for the resource with format {{command_entry}}.
scopetype string
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
managed_switch This property is required. str
Managed Switch.
adom str
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
command_entry str
List of FortiSwitch commands.
command_name str
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
object_switchcontroller_managedswitch_customcommand_id str
an identifier for the resource with format {{command_entry}}.
scopetype str
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
managedSwitch This property is required. String
Managed Switch.
adom String
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
commandEntry String
List of FortiSwitch commands.
commandName String
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
objectSwitchcontrollerManagedswitchCustomcommandId String
an identifier for the resource with format {{command_entry}}.
scopetype String
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.

Outputs

All input properties are implicitly available as output properties. Additionally, the ObjectSwitchcontrollerManagedswitchCustomcommand resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ObjectSwitchcontrollerManagedswitchCustomcommand Resource

Get an existing ObjectSwitchcontrollerManagedswitchCustomcommand resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ObjectSwitchcontrollerManagedswitchCustomcommandState, opts?: CustomResourceOptions): ObjectSwitchcontrollerManagedswitchCustomcommand
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        adom: Optional[str] = None,
        command_entry: Optional[str] = None,
        command_name: Optional[str] = None,
        managed_switch: Optional[str] = None,
        object_switchcontroller_managedswitch_customcommand_id: Optional[str] = None,
        scopetype: Optional[str] = None) -> ObjectSwitchcontrollerManagedswitchCustomcommand
func GetObjectSwitchcontrollerManagedswitchCustomcommand(ctx *Context, name string, id IDInput, state *ObjectSwitchcontrollerManagedswitchCustomcommandState, opts ...ResourceOption) (*ObjectSwitchcontrollerManagedswitchCustomcommand, error)
public static ObjectSwitchcontrollerManagedswitchCustomcommand Get(string name, Input<string> id, ObjectSwitchcontrollerManagedswitchCustomcommandState? state, CustomResourceOptions? opts = null)
public static ObjectSwitchcontrollerManagedswitchCustomcommand get(String name, Output<String> id, ObjectSwitchcontrollerManagedswitchCustomcommandState state, CustomResourceOptions options)
resources:  _:    type: fortimanager:ObjectSwitchcontrollerManagedswitchCustomcommand    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Adom string
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
CommandEntry string
List of FortiSwitch commands.
CommandName string
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
ManagedSwitch string
Managed Switch.
ObjectSwitchcontrollerManagedswitchCustomcommandId string
an identifier for the resource with format {{command_entry}}.
Scopetype string
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
Adom string
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
CommandEntry string
List of FortiSwitch commands.
CommandName string
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
ManagedSwitch string
Managed Switch.
ObjectSwitchcontrollerManagedswitchCustomcommandId string
an identifier for the resource with format {{command_entry}}.
Scopetype string
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
adom String
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
commandEntry String
List of FortiSwitch commands.
commandName String
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
managedSwitch String
Managed Switch.
objectSwitchcontrollerManagedswitchCustomcommandId String
an identifier for the resource with format {{command_entry}}.
scopetype String
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
adom string
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
commandEntry string
List of FortiSwitch commands.
commandName string
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
managedSwitch string
Managed Switch.
objectSwitchcontrollerManagedswitchCustomcommandId string
an identifier for the resource with format {{command_entry}}.
scopetype string
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
adom str
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
command_entry str
List of FortiSwitch commands.
command_name str
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
managed_switch str
Managed Switch.
object_switchcontroller_managedswitch_customcommand_id str
an identifier for the resource with format {{command_entry}}.
scopetype str
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.
adom String
Adom. This value is valid only when the scopetype is adom, otherwise the value of adom in the provider will be inherited.
commandEntry String
List of FortiSwitch commands.
commandName String
Names of commands to be pushed to this FortiSwitch device, as configured under config switch-controller custom-command.
managedSwitch String
Managed Switch.
objectSwitchcontrollerManagedswitchCustomcommandId String
an identifier for the resource with format {{command_entry}}.
scopetype String
The scope of application of the resource. Valid values: inherit, adom, global. The inherit means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is inherit.

Import

ObjectSwitchController ManagedSwitchCustomCommand can be imported using any of these accepted formats:

Set import_options = [“managed_switch=YOUR_VALUE”] in the provider section.

$ export “FORTIMANAGER_IMPORT_TABLE”=“true”

$ pulumi import fortimanager:index/objectSwitchcontrollerManagedswitchCustomcommand:ObjectSwitchcontrollerManagedswitchCustomcommand labelname {{command_entry}}
Copy

$ unset “FORTIMANAGER_IMPORT_TABLE”

-> Hint: The scopetype and adom for import will directly inherit the scopetype and adom configuration of the provider.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
fortimanager fortinetdev/terraform-provider-fortimanager
License
Notes
This Pulumi package is based on the fortimanager Terraform Provider.