ConnectionsProps Struct
Properties to initialize a new Connections object.
| Source | aws-ec2/lib/connections.ts |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
declare const peer: ec2.IPeer;
declare const port: ec2.Port;
declare const securityGroup: ec2.SecurityGroup;
const connectionsProps: ec2.ConnectionsProps = {
defaultPort: port,
peer: peer,
securityGroups: [securityGroup],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
# peer: ec2.IPeer
# port: ec2.Port
# security_group: ec2.SecurityGroup
connections_props = ec2.ConnectionsProps(
default_port=port,
peer=peer,
security_groups=[security_group]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
IPeer peer;
Port port;
SecurityGroup securityGroup;
ConnectionsProps connectionsProps = ConnectionsProps.builder()
.defaultPort(port)
.peer(peer)
.securityGroups(List.of(securityGroup))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
IPeer peer;
Port port;
SecurityGroup securityGroup;
var connectionsProps = new ConnectionsProps {
DefaultPort = port,
Peer = peer,
SecurityGroups = new [] { securityGroup }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var peer IPeer
var port Port
var securityGroup SecurityGroup
connectionsProps := &ConnectionsProps{
DefaultPort: port,
Peer: peer,
SecurityGroups: []ISecurityGroup{
securityGroup,
},
}
Properties
defaultPortoptionalPortdefault_portoptionalPortdefaultPortoptionalPortDefaultPortoptionalPortDefaultPortoptionalPort #Default port range for initiating connections to and from this object.
Default: No default port
Class that represents the rule by which others can connect to this connectable.
Default: Derived from securityGroup if set.
This object is required, but will be derived from securityGroup if that is passed.
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup #What securityGroup(s) this object is managing connections for.
Default: No security groups