SecurityGroupEgressRuleArgs

data class SecurityGroupEgressRuleArgs(val cidrIpv4: Output<String>? = null, val cidrIpv6: Output<String>? = null, val description: Output<String>? = null, val fromPort: Output<Int>? = null, val ipProtocol: Output<String>? = null, val prefixListId: Output<String>? = null, val referencedSecurityGroupId: Output<String>? = null, val securityGroupId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val toPort: Output<Int>? = null) : ConvertibleToJava<SecurityGroupEgressRuleArgs>

Manages an outbound (egress) rule for a security group. When specifying an outbound rule for your security group in a VPC, the configuration must include a destination for the traffic.

NOTE on Security Groups and Security Group Rules: this provider currently provides a Security Group resource with ingress and egress rules defined in-line and a Security Group Rule resource which manages one or more ingress or egress rules. Both of these resource were added before AWS assigned a security group rule unique ID, and they do not work well in all scenarios using thedescription and tags attributes, which rely on the unique ID. The aws.vpc.SecurityGroupEgressRule resource has been added to address these limitations and should be used for all new security group rules. You should not use the aws.vpc.SecurityGroupEgressRule resource in conjunction with an aws.ec2.SecurityGroup resource with in-line rules or with aws.ec2.SecurityGroupRule resources defined for the same Security Group, as rule conflicts may occur and rules will be overwritten.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.vpc.SecurityGroupEgressRule;
import com.pulumi.aws.vpc.SecurityGroupEgressRuleArgs;
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) {
var example = new SecurityGroupEgressRule("example", SecurityGroupEgressRuleArgs.builder()
.securityGroupId(aws_security_group.example().id())
.cidrIpv4("10.0.0.0/8")
.fromPort(80)
.ipProtocol("tcp")
.toPort(80)
.build());
}
}

Import

Using pulumi import, import security group egress rules using the security_group_rule_id. For example:

$ pulumi import aws:vpc/securityGroupEgressRule:SecurityGroupEgressRule example sgr-02108b27edd666983

Constructors

Link copied to clipboard
fun SecurityGroupEgressRuleArgs(cidrIpv4: Output<String>? = null, cidrIpv6: Output<String>? = null, description: Output<String>? = null, fromPort: Output<Int>? = null, ipProtocol: Output<String>? = null, prefixListId: Output<String>? = null, referencedSecurityGroupId: Output<String>? = null, securityGroupId: Output<String>? = null, tags: Output<Map<String, String>>? = null, toPort: Output<Int>? = null)

Functions

Link copied to clipboard
open override fun toJava(): SecurityGroupEgressRuleArgs

Properties

Link copied to clipboard
val cidrIpv4: Output<String>? = null

The destination IPv4 CIDR range.

Link copied to clipboard
val cidrIpv6: Output<String>? = null

The destination IPv6 CIDR range.

Link copied to clipboard
val description: Output<String>? = null

The security group rule description.

Link copied to clipboard
val fromPort: Output<Int>? = null

The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.

Link copied to clipboard
val ipProtocol: Output<String>? = null

The IP protocol name or number. Use -1 to specify all protocols. Note that if ip_protocol is set to -1, it translates to all protocols, all port ranges, and from_port and to_port values should not be defined.

Link copied to clipboard
val prefixListId: Output<String>? = null

The ID of the destination prefix list.

Link copied to clipboard
val referencedSecurityGroupId: Output<String>? = null

The destination security group that is referenced in the rule.

Link copied to clipboard
val securityGroupId: Output<String>? = null

The ID of the security group.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val toPort: Output<Int>? = null

The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.