import * as pulumi from "@pulumi/pulumi"; /** * Manages a V2 port's security groups within OpenStack. Useful, when the port was * not created by Terraform (e.g. Manila or LBaaS). * * When the resource is deleted, Terraform doesn't delete the port, but unsets the * list of user defined security group IDs. However, if `enforce` is set to `true` * and the resource is deleted, Terraform will remove all assigned security group * IDs. * * > **Warning:** This resource should **not** be used when the * port was created directly within Terraform. If it is, it can lead\ * to **security problems** with incorrect security groups on ports * * ## Example Usage * * ### Append a security group to an existing port * * ```typescript * 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)], * }); * ``` * * ### Enforce a security group to an existing port * * ```typescript * 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)], * }); * ``` * * ### Remove all security groups from an existing port * * ```typescript * 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: [], * }); * ``` * * ## Import * * Port security group association can be imported using the `id` of the port, e.g. * * ```sh * $ pulumi import openstack:networking/portSecGroupAssociate:PortSecGroupAssociate port_1 eae26a3e-1c33-4cc1-9c31-0cd729c438a1 * ``` */ export declare class PortSecGroupAssociate extends pulumi.CustomResource { /** * Get an existing PortSecGroupAssociate resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: PortSecGroupAssociateState, opts?: pulumi.CustomResourceOptions): PortSecGroupAssociate; /** * Returns true if the given object is an instance of PortSecGroupAssociate. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is PortSecGroupAssociate; /** * The collection of Security Group IDs on the port * which have been explicitly and implicitly added. */ readonly allSecurityGroupIds: pulumi.Output; /** * Whether to replace or append the list of security * groups, specified in the `securityGroupIds`. Defaults to `false`. */ readonly enforce: pulumi.Output; /** * An UUID of the port to apply security groups to. */ readonly portId: pulumi.Output; /** * 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. */ readonly region: pulumi.Output; /** * 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). */ readonly securityGroupIds: pulumi.Output; /** * Create a PortSecGroupAssociate resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: PortSecGroupAssociateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering PortSecGroupAssociate resources. */ export interface PortSecGroupAssociateState { /** * The collection of Security Group IDs on the port * which have been explicitly and implicitly added. */ allSecurityGroupIds?: pulumi.Input[] | undefined>; /** * Whether to replace or append the list of security * groups, specified in the `securityGroupIds`. Defaults to `false`. */ enforce?: pulumi.Input; /** * An UUID of the port to apply security groups to. */ portId?: pulumi.Input; /** * 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. */ region?: pulumi.Input; /** * 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). */ securityGroupIds?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a PortSecGroupAssociate resource. */ export interface PortSecGroupAssociateArgs { /** * Whether to replace or append the list of security * groups, specified in the `securityGroupIds`. Defaults to `false`. */ enforce?: pulumi.Input; /** * An UUID of the port to apply security groups to. */ portId: pulumi.Input; /** * 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. */ region?: pulumi.Input; /** * 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). */ securityGroupIds: pulumi.Input[]>; } //# sourceMappingURL=portSecGroupAssociate.d.ts.map