@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
177 lines (176 loc) • 6.56 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* ## 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<pulumi.ID>, 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<string[]>;
/**
* Whether to replace or append the list of security
* groups, specified in the `securityGroupIds`. Defaults to `false`.
*/
readonly enforce: pulumi.Output<boolean | undefined>;
/**
* An UUID of the port to apply security groups to.
*/
readonly portId: pulumi.Output<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.
*/
readonly region: pulumi.Output<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).
*/
readonly securityGroupIds: pulumi.Output<string[]>;
/**
* 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<pulumi.Input<string>[]>;
/**
* Whether to replace or append the list of security
* groups, specified in the `securityGroupIds`. Defaults to `false`.
*/
enforce?: pulumi.Input<boolean>;
/**
* An UUID of the port to apply security groups to.
*/
portId?: pulumi.Input<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.
*/
region?: pulumi.Input<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).
*/
securityGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* 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<boolean>;
/**
* An UUID of the port to apply security groups to.
*/
portId: pulumi.Input<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.
*/
region?: pulumi.Input<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).
*/
securityGroupIds: pulumi.Input<pulumi.Input<string>[]>;
}