1. Packages
  2. Ibm Provider
  3. API Docs
  4. PiNetworkSecurityGroupAction
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.PiNetworkSecurityGroupAction

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Enable or disable a network security group in your workspace.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const networkSecurityGroupAction = new ibm.PiNetworkSecurityGroupAction("networkSecurityGroupAction", {
        piAction: "enable",
        piCloudInstanceId: "<value of the cloud_instance_id>",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    network_security_group_action = ibm.PiNetworkSecurityGroupAction("networkSecurityGroupAction",
        pi_action="enable",
        pi_cloud_instance_id="<value of the cloud_instance_id>")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewPiNetworkSecurityGroupAction(ctx, "networkSecurityGroupAction", &ibm.PiNetworkSecurityGroupActionArgs{
    			PiAction:          pulumi.String("enable"),
    			PiCloudInstanceId: pulumi.String("<value of the cloud_instance_id>"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var networkSecurityGroupAction = new Ibm.PiNetworkSecurityGroupAction("networkSecurityGroupAction", new()
        {
            PiAction = "enable",
            PiCloudInstanceId = "<value of the cloud_instance_id>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.PiNetworkSecurityGroupAction;
    import com.pulumi.ibm.PiNetworkSecurityGroupActionArgs;
    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 networkSecurityGroupAction = new PiNetworkSecurityGroupAction("networkSecurityGroupAction", PiNetworkSecurityGroupActionArgs.builder()
                .piAction("enable")
                .piCloudInstanceId("<value of the cloud_instance_id>")
                .build());
    
        }
    }
    
    resources:
      networkSecurityGroupAction:
        type: ibm:PiNetworkSecurityGroupAction
        properties:
          piAction: enable
          piCloudInstanceId: <value of the cloud_instance_id>
    

    Notes

    • Please find supported Regions for endpoints.
    • If a Power cloud instance is provisioned at lon04, The provider level attributes should be as follows:
      • region - lon
      • zone - lon04

    Example usage:

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    Create PiNetworkSecurityGroupAction Resource

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

    Constructor syntax

    new PiNetworkSecurityGroupAction(name: string, args: PiNetworkSecurityGroupActionArgs, opts?: CustomResourceOptions);
    @overload
    def PiNetworkSecurityGroupAction(resource_name: str,
                                     args: PiNetworkSecurityGroupActionArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def PiNetworkSecurityGroupAction(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     pi_action: Optional[str] = None,
                                     pi_cloud_instance_id: Optional[str] = None,
                                     pi_network_security_group_action_id: Optional[str] = None,
                                     timeouts: Optional[PiNetworkSecurityGroupActionTimeoutsArgs] = None)
    func NewPiNetworkSecurityGroupAction(ctx *Context, name string, args PiNetworkSecurityGroupActionArgs, opts ...ResourceOption) (*PiNetworkSecurityGroupAction, error)
    public PiNetworkSecurityGroupAction(string name, PiNetworkSecurityGroupActionArgs args, CustomResourceOptions? opts = null)
    public PiNetworkSecurityGroupAction(String name, PiNetworkSecurityGroupActionArgs args)
    public PiNetworkSecurityGroupAction(String name, PiNetworkSecurityGroupActionArgs args, CustomResourceOptions options)
    
    type: ibm:PiNetworkSecurityGroupAction
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PiNetworkSecurityGroupActionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PiNetworkSecurityGroupActionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PiNetworkSecurityGroupActionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PiNetworkSecurityGroupActionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PiNetworkSecurityGroupActionArgs
    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 piNetworkSecurityGroupActionResource = new Ibm.PiNetworkSecurityGroupAction("piNetworkSecurityGroupActionResource", new()
    {
        PiAction = "string",
        PiCloudInstanceId = "string",
        PiNetworkSecurityGroupActionId = "string",
        Timeouts = new Ibm.Inputs.PiNetworkSecurityGroupActionTimeoutsArgs
        {
            Create = "string",
            Update = "string",
        },
    });
    
    example, err := ibm.NewPiNetworkSecurityGroupAction(ctx, "piNetworkSecurityGroupActionResource", &ibm.PiNetworkSecurityGroupActionArgs{
    	PiAction:                       pulumi.String("string"),
    	PiCloudInstanceId:              pulumi.String("string"),
    	PiNetworkSecurityGroupActionId: pulumi.String("string"),
    	Timeouts: &ibm.PiNetworkSecurityGroupActionTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var piNetworkSecurityGroupActionResource = new PiNetworkSecurityGroupAction("piNetworkSecurityGroupActionResource", PiNetworkSecurityGroupActionArgs.builder()
        .piAction("string")
        .piCloudInstanceId("string")
        .piNetworkSecurityGroupActionId("string")
        .timeouts(PiNetworkSecurityGroupActionTimeoutsArgs.builder()
            .create("string")
            .update("string")
            .build())
        .build());
    
    pi_network_security_group_action_resource = ibm.PiNetworkSecurityGroupAction("piNetworkSecurityGroupActionResource",
        pi_action="string",
        pi_cloud_instance_id="string",
        pi_network_security_group_action_id="string",
        timeouts={
            "create": "string",
            "update": "string",
        })
    
    const piNetworkSecurityGroupActionResource = new ibm.PiNetworkSecurityGroupAction("piNetworkSecurityGroupActionResource", {
        piAction: "string",
        piCloudInstanceId: "string",
        piNetworkSecurityGroupActionId: "string",
        timeouts: {
            create: "string",
            update: "string",
        },
    });
    
    type: ibm:PiNetworkSecurityGroupAction
    properties:
        piAction: string
        piCloudInstanceId: string
        piNetworkSecurityGroupActionId: string
        timeouts:
            create: string
            update: string
    

    PiNetworkSecurityGroupAction 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 PiNetworkSecurityGroupAction resource accepts the following input properties:

    PiAction string
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiNetworkSecurityGroupActionId string
    Timeouts PiNetworkSecurityGroupActionTimeouts
    PiAction string
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiNetworkSecurityGroupActionId string
    Timeouts PiNetworkSecurityGroupActionTimeoutsArgs
    piAction String
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piNetworkSecurityGroupActionId String
    timeouts PiNetworkSecurityGroupActionTimeouts
    piAction string
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piNetworkSecurityGroupActionId string
    timeouts PiNetworkSecurityGroupActionTimeouts
    pi_action str
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_network_security_group_action_id str
    timeouts PiNetworkSecurityGroupActionTimeoutsArgs
    piAction String
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piNetworkSecurityGroupActionId String
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    (String) The workspace network security group's state.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    (String) The workspace network security group's state.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    (String) The workspace network security group's state.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    (String) The workspace network security group's state.
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    (String) The workspace network security group's state.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    (String) The workspace network security group's state.

    Look up Existing PiNetworkSecurityGroupAction Resource

    Get an existing PiNetworkSecurityGroupAction 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?: PiNetworkSecurityGroupActionState, opts?: CustomResourceOptions): PiNetworkSecurityGroupAction
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            pi_action: Optional[str] = None,
            pi_cloud_instance_id: Optional[str] = None,
            pi_network_security_group_action_id: Optional[str] = None,
            state: Optional[str] = None,
            timeouts: Optional[PiNetworkSecurityGroupActionTimeoutsArgs] = None) -> PiNetworkSecurityGroupAction
    func GetPiNetworkSecurityGroupAction(ctx *Context, name string, id IDInput, state *PiNetworkSecurityGroupActionState, opts ...ResourceOption) (*PiNetworkSecurityGroupAction, error)
    public static PiNetworkSecurityGroupAction Get(string name, Input<string> id, PiNetworkSecurityGroupActionState? state, CustomResourceOptions? opts = null)
    public static PiNetworkSecurityGroupAction get(String name, Output<String> id, PiNetworkSecurityGroupActionState state, CustomResourceOptions options)
    resources:  _:    type: ibm:PiNetworkSecurityGroupAction    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    PiAction string
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiNetworkSecurityGroupActionId string
    State string
    (String) The workspace network security group's state.
    Timeouts PiNetworkSecurityGroupActionTimeouts
    PiAction string
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiNetworkSecurityGroupActionId string
    State string
    (String) The workspace network security group's state.
    Timeouts PiNetworkSecurityGroupActionTimeoutsArgs
    piAction String
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piNetworkSecurityGroupActionId String
    state String
    (String) The workspace network security group's state.
    timeouts PiNetworkSecurityGroupActionTimeouts
    piAction string
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piNetworkSecurityGroupActionId string
    state string
    (String) The workspace network security group's state.
    timeouts PiNetworkSecurityGroupActionTimeouts
    pi_action str
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_network_security_group_action_id str
    state str
    (String) The workspace network security group's state.
    timeouts PiNetworkSecurityGroupActionTimeoutsArgs
    piAction String
    Name of the action to take; can be enable to enable NSGs in a workspace or disable to disable NSGs in a workspace. Supported values are: enable, disable.
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piNetworkSecurityGroupActionId String
    state String
    (String) The workspace network security group's state.
    timeouts Property Map

    Supporting Types

    PiNetworkSecurityGroupActionTimeouts, PiNetworkSecurityGroupActionTimeoutsArgs

    Create string
    Update string
    Create string
    Update string
    create String
    update String
    create string
    update string
    create str
    update str
    create String
    update String

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud