import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * This resource provides the Network Security Group Security Rule resource in Oracle Cloud Infrastructure Core service. * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/iaas/latest/NetworkSecurityGroupSecurityRule * * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/ * * Adds up to 25 security rules to the specified network security group. Adding more than 25 rules requires multiple operations. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testNetworkSecurityGroupSecurityRule = new oci.core.NetworkSecurityGroupSecurityRule("test_network_security_group_security_rule", { * networkSecurityGroupId: testNetworkSecurityGroup.id, * direction: networkSecurityGroupSecurityRuleDirection, * protocol: networkSecurityGroupSecurityRuleProtocol, * description: networkSecurityGroupSecurityRuleDescription, * destination: networkSecurityGroupSecurityRuleDestination, * destinationType: networkSecurityGroupSecurityRuleDestinationType, * icmpOptions: { * type: Number(networkSecurityGroupSecurityRuleIcmpOptionsType), * code: Number(networkSecurityGroupSecurityRuleIcmpOptionsCode), * }, * source: networkSecurityGroupSecurityRuleSource, * sourceType: networkSecurityGroupSecurityRuleSourceType, * stateless: networkSecurityGroupSecurityRuleStateless === "true", * tcpOptions: { * destinationPortRange: { * max: Number(networkSecurityGroupSecurityRuleTcpOptionsDestinationPortRangeMax), * min: Number(networkSecurityGroupSecurityRuleTcpOptionsDestinationPortRangeMin), * }, * sourcePortRange: { * max: Number(networkSecurityGroupSecurityRuleTcpOptionsSourcePortRangeMax), * min: Number(networkSecurityGroupSecurityRuleTcpOptionsSourcePortRangeMin), * }, * }, * udpOptions: { * destinationPortRange: { * max: Number(networkSecurityGroupSecurityRuleUdpOptionsDestinationPortRangeMax), * min: Number(networkSecurityGroupSecurityRuleUdpOptionsDestinationPortRangeMin), * }, * sourcePortRange: { * max: Number(networkSecurityGroupSecurityRuleUdpOptionsSourcePortRangeMax), * min: Number(networkSecurityGroupSecurityRuleUdpOptionsSourcePortRangeMin), * }, * }, * }); * ``` * * ## Import * * NetworkSecurityGroupSecurityRule can be imported using the `id`, e.g. * * ```sh * $ pulumi import oci:Core/networkSecurityGroupSecurityRule:NetworkSecurityGroupSecurityRule test_network_security_group_security_rule "networkSecurityGroups/{networkSecurityGroupId}/securityRules/{securityRuleId}" * ``` */ export declare class NetworkSecurityGroupSecurityRule extends pulumi.CustomResource { /** * Get an existing NetworkSecurityGroupSecurityRule 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?: NetworkSecurityGroupSecurityRuleState, opts?: pulumi.CustomResourceOptions): NetworkSecurityGroupSecurityRule; /** * Returns true if the given object is an instance of NetworkSecurityGroupSecurityRule. 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 NetworkSecurityGroupSecurityRule; /** * An optional description of your choice for the rule. */ readonly description: pulumi.Output; /** * Conceptually, this is the range of IP addresses that a packet originating from the instance can go to. */ readonly destination: pulumi.Output; /** * Type of destination for the rule. Required if `direction` = `EGRESS`. */ readonly destinationType: pulumi.Output; /** * Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets. */ readonly direction: pulumi.Output; /** * Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: * * [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) * * [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) */ readonly icmpOptions: pulumi.Output; /** * Whether the rule is valid. The value is `True` when the rule is first created. If the rule's `source` or `destination` is a network security group, the value changes to `False` if that network security group is deleted. */ readonly isValid: pulumi.Output; /** * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the network security group. */ readonly networkSecurityGroupId: pulumi.Output; /** * The transport protocol. Specify either `all` or an IPv4 protocol number as defined in [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). */ readonly protocol: pulumi.Output; /** * Conceptually, this is the range of IP addresses that a packet coming into the instance can come from. */ readonly source: pulumi.Output; /** * Type of source for the rule. Required if `direction` = `INGRESS`. * * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. * * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a [Service](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/Service/) (the rule is for traffic coming from a particular `Service` through a service gateway). * * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a [NetworkSecurityGroup](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/NetworkSecurityGroup/). */ readonly sourceType: pulumi.Output; /** * A stateless rule allows traffic in one direction. Remember to add a corresponding stateless rule in the other direction if you need to support bidirectional traffic. For example, if egress traffic allows TCP destination port 80, there should be an ingress rule to allow TCP source port 80. Defaults to false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic. */ readonly stateless: pulumi.Output; /** * Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. If you specify TCP as the protocol but omit this object, then all destination ports are allowed. */ readonly tcpOptions: pulumi.Output; /** * The date and time the security rule was created. Format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). */ readonly timeCreated: pulumi.Output; /** * Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. If you specify UDP as the protocol but omit this object, then all destination ports are allowed. */ readonly udpOptions: pulumi.Output; /** * Create a NetworkSecurityGroupSecurityRule 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: NetworkSecurityGroupSecurityRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NetworkSecurityGroupSecurityRule resources. */ export interface NetworkSecurityGroupSecurityRuleState { /** * An optional description of your choice for the rule. */ description?: pulumi.Input; /** * Conceptually, this is the range of IP addresses that a packet originating from the instance can go to. */ destination?: pulumi.Input; /** * Type of destination for the rule. Required if `direction` = `EGRESS`. */ destinationType?: pulumi.Input; /** * Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets. */ direction?: pulumi.Input; /** * Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: * * [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) * * [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) */ icmpOptions?: pulumi.Input; /** * Whether the rule is valid. The value is `True` when the rule is first created. If the rule's `source` or `destination` is a network security group, the value changes to `False` if that network security group is deleted. */ isValid?: pulumi.Input; /** * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the network security group. */ networkSecurityGroupId?: pulumi.Input; /** * The transport protocol. Specify either `all` or an IPv4 protocol number as defined in [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). */ protocol?: pulumi.Input; /** * Conceptually, this is the range of IP addresses that a packet coming into the instance can come from. */ source?: pulumi.Input; /** * Type of source for the rule. Required if `direction` = `INGRESS`. * * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. * * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a [Service](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/Service/) (the rule is for traffic coming from a particular `Service` through a service gateway). * * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a [NetworkSecurityGroup](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/NetworkSecurityGroup/). */ sourceType?: pulumi.Input; /** * A stateless rule allows traffic in one direction. Remember to add a corresponding stateless rule in the other direction if you need to support bidirectional traffic. For example, if egress traffic allows TCP destination port 80, there should be an ingress rule to allow TCP source port 80. Defaults to false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic. */ stateless?: pulumi.Input; /** * Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. If you specify TCP as the protocol but omit this object, then all destination ports are allowed. */ tcpOptions?: pulumi.Input; /** * The date and time the security rule was created. Format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). */ timeCreated?: pulumi.Input; /** * Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. If you specify UDP as the protocol but omit this object, then all destination ports are allowed. */ udpOptions?: pulumi.Input; } /** * The set of arguments for constructing a NetworkSecurityGroupSecurityRule resource. */ export interface NetworkSecurityGroupSecurityRuleArgs { /** * An optional description of your choice for the rule. */ description?: pulumi.Input; /** * Conceptually, this is the range of IP addresses that a packet originating from the instance can go to. */ destination?: pulumi.Input; /** * Type of destination for the rule. Required if `direction` = `EGRESS`. */ destinationType?: pulumi.Input; /** * Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets. */ direction: pulumi.Input; /** * Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code as defined in: * * [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) * * [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) */ icmpOptions?: pulumi.Input; /** * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the network security group. */ networkSecurityGroupId: pulumi.Input; /** * The transport protocol. Specify either `all` or an IPv4 protocol number as defined in [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). */ protocol: pulumi.Input; /** * Conceptually, this is the range of IP addresses that a packet coming into the instance can come from. */ source?: pulumi.Input; /** * Type of source for the rule. Required if `direction` = `INGRESS`. * * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. * * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a [Service](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/Service/) (the rule is for traffic coming from a particular `Service` through a service gateway). * * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a [NetworkSecurityGroup](https://docs.cloud.oracle.com/iaas/api/#/en/iaas/latest/NetworkSecurityGroup/). */ sourceType?: pulumi.Input; /** * A stateless rule allows traffic in one direction. Remember to add a corresponding stateless rule in the other direction if you need to support bidirectional traffic. For example, if egress traffic allows TCP destination port 80, there should be an ingress rule to allow TCP source port 80. Defaults to false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic. */ stateless?: pulumi.Input; /** * Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. If you specify TCP as the protocol but omit this object, then all destination ports are allowed. */ tcpOptions?: pulumi.Input; /** * Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. If you specify UDP as the protocol but omit this object, then all destination ports are allowed. */ udpOptions?: pulumi.Input; } //# sourceMappingURL=networkSecurityGroupSecurityRule.d.ts.map