Interface ISecurityGroup

All Superinterfaces:
IConnectable, software.constructs.IConstruct, software.constructs.IDependable, IEnvironmentAware, IPeer, IResource, ISecurityGroupRef, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
ISecurityGroup.Jsii$Default
All Known Implementing Classes:
ISecurityGroup.Jsii$Proxy, SecurityGroup

@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)", date="2025-11-04T09:27:40.308Z") @Stability(Stable) public interface ISecurityGroup extends software.amazon.jsii.JsiiSerializable, IResource, IPeer, ISecurityGroupRef
Interface for security group-like objects.
  • Method Details

    • getAllowAllOutbound

      @Stability(Stable) @NotNull Boolean getAllowAllOutbound()
      Whether the SecurityGroup has been configured to allow all outbound traffic.
    • getSecurityGroupId

      @Stability(Stable) @NotNull String getSecurityGroupId()
      ID for the current security group.
    • addEgressRule

      @Stability(Stable) void addEgressRule(@NotNull IPeer peer, @NotNull Port connection, @Nullable String description, @Nullable Boolean remoteRule)
      Add an egress rule for the current security group.

      remoteRule controls where the Rule object is created if the peer is also a securityGroup and they are in different stack. If false (default) the rule object is created under the current SecurityGroup object. If true and the peer is also a SecurityGroup, the rule object is created under the remote SecurityGroup object.

      Parameters:
      peer - This parameter is required.
      connection - This parameter is required.
      description -
      remoteRule -
    • addEgressRule

      @Stability(Stable) void addEgressRule(@NotNull IPeer peer, @NotNull Port connection, @Nullable String description)
      Add an egress rule for the current security group.

      remoteRule controls where the Rule object is created if the peer is also a securityGroup and they are in different stack. If false (default) the rule object is created under the current SecurityGroup object. If true and the peer is also a SecurityGroup, the rule object is created under the remote SecurityGroup object.

      Parameters:
      peer - This parameter is required.
      connection - This parameter is required.
      description -
    • addEgressRule

      @Stability(Stable) void addEgressRule(@NotNull IPeer peer, @NotNull Port connection)
      Add an egress rule for the current security group.

      remoteRule controls where the Rule object is created if the peer is also a securityGroup and they are in different stack. If false (default) the rule object is created under the current SecurityGroup object. If true and the peer is also a SecurityGroup, the rule object is created under the remote SecurityGroup object.

      Parameters:
      peer - This parameter is required.
      connection - This parameter is required.
    • addIngressRule

      @Stability(Stable) void addIngressRule(@NotNull IPeer peer, @NotNull Port connection, @Nullable String description, @Nullable Boolean remoteRule)
      Add an ingress rule for the current security group.

      remoteRule controls where the Rule object is created if the peer is also a securityGroup and they are in different stack. If false (default) the rule object is created under the current SecurityGroup object. If true and the peer is also a SecurityGroup, the rule object is created under the remote SecurityGroup object.

      Parameters:
      peer - This parameter is required.
      connection - This parameter is required.
      description -
      remoteRule -
    • addIngressRule

      @Stability(Stable) void addIngressRule(@NotNull IPeer peer, @NotNull Port connection, @Nullable String description)
      Add an ingress rule for the current security group.

      remoteRule controls where the Rule object is created if the peer is also a securityGroup and they are in different stack. If false (default) the rule object is created under the current SecurityGroup object. If true and the peer is also a SecurityGroup, the rule object is created under the remote SecurityGroup object.

      Parameters:
      peer - This parameter is required.
      connection - This parameter is required.
      description -
    • addIngressRule

      @Stability(Stable) void addIngressRule(@NotNull IPeer peer, @NotNull Port connection)
      Add an ingress rule for the current security group.

      remoteRule controls where the Rule object is created if the peer is also a securityGroup and they are in different stack. If false (default) the rule object is created under the current SecurityGroup object. If true and the peer is also a SecurityGroup, the rule object is created under the remote SecurityGroup object.

      Parameters:
      peer - This parameter is required.
      connection - This parameter is required.
    • getNode

      @Stability(Stable) @NotNull software.constructs.Node getNode()
      The tree node.
      Specified by:
      getNode in interface software.constructs.IConstruct
    • getEnv

      @Stability(Stable) @NotNull ResourceEnvironment getEnv()
      The environment this resource belongs to.

      For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

      For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

      Specified by:
      getEnv in interface IEnvironmentAware