Class Peer
Peer object factories (to be used in Security Group management).
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Peer : DeputyBase
Syntax (vb)
Public Class Peer
Inherits DeputyBase
Remarks
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
.
ExampleMetadata: infused
Examples
Vpc vpc;
var cluster = new Cluster(this, "Cluster", new ClusterProps {
ClusterName = "myCluster",
KafkaVersion = KafkaVersion.V2_8_1,
Vpc = vpc
});
cluster.Connections.AllowFrom(Peer.Ipv4("1.2.3.4/8"), Port.Tcp(2181));
cluster.Connections.AllowFrom(Peer.Ipv4("1.2.3.4/8"), Port.Tcp(9094));
Synopsis
Constructors
Peer() | |
Peer(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Peer(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
AnyIpv4() | Any IPv4 address. |
AnyIpv6() | Any IPv6 address. |
Ipv4(String) | Create an IPv4 peer from a CIDR. |
Ipv6(String) | Create an IPv6 peer from a CIDR. |
PrefixList(String) | A prefix list. |
SecurityGroupId(String, String) | A security group ID. |
Constructors
Peer()
public Peer()
Peer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Peer(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Peer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Peer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
AnyIpv4()
AnyIpv6()
Ipv4(String)
Create an IPv4 peer from a CIDR.
public static IPeer Ipv4(string cidrIp)
Parameters
- cidrIp System.String
Returns
Ipv6(String)
Create an IPv6 peer from a CIDR.
public static IPeer Ipv6(string cidrIp)
Parameters
- cidrIp System.String
Returns
PrefixList(String)
A prefix list.
public static IPeer PrefixList(string prefixListId)
Parameters
- prefixListId System.String
Returns
SecurityGroupId(String, String)
A security group ID.
public static IPeer SecurityGroupId(string securityGroupId, string sourceSecurityGroupOwnerId = null)
Parameters
- securityGroupId System.String
- sourceSecurityGroupOwnerId System.String
Returns