@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.490Z") @Stability(value=Stable) public class Peer extends software.amazon.jsii.JsiiObject
The static methods on this object can be used to create peer objects which represent a connection partner in Security Group rules.
Use this object if you need to represent connection partners using plain IP addresses, or a prefix list ID.
If you want to address a connection partner by Security Group, you can just
use the Security Group (or the construct that contains a Security Group)
directly, as it already implements IPeer.
Example:
// Example automatically generated from non-compiling source. May contain errors.
InstanceType instanceType;
NatInstanceProvider provider = NatProvider.instance(NatInstanceProps.builder()
.instanceType(instanceType)
.defaultAllowedTraffic(NatTrafficDirection.OUTBOUND_ONLY)
.build());
Vpc.Builder.create(this, "TheVPC")
.natGatewayProvider(provider)
.build();
provider.connections.allowFrom(Peer.ipv4("1.2.3.4/8"), Port.tcp(80));
| Modifier | Constructor and Description |
|---|---|
|
Peer() |
protected |
Peer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Peer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static IPeer |
anyIpv4()
Any IPv4 address.
|
static IPeer |
anyIpv6()
Any IPv6 address.
|
static IPeer |
ipv4(String cidrIp)
Create an IPv4 peer from a CIDR.
|
static IPeer |
ipv6(String cidrIp)
Create an IPv6 peer from a CIDR.
|
static IPeer |
prefixList(String prefixListId)
A prefix list.
|
static IPeer |
securityGroupId(String securityGroupId)
A security group ID.
|
static IPeer |
securityGroupId(String securityGroupId,
String sourceSecurityGroupOwnerId)
A security group ID.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Peer(software.amazon.jsii.JsiiObjectRef objRef)
protected Peer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public Peer()
@Stability(value=Stable) @NotNull public static IPeer anyIpv4()
@Stability(value=Stable) @NotNull public static IPeer anyIpv6()
@Stability(value=Stable) @NotNull public static IPeer ipv4(@NotNull String cidrIp)
cidrIp - This parameter is required.@Stability(value=Stable) @NotNull public static IPeer ipv6(@NotNull String cidrIp)
cidrIp - This parameter is required.@Stability(value=Stable) @NotNull public static IPeer prefixList(@NotNull String prefixListId)
prefixListId - This parameter is required.@Stability(value=Stable) @NotNull public static IPeer securityGroupId(@NotNull String securityGroupId, @Nullable String sourceSecurityGroupOwnerId)
securityGroupId - This parameter is required.sourceSecurityGroupOwnerId - Copyright © 2022. All rights reserved.