1. Packages
  2. Gcore Provider
  3. API Docs
  4. PortSecurity
gcore 0.32.0 published on Tuesday, Nov 18, 2025 by g-core
gcore logo
gcore 0.32.0 published on Tuesday, Nov 18, 2025 by g-core

    Manages security for any private port attached to a Virtual Instance.

    Create PortSecurity Resource

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

    Constructor syntax

    new PortSecurity(name: string, args: PortSecurityArgs, opts?: CustomResourceOptions);
    @overload
    def PortSecurity(resource_name: str,
                     args: PortSecurityArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def PortSecurity(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     port_id: Optional[str] = None,
                     enable_port_security: Optional[bool] = None,
                     port_security_id: Optional[str] = None,
                     project_id: Optional[float] = None,
                     project_name: Optional[str] = None,
                     region_id: Optional[float] = None,
                     region_name: Optional[str] = None)
    func NewPortSecurity(ctx *Context, name string, args PortSecurityArgs, opts ...ResourceOption) (*PortSecurity, error)
    public PortSecurity(string name, PortSecurityArgs args, CustomResourceOptions? opts = null)
    public PortSecurity(String name, PortSecurityArgs args)
    public PortSecurity(String name, PortSecurityArgs args, CustomResourceOptions options)
    
    type: gcore:PortSecurity
    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 PortSecurityArgs
    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 PortSecurityArgs
    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 PortSecurityArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PortSecurityArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PortSecurityArgs
    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 portSecurityResource = new Gcore.PortSecurity("portSecurityResource", new()
    {
        PortId = "string",
        EnablePortSecurity = false,
        PortSecurityId = "string",
        ProjectId = 0,
        ProjectName = "string",
        RegionId = 0,
        RegionName = "string",
    });
    
    example, err := gcore.NewPortSecurity(ctx, "portSecurityResource", &gcore.PortSecurityArgs{
    	PortId:             pulumi.String("string"),
    	EnablePortSecurity: pulumi.Bool(false),
    	PortSecurityId:     pulumi.String("string"),
    	ProjectId:          pulumi.Float64(0),
    	ProjectName:        pulumi.String("string"),
    	RegionId:           pulumi.Float64(0),
    	RegionName:         pulumi.String("string"),
    })
    
    var portSecurityResource = new PortSecurity("portSecurityResource", PortSecurityArgs.builder()
        .portId("string")
        .enablePortSecurity(false)
        .portSecurityId("string")
        .projectId(0.0)
        .projectName("string")
        .regionId(0.0)
        .regionName("string")
        .build());
    
    port_security_resource = gcore.PortSecurity("portSecurityResource",
        port_id="string",
        enable_port_security=False,
        port_security_id="string",
        project_id=0,
        project_name="string",
        region_id=0,
        region_name="string")
    
    const portSecurityResource = new gcore.PortSecurity("portSecurityResource", {
        portId: "string",
        enablePortSecurity: false,
        portSecurityId: "string",
        projectId: 0,
        projectName: "string",
        regionId: 0,
        regionName: "string",
    });
    
    type: gcore:PortSecurity
    properties:
        enablePortSecurity: false
        portId: string
        portSecurityId: string
        projectId: 0
        projectName: string
        regionId: 0
        regionName: string
    

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

    PortId string
    ID of the port where allowed address pairs will be managed.
    EnablePortSecurity bool
    Enable port security for the port.
    PortSecurityId string
    The ID of this resource.
    ProjectId double
    Project ID in which the port exists.
    ProjectName string
    Project name in which the port exists.
    RegionId double
    Region ID where the port is located.
    RegionName string
    Region name where the port is located.
    PortId string
    ID of the port where allowed address pairs will be managed.
    EnablePortSecurity bool
    Enable port security for the port.
    PortSecurityId string
    The ID of this resource.
    ProjectId float64
    Project ID in which the port exists.
    ProjectName string
    Project name in which the port exists.
    RegionId float64
    Region ID where the port is located.
    RegionName string
    Region name where the port is located.
    portId String
    ID of the port where allowed address pairs will be managed.
    enablePortSecurity Boolean
    Enable port security for the port.
    portSecurityId String
    The ID of this resource.
    projectId Double
    Project ID in which the port exists.
    projectName String
    Project name in which the port exists.
    regionId Double
    Region ID where the port is located.
    regionName String
    Region name where the port is located.
    portId string
    ID of the port where allowed address pairs will be managed.
    enablePortSecurity boolean
    Enable port security for the port.
    portSecurityId string
    The ID of this resource.
    projectId number
    Project ID in which the port exists.
    projectName string
    Project name in which the port exists.
    regionId number
    Region ID where the port is located.
    regionName string
    Region name where the port is located.
    port_id str
    ID of the port where allowed address pairs will be managed.
    enable_port_security bool
    Enable port security for the port.
    port_security_id str
    The ID of this resource.
    project_id float
    Project ID in which the port exists.
    project_name str
    Project name in which the port exists.
    region_id float
    Region ID where the port is located.
    region_name str
    Region name where the port is located.
    portId String
    ID of the port where allowed address pairs will be managed.
    enablePortSecurity Boolean
    Enable port security for the port.
    portSecurityId String
    The ID of this resource.
    projectId Number
    Project ID in which the port exists.
    projectName String
    Project name in which the port exists.
    regionId Number
    Region ID where the port is located.
    regionName String
    Region name where the port is located.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PortSecurity 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 PortSecurity Resource

    Get an existing PortSecurity 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?: PortSecurityState, opts?: CustomResourceOptions): PortSecurity
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enable_port_security: Optional[bool] = None,
            port_id: Optional[str] = None,
            port_security_id: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None) -> PortSecurity
    func GetPortSecurity(ctx *Context, name string, id IDInput, state *PortSecurityState, opts ...ResourceOption) (*PortSecurity, error)
    public static PortSecurity Get(string name, Input<string> id, PortSecurityState? state, CustomResourceOptions? opts = null)
    public static PortSecurity get(String name, Output<String> id, PortSecurityState state, CustomResourceOptions options)
    resources:  _:    type: gcore:PortSecurity    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:
    EnablePortSecurity bool
    Enable port security for the port.
    PortId string
    ID of the port where allowed address pairs will be managed.
    PortSecurityId string
    The ID of this resource.
    ProjectId double
    Project ID in which the port exists.
    ProjectName string
    Project name in which the port exists.
    RegionId double
    Region ID where the port is located.
    RegionName string
    Region name where the port is located.
    EnablePortSecurity bool
    Enable port security for the port.
    PortId string
    ID of the port where allowed address pairs will be managed.
    PortSecurityId string
    The ID of this resource.
    ProjectId float64
    Project ID in which the port exists.
    ProjectName string
    Project name in which the port exists.
    RegionId float64
    Region ID where the port is located.
    RegionName string
    Region name where the port is located.
    enablePortSecurity Boolean
    Enable port security for the port.
    portId String
    ID of the port where allowed address pairs will be managed.
    portSecurityId String
    The ID of this resource.
    projectId Double
    Project ID in which the port exists.
    projectName String
    Project name in which the port exists.
    regionId Double
    Region ID where the port is located.
    regionName String
    Region name where the port is located.
    enablePortSecurity boolean
    Enable port security for the port.
    portId string
    ID of the port where allowed address pairs will be managed.
    portSecurityId string
    The ID of this resource.
    projectId number
    Project ID in which the port exists.
    projectName string
    Project name in which the port exists.
    regionId number
    Region ID where the port is located.
    regionName string
    Region name where the port is located.
    enable_port_security bool
    Enable port security for the port.
    port_id str
    ID of the port where allowed address pairs will be managed.
    port_security_id str
    The ID of this resource.
    project_id float
    Project ID in which the port exists.
    project_name str
    Project name in which the port exists.
    region_id float
    Region ID where the port is located.
    region_name str
    Region name where the port is located.
    enablePortSecurity Boolean
    Enable port security for the port.
    portId String
    ID of the port where allowed address pairs will be managed.
    portSecurityId String
    The ID of this resource.
    projectId Number
    Project ID in which the port exists.
    projectName String
    Project name in which the port exists.
    regionId Number
    Region ID where the port is located.
    regionName String
    Region name where the port is located.

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.32.0 published on Tuesday, Nov 18, 2025 by g-core
      Meet Neo: Your AI Platform Teammate