NetworkingProperty Struct
Networking is a property of the AWS::Lightsail::Instance resource. It describes the public ports and the monthly amount of data transfer allocated for the instance.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const networkingProperty: lightsail.CfnInstance.NetworkingProperty = {
ports: [{
accessDirection: 'accessDirection',
accessFrom: 'accessFrom',
accessType: 'accessType',
cidrListAliases: ['cidrListAliases'],
cidrs: ['cidrs'],
commonName: 'commonName',
fromPort: 123,
ipv6Cidrs: ['ipv6Cidrs'],
protocol: 'protocol',
toPort: 123,
}],
// the properties below are optional
monthlyTransfer: {
gbPerMonthAllocated: 'gbPerMonthAllocated',
},
};
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_lightsail as lightsail
networking_property = lightsail.CfnInstance.NetworkingProperty(
ports=[lightsail.CfnInstance.PortProperty(
access_direction="accessDirection",
access_from="accessFrom",
access_type="accessType",
cidr_list_aliases=["cidrListAliases"],
cidrs=["cidrs"],
common_name="commonName",
from_port=123,
ipv6_cidrs=["ipv6Cidrs"],
protocol="protocol",
to_port=123
)],
# the properties below are optional
monthly_transfer=lightsail.CfnInstance.MonthlyTransferProperty(
gb_per_month_allocated="gbPerMonthAllocated"
)
)
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.lightsail.*;
NetworkingProperty networkingProperty = NetworkingProperty.builder()
.ports(List.of(PortProperty.builder()
.accessDirection("accessDirection")
.accessFrom("accessFrom")
.accessType("accessType")
.cidrListAliases(List.of("cidrListAliases"))
.cidrs(List.of("cidrs"))
.commonName("commonName")
.fromPort(123)
.ipv6Cidrs(List.of("ipv6Cidrs"))
.protocol("protocol")
.toPort(123)
.build()))
// the properties below are optional
.monthlyTransfer(MonthlyTransferProperty.builder()
.gbPerMonthAllocated("gbPerMonthAllocated")
.build())
.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.Lightsail;
var networkingProperty = new NetworkingProperty {
Ports = new [] { new PortProperty {
AccessDirection = "accessDirection",
AccessFrom = "accessFrom",
AccessType = "accessType",
CidrListAliases = new [] { "cidrListAliases" },
Cidrs = new [] { "cidrs" },
CommonName = "commonName",
FromPort = 123,
Ipv6Cidrs = new [] { "ipv6Cidrs" },
Protocol = "protocol",
ToPort = 123
} },
// the properties below are optional
MonthlyTransfer = new MonthlyTransferProperty {
GbPerMonthAllocated = "gbPerMonthAllocated"
}
};
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"
networkingProperty := &NetworkingProperty{
Ports: []interface{}{
&PortProperty{
AccessDirection: jsii.String("accessDirection"),
AccessFrom: jsii.String("accessFrom"),
AccessType: jsii.String("accessType"),
CidrListAliases: []*string{
jsii.String("cidrListAliases"),
},
Cidrs: []*string{
jsii.String("cidrs"),
},
CommonName: jsii.String("commonName"),
FromPort: jsii.Number(123),
Ipv6Cidrs: []*string{
jsii.String("ipv6Cidrs"),
},
Protocol: jsii.String("protocol"),
ToPort: jsii.Number(123),
},
},
// the properties below are optional
MonthlyTransfer: &MonthlyTransferProperty{
GbPerMonthAllocated: jsii.String("gbPerMonthAllocated"),
},
}
Properties
monthlyTransferoptionalIResolvable | CfnInstance.monthly_transferoptionaltyping.Union[IResolvable, MonthlyTransferProperty]monthlyTransferoptionalIResolvableMonthlyTransferoptionalIResolvableMonthlyTransferoptionalinterface{} #The monthly amount of data transfer, in GB, allocated for the instance.
portsIResolvable | IResolvable | CfnInstance.PortProperty[]portstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, PortProperty]]]portsIResolvablePortsIResolvablePortsinterface{} required #An array of ports to open on the instance.