com.pulumi.aws.vpc.SecurityGroupEgressRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.vpc;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.vpc.SecurityGroupEgressRuleArgs;
import com.pulumi.aws.vpc.inputs.SecurityGroupEgressRuleState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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:** Using `aws.vpc.SecurityGroupEgressRule` and `aws.vpc.SecurityGroupIngressRule` resources is the current best practice. Avoid using the `aws.ec2.SecurityGroupRule` resource and the `ingress` and `egress` arguments of the `aws.ec2.SecurityGroup` resource for configuring in-line rules, as they struggle with managing multiple CIDR blocks, and tags and descriptions due to the historical lack of unique IDs.
*
* !> **WARNING:** You should not use the `aws.vpc.SecurityGroupEgressRule` and `aws.vpc.SecurityGroupIngressRule` resources in conjunction with the `aws.ec2.SecurityGroup` resource with _in-line rules_ (using the `ingress` and `egress` arguments of `aws.ec2.SecurityGroup`) or the `aws.ec2.SecurityGroupRule` resource. Doing so may cause rule conflicts, perpetual differences, and result in rules being overwritten.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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(exampleAwsSecurityGroup.id())
* .cidrIpv4("10.0.0.0/8")
* .fromPort(80)
* .ipProtocol("tcp")
* .toPort(80)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import security group egress rules using the `security_group_rule_id`. For example:
*
* ```sh
* $ pulumi import aws:vpc/securityGroupEgressRule:SecurityGroupEgressRule example sgr-02108b27edd666983
* ```
*
*/
@ResourceType(type="aws:vpc/securityGroupEgressRule:SecurityGroupEgressRule")
public class SecurityGroupEgressRule extends com.pulumi.resources.CustomResource {
/**
* The Amazon Resource Name (ARN) of the security group rule.
*
*/
@Export(name="arn", refs={String.class}, tree="[0]")
private Output arn;
/**
* @return The Amazon Resource Name (ARN) of the security group rule.
*
*/
public Output arn() {
return this.arn;
}
/**
* The destination IPv4 CIDR range.
*
*/
@Export(name="cidrIpv4", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> cidrIpv4;
/**
* @return The destination IPv4 CIDR range.
*
*/
public Output> cidrIpv4() {
return Codegen.optional(this.cidrIpv4);
}
/**
* The destination IPv6 CIDR range.
*
*/
@Export(name="cidrIpv6", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> cidrIpv6;
/**
* @return The destination IPv6 CIDR range.
*
*/
public Output> cidrIpv6() {
return Codegen.optional(this.cidrIpv6);
}
/**
* The security group rule description.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> description;
/**
* @return The security group rule description.
*
*/
public Output> description() {
return Codegen.optional(this.description);
}
/**
* The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
*
*/
@Export(name="fromPort", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> fromPort;
/**
* @return The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type.
*
*/
public Output> fromPort() {
return Codegen.optional(this.fromPort);
}
/**
* 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.
*
*/
@Export(name="ipProtocol", refs={String.class}, tree="[0]")
private Output ipProtocol;
/**
* @return 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.
*
*/
public Output ipProtocol() {
return this.ipProtocol;
}
/**
* The ID of the destination prefix list.
*
*/
@Export(name="prefixListId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> prefixListId;
/**
* @return The ID of the destination prefix list.
*
*/
public Output> prefixListId() {
return Codegen.optional(this.prefixListId);
}
/**
* The destination security group that is referenced in the rule.
*
*/
@Export(name="referencedSecurityGroupId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> referencedSecurityGroupId;
/**
* @return The destination security group that is referenced in the rule.
*
*/
public Output> referencedSecurityGroupId() {
return Codegen.optional(this.referencedSecurityGroupId);
}
/**
* The ID of the security group.
*
*/
@Export(name="securityGroupId", refs={String.class}, tree="[0]")
private Output securityGroupId;
/**
* @return The ID of the security group.
*
*/
public Output securityGroupId() {
return this.securityGroupId;
}
/**
* The ID of the security group rule.
*
*/
@Export(name="securityGroupRuleId", refs={String.class}, tree="[0]")
private Output securityGroupRuleId;
/**
* @return The ID of the security group rule.
*
*/
public Output securityGroupRuleId() {
return this.securityGroupRuleId;
}
/**
* 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.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return 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.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*
* @deprecated
* Please use `tags` instead.
*
*/
@Deprecated /* Please use `tags` instead. */
@Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy