1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. PortSecGroupAssociate
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.networking.PortSecGroupAssociate

Explore with Pulumi AI

Example Usage

Append a security group to an existing port

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

const systemPort = openstack.networking.getPort({
    fixedIp: "10.0.0.10",
});
const secgroup = openstack.networking.getSecGroup({
    name: "secgroup",
});
const port1 = new openstack.networking.PortSecGroupAssociate("port_1", {
    portId: systemPort.then(systemPort => systemPort.id),
    securityGroupIds: [secgroup.then(secgroup => secgroup.id)],
});
Copy
import pulumi
import pulumi_openstack as openstack

system_port = openstack.networking.get_port(fixed_ip="10.0.0.10")
secgroup = openstack.networking.get_sec_group(name="secgroup")
port1 = openstack.networking.PortSecGroupAssociate("port_1",
    port_id=system_port.id,
    security_group_ids=[secgroup.id])
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		systemPort, err := networking.LookupPort(ctx, &networking.LookupPortArgs{
			FixedIp: pulumi.StringRef("10.0.0.10"),
		}, nil)
		if err != nil {
			return err
		}
		secgroup, err := networking.LookupSecGroup(ctx, &networking.LookupSecGroupArgs{
			Name: pulumi.StringRef("secgroup"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = networking.NewPortSecGroupAssociate(ctx, "port_1", &networking.PortSecGroupAssociateArgs{
			PortId: pulumi.String(systemPort.Id),
			SecurityGroupIds: pulumi.StringArray{
				pulumi.String(secgroup.Id),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var systemPort = OpenStack.Networking.GetPort.Invoke(new()
    {
        FixedIp = "10.0.0.10",
    });

    var secgroup = OpenStack.Networking.GetSecGroup.Invoke(new()
    {
        Name = "secgroup",
    });

    var port1 = new OpenStack.Networking.PortSecGroupAssociate("port_1", new()
    {
        PortId = systemPort.Apply(getPortResult => getPortResult.Id),
        SecurityGroupIds = new[]
        {
            secgroup.Apply(getSecGroupResult => getSecGroupResult.Id),
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.networking.NetworkingFunctions;
import com.pulumi.openstack.networking.inputs.GetPortArgs;
import com.pulumi.openstack.networking.inputs.GetSecGroupArgs;
import com.pulumi.openstack.networking.PortSecGroupAssociate;
import com.pulumi.openstack.networking.PortSecGroupAssociateArgs;
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) {
        final var systemPort = NetworkingFunctions.getPort(GetPortArgs.builder()
            .fixedIp("10.0.0.10")
            .build());

        final var secgroup = NetworkingFunctions.getSecGroup(GetSecGroupArgs.builder()
            .name("secgroup")
            .build());

        var port1 = new PortSecGroupAssociate("port1", PortSecGroupAssociateArgs.builder()
            .portId(systemPort.applyValue(getPortResult -> getPortResult.id()))
            .securityGroupIds(secgroup.applyValue(getSecGroupResult -> getSecGroupResult.id()))
            .build());

    }
}
Copy
resources:
  port1:
    type: openstack:networking:PortSecGroupAssociate
    name: port_1
    properties:
      portId: ${systemPort.id}
      securityGroupIds:
        - ${secgroup.id}
variables:
  systemPort:
    fn::invoke:
      function: openstack:networking:getPort
      arguments:
        fixedIp: 10.0.0.10
  secgroup:
    fn::invoke:
      function: openstack:networking:getSecGroup
      arguments:
        name: secgroup
Copy

Enforce a security group to an existing port

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

const systemPort = openstack.networking.getPort({
    fixedIp: "10.0.0.10",
});
const secgroup = openstack.networking.getSecGroup({
    name: "secgroup",
});
const port1 = new openstack.networking.PortSecGroupAssociate("port_1", {
    portId: systemPort.then(systemPort => systemPort.id),
    enforce: true,
    securityGroupIds: [secgroup.then(secgroup => secgroup.id)],
});
Copy
import pulumi
import pulumi_openstack as openstack

system_port = openstack.networking.get_port(fixed_ip="10.0.0.10")
secgroup = openstack.networking.get_sec_group(name="secgroup")
port1 = openstack.networking.PortSecGroupAssociate("port_1",
    port_id=system_port.id,
    enforce=True,
    security_group_ids=[secgroup.id])
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		systemPort, err := networking.LookupPort(ctx, &networking.LookupPortArgs{
			FixedIp: pulumi.StringRef("10.0.0.10"),
		}, nil)
		if err != nil {
			return err
		}
		secgroup, err := networking.LookupSecGroup(ctx, &networking.LookupSecGroupArgs{
			Name: pulumi.StringRef("secgroup"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = networking.NewPortSecGroupAssociate(ctx, "port_1", &networking.PortSecGroupAssociateArgs{
			PortId:  pulumi.String(systemPort.Id),
			Enforce: pulumi.Bool(true),
			SecurityGroupIds: pulumi.StringArray{
				pulumi.String(secgroup.Id),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var systemPort = OpenStack.Networking.GetPort.Invoke(new()
    {
        FixedIp = "10.0.0.10",
    });

    var secgroup = OpenStack.Networking.GetSecGroup.Invoke(new()
    {
        Name = "secgroup",
    });

    var port1 = new OpenStack.Networking.PortSecGroupAssociate("port_1", new()
    {
        PortId = systemPort.Apply(getPortResult => getPortResult.Id),
        Enforce = true,
        SecurityGroupIds = new[]
        {
            secgroup.Apply(getSecGroupResult => getSecGroupResult.Id),
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.networking.NetworkingFunctions;
import com.pulumi.openstack.networking.inputs.GetPortArgs;
import com.pulumi.openstack.networking.inputs.GetSecGroupArgs;
import com.pulumi.openstack.networking.PortSecGroupAssociate;
import com.pulumi.openstack.networking.PortSecGroupAssociateArgs;
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) {
        final var systemPort = NetworkingFunctions.getPort(GetPortArgs.builder()
            .fixedIp("10.0.0.10")
            .build());

        final var secgroup = NetworkingFunctions.getSecGroup(GetSecGroupArgs.builder()
            .name("secgroup")
            .build());

        var port1 = new PortSecGroupAssociate("port1", PortSecGroupAssociateArgs.builder()
            .portId(systemPort.applyValue(getPortResult -> getPortResult.id()))
            .enforce("true")
            .securityGroupIds(secgroup.applyValue(getSecGroupResult -> getSecGroupResult.id()))
            .build());

    }
}
Copy
resources:
  port1:
    type: openstack:networking:PortSecGroupAssociate
    name: port_1
    properties:
      portId: ${systemPort.id}
      enforce: 'true'
      securityGroupIds:
        - ${secgroup.id}
variables:
  systemPort:
    fn::invoke:
      function: openstack:networking:getPort
      arguments:
        fixedIp: 10.0.0.10
  secgroup:
    fn::invoke:
      function: openstack:networking:getSecGroup
      arguments:
        name: secgroup
Copy

Remove all security groups from an existing port

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

const systemPort = openstack.networking.getPort({
    fixedIp: "10.0.0.10",
});
const port1 = new openstack.networking.PortSecGroupAssociate("port_1", {
    portId: systemPort.then(systemPort => systemPort.id),
    enforce: true,
    securityGroupIds: [],
});
Copy
import pulumi
import pulumi_openstack as openstack

system_port = openstack.networking.get_port(fixed_ip="10.0.0.10")
port1 = openstack.networking.PortSecGroupAssociate("port_1",
    port_id=system_port.id,
    enforce=True,
    security_group_ids=[])
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		systemPort, err := networking.LookupPort(ctx, &networking.LookupPortArgs{
			FixedIp: pulumi.StringRef("10.0.0.10"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = networking.NewPortSecGroupAssociate(ctx, "port_1", &networking.PortSecGroupAssociateArgs{
			PortId:           pulumi.String(systemPort.Id),
			Enforce:          pulumi.Bool(true),
			SecurityGroupIds: pulumi.StringArray{},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var systemPort = OpenStack.Networking.GetPort.Invoke(new()
    {
        FixedIp = "10.0.0.10",
    });

    var port1 = new OpenStack.Networking.PortSecGroupAssociate("port_1", new()
    {
        PortId = systemPort.Apply(getPortResult => getPortResult.Id),
        Enforce = true,
        SecurityGroupIds = new[] {},
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.networking.NetworkingFunctions;
import com.pulumi.openstack.networking.inputs.GetPortArgs;
import com.pulumi.openstack.networking.PortSecGroupAssociate;
import com.pulumi.openstack.networking.PortSecGroupAssociateArgs;
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) {
        final var systemPort = NetworkingFunctions.getPort(GetPortArgs.builder()
            .fixedIp("10.0.0.10")
            .build());

        var port1 = new PortSecGroupAssociate("port1", PortSecGroupAssociateArgs.builder()
            .portId(systemPort.applyValue(getPortResult -> getPortResult.id()))
            .enforce("true")
            .securityGroupIds()
            .build());

    }
}
Copy
resources:
  port1:
    type: openstack:networking:PortSecGroupAssociate
    name: port_1
    properties:
      portId: ${systemPort.id}
      enforce: 'true'
      securityGroupIds: []
variables:
  systemPort:
    fn::invoke:
      function: openstack:networking:getPort
      arguments:
        fixedIp: 10.0.0.10
Copy

Create PortSecGroupAssociate Resource

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

Constructor syntax

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

@overload
def PortSecGroupAssociate(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          port_id: Optional[str] = None,
                          security_group_ids: Optional[Sequence[str]] = None,
                          enforce: Optional[bool] = None,
                          region: Optional[str] = None)
func NewPortSecGroupAssociate(ctx *Context, name string, args PortSecGroupAssociateArgs, opts ...ResourceOption) (*PortSecGroupAssociate, error)
public PortSecGroupAssociate(string name, PortSecGroupAssociateArgs args, CustomResourceOptions? opts = null)
public PortSecGroupAssociate(String name, PortSecGroupAssociateArgs args)
public PortSecGroupAssociate(String name, PortSecGroupAssociateArgs args, CustomResourceOptions options)
type: openstack:networking:PortSecGroupAssociate
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. PortSecGroupAssociateArgs
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. PortSecGroupAssociateArgs
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. PortSecGroupAssociateArgs
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. PortSecGroupAssociateArgs
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. PortSecGroupAssociateArgs
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 portSecGroupAssociateResource = new OpenStack.Networking.PortSecGroupAssociate("portSecGroupAssociateResource", new()
{
    PortId = "string",
    SecurityGroupIds = new[]
    {
        "string",
    },
    Enforce = false,
    Region = "string",
});
Copy
example, err := networking.NewPortSecGroupAssociate(ctx, "portSecGroupAssociateResource", &networking.PortSecGroupAssociateArgs{
	PortId: pulumi.String("string"),
	SecurityGroupIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	Enforce: pulumi.Bool(false),
	Region:  pulumi.String("string"),
})
Copy
var portSecGroupAssociateResource = new PortSecGroupAssociate("portSecGroupAssociateResource", PortSecGroupAssociateArgs.builder()
    .portId("string")
    .securityGroupIds("string")
    .enforce(false)
    .region("string")
    .build());
Copy
port_sec_group_associate_resource = openstack.networking.PortSecGroupAssociate("portSecGroupAssociateResource",
    port_id="string",
    security_group_ids=["string"],
    enforce=False,
    region="string")
Copy
const portSecGroupAssociateResource = new openstack.networking.PortSecGroupAssociate("portSecGroupAssociateResource", {
    portId: "string",
    securityGroupIds: ["string"],
    enforce: false,
    region: "string",
});
Copy
type: openstack:networking:PortSecGroupAssociate
properties:
    enforce: false
    portId: string
    region: string
    securityGroupIds:
        - string
Copy

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

PortId
This property is required.
Changes to this property will trigger replacement.
string
An UUID of the port to apply security groups to.
SecurityGroupIds This property is required. List<string>
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
Enforce bool
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
PortId
This property is required.
Changes to this property will trigger replacement.
string
An UUID of the port to apply security groups to.
SecurityGroupIds This property is required. []string
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
Enforce bool
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
portId
This property is required.
Changes to this property will trigger replacement.
String
An UUID of the port to apply security groups to.
securityGroupIds This property is required. List<String>
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
enforce Boolean
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
portId
This property is required.
Changes to this property will trigger replacement.
string
An UUID of the port to apply security groups to.
securityGroupIds This property is required. string[]
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
enforce boolean
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
region Changes to this property will trigger replacement. string
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
port_id
This property is required.
Changes to this property will trigger replacement.
str
An UUID of the port to apply security groups to.
security_group_ids This property is required. Sequence[str]
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
enforce bool
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
region Changes to this property will trigger replacement. str
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
portId
This property is required.
Changes to this property will trigger replacement.
String
An UUID of the port to apply security groups to.
securityGroupIds This property is required. List<String>
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
enforce Boolean
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.

Outputs

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

AllSecurityGroupIds List<string>
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
Id string
The provider-assigned unique ID for this managed resource.
AllSecurityGroupIds []string
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
Id string
The provider-assigned unique ID for this managed resource.
allSecurityGroupIds List<String>
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
id String
The provider-assigned unique ID for this managed resource.
allSecurityGroupIds string[]
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
id string
The provider-assigned unique ID for this managed resource.
all_security_group_ids Sequence[str]
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
id str
The provider-assigned unique ID for this managed resource.
allSecurityGroupIds List<String>
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing PortSecGroupAssociate Resource

Get an existing PortSecGroupAssociate 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?: PortSecGroupAssociateState, opts?: CustomResourceOptions): PortSecGroupAssociate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        all_security_group_ids: Optional[Sequence[str]] = None,
        enforce: Optional[bool] = None,
        port_id: Optional[str] = None,
        region: Optional[str] = None,
        security_group_ids: Optional[Sequence[str]] = None) -> PortSecGroupAssociate
func GetPortSecGroupAssociate(ctx *Context, name string, id IDInput, state *PortSecGroupAssociateState, opts ...ResourceOption) (*PortSecGroupAssociate, error)
public static PortSecGroupAssociate Get(string name, Input<string> id, PortSecGroupAssociateState? state, CustomResourceOptions? opts = null)
public static PortSecGroupAssociate get(String name, Output<String> id, PortSecGroupAssociateState state, CustomResourceOptions options)
resources:  _:    type: openstack:networking:PortSecGroupAssociate    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:
AllSecurityGroupIds List<string>
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
Enforce bool
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
PortId Changes to this property will trigger replacement. string
An UUID of the port to apply security groups to.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
SecurityGroupIds List<string>
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
AllSecurityGroupIds []string
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
Enforce bool
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
PortId Changes to this property will trigger replacement. string
An UUID of the port to apply security groups to.
Region Changes to this property will trigger replacement. string
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
SecurityGroupIds []string
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
allSecurityGroupIds List<String>
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
enforce Boolean
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
portId Changes to this property will trigger replacement. String
An UUID of the port to apply security groups to.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
securityGroupIds List<String>
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
allSecurityGroupIds string[]
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
enforce boolean
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
portId Changes to this property will trigger replacement. string
An UUID of the port to apply security groups to.
region Changes to this property will trigger replacement. string
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
securityGroupIds string[]
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
all_security_group_ids Sequence[str]
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
enforce bool
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
port_id Changes to this property will trigger replacement. str
An UUID of the port to apply security groups to.
region Changes to this property will trigger replacement. str
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
security_group_ids Sequence[str]
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
allSecurityGroupIds List<String>
The collection of Security Group IDs on the port which have been explicitly and implicitly added.
enforce Boolean
Whether to replace or append the list of security groups, specified in the security_group_ids. Defaults to false.
portId Changes to this property will trigger replacement. String
An UUID of the port to apply security groups to.
region Changes to this property will trigger replacement. String
The region in which to obtain the V2 networking client. A networking client is needed to manage a port. If omitted, the region argument of the provider is used. Changing this creates a new resource.
securityGroupIds List<String>
A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).

Import

Port security group association can be imported using the id of the port, e.g.

$ pulumi import openstack:networking/portSecGroupAssociate:PortSecGroupAssociate port_1 eae26a3e-1c33-4cc1-9c31-0cd729c438a1
Copy

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

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.