AzureSubnetResource

Handle
📦 Aspire.Hosting.Azure.Network v17.0.0
interface AzureSubnetResource
extends IResource,
IResourceWithParent,
AzureVirtualNetworkResource]] {
addPrivateEndpoint(target: IAzurePrivateEndpointTarget): AzurePrivateEndpointResource;
allowInbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource;
allowOutbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource;
denyInbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource;
denyOutbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource;
withNatGateway(natGateway: AzureNatGatewayResource): AzureSubnetResource;
withNetworkSecurityGroup(nsg: AzureNetworkSecurityGroupResource): AzureSubnetResource;
withServiceDelegation(
serviceName: string,
name?: string): AzureSubnetResource;
}

Methods

methodaddPrivateEndpointbuilder
Adds an Azure Private Endpoint resource to the subnet.
addPrivateEndpoint(target: IAzurePrivateEndpointTarget): AzurePrivateEndpointResource
targetIAzurePrivateEndpointTargetThe target Azure resource to connect via private link.
AzurePrivateEndpointResource
methodallowInboundbuilder
Adds an inbound allow rule to the subnet's Network Security Group.
allowInbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource
portstringoptionalThe destination port range (e.g., "443", "80-443"). Defaults to "*" (any).
fromstringoptionalThe source address prefix (e.g., "AzureLoadBalancer", "Internet", "10.0.0.0/8"). Defaults to "*" (any).
tostringoptionalThe destination address prefix. Defaults to "*" (any).
protocolSecurityRuleProtocoloptionalThe network protocol. Defaults to `Asterisk` (any).
prioritynumberoptionalThe rule priority (100-4096). If not specified, auto-increments from 100 by 100.
namestringoptionalThe rule name. If not specified, auto-generated from parameters.
AzureSubnetResource
methodallowOutboundbuilder
Adds an outbound allow rule to the subnet's Network Security Group.
allowOutbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource
portstringoptionalThe destination port range (e.g., "443", "80-443"). Defaults to "*" (any).
fromstringoptionalThe source address prefix. Defaults to "*" (any).
tostringoptionalThe destination address prefix (e.g., "Internet", "VirtualNetwork"). Defaults to "*" (any).
protocolSecurityRuleProtocoloptionalThe network protocol. Defaults to `Asterisk` (any).
prioritynumberoptionalThe rule priority (100-4096). If not specified, auto-increments from 100 by 100.
namestringoptionalThe rule name. If not specified, auto-generated from parameters.
AzureSubnetResource
methoddenyInboundbuilder
Adds an inbound deny rule to the subnet's Network Security Group.
denyInbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource
portstringoptionalThe destination port range (e.g., "443", "80-443"). Defaults to "*" (any).
fromstringoptionalThe source address prefix (e.g., "Internet", "VirtualNetwork", "10.0.0.0/8"). Defaults to "*" (any).
tostringoptionalThe destination address prefix. Defaults to "*" (any).
protocolSecurityRuleProtocoloptionalThe network protocol. Defaults to `Asterisk` (any).
prioritynumberoptionalThe rule priority (100-4096). If not specified, auto-increments from 100 by 100.
namestringoptionalThe rule name. If not specified, auto-generated from parameters.
AzureSubnetResource
methoddenyOutboundbuilder
Adds an outbound deny rule to the subnet's Network Security Group.
denyOutbound(
port?: string,
from?: string,
to?: string,
protocol?: SecurityRuleProtocol,
priority?: number,
name?: string): AzureSubnetResource
portstringoptionalThe destination port range (e.g., "443", "80-443"). Defaults to "*" (any).
fromstringoptionalThe source address prefix. Defaults to "*" (any).
tostringoptionalThe destination address prefix (e.g., "Internet", "VirtualNetwork"). Defaults to "*" (any).
protocolSecurityRuleProtocoloptionalThe network protocol. Defaults to `Asterisk` (any).
prioritynumberoptionalThe rule priority (100-4096). If not specified, auto-increments from 100 by 100.
namestringoptionalThe rule name. If not specified, auto-generated from parameters.
AzureSubnetResource
methodwithNatGatewaybuilder
Associates a NAT Gateway with the subnet.
withNatGateway(natGateway: AzureNatGatewayResource): AzureSubnetResource
natGatewayAzureNatGatewayResourceThe NAT Gateway to associate with the subnet.
AzureSubnetResource
Associates a Network Security Group with the subnet.
withNetworkSecurityGroup(nsg: AzureNetworkSecurityGroupResource): AzureSubnetResource
nsgAzureNetworkSecurityGroupResourceThe Network Security Group to associate with the subnet.
AzureSubnetResource
Delegates the subnet to the specified Azure service.
withServiceDelegation(
serviceName: string,
name?: string): AzureSubnetResource
serviceNamestringThe service name to delegate the subnet to (e.g., "Microsoft.App/environments"). See `AzureSubnetServiceDelegations` for well-known values.
namestringoptionalThe name of the service delegation. If not specified, defaults to `serviceName`.
AzureSubnetResource