Class GatewayVpcEndpointProps
Construction properties for a GatewayVpcEndpoint.
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GatewayVpcEndpointProps : Object, IGatewayVpcEndpointProps, IGatewayVpcEndpointOptions
Syntax (vb)
Public Class GatewayVpcEndpointProps
Inherits Object
Implements IGatewayVpcEndpointProps, IGatewayVpcEndpointOptions
Remarks
ExampleMetadata: infused
Examples
var stack = new Stack();
var myVpc = new VpcV2(this, "Vpc");
var routeTable = new RouteTable(this, "RouteTable", new RouteTableProps {
Vpc = myVpc
});
var subnet = new SubnetV2(this, "Subnet", new SubnetV2Props {
Vpc = myVpc,
AvailabilityZone = "eu-west-2a",
Ipv4CidrBlock = new IpCidr("10.0.0.0/24"),
SubnetType = SubnetType.PRIVATE
});
var dynamoEndpoint = new GatewayVpcEndpoint(this, "DynamoEndpoint", new GatewayVpcEndpointProps {
Service = GatewayVpcEndpointAwsService.DYNAMODB,
Vpc = myVpc,
Subnets = new [] { subnet }
});
new Route(this, "DynamoDBRoute", new RouteProps {
RouteTable = routeTable,
Destination = "0.0.0.0/0",
Target = new Dictionary<string, IVpcEndpoint?> { { "endpoint", dynamoEndpoint } }
});
Synopsis
Constructors
Gateway |
Properties
Service | The service to use for this gateway VPC endpoint. |
Subnets | Where to add endpoint routing. |
Vpc | The VPC network in which the gateway endpoint will be used. |
Constructors
GatewayVpcEndpointProps()
public GatewayVpcEndpointProps()
Properties
Service
The service to use for this gateway VPC endpoint.
public IGatewayVpcEndpointService Service { get; set; }
Property Value
Subnets
Where to add endpoint routing.
public ISubnetSelection[] Subnets { get; set; }
Property Value
Remarks
By default, this endpoint will be routable from all subnets in the VPC. Specify a list of subnet selection objects here to be more specific.
Default: - All subnets in the VPC
Examples
Vpc vpc;
vpc.AddGatewayEndpoint("DynamoDbEndpoint", new GatewayVpcEndpointOptions {
Service = GatewayVpcEndpointAwsService.DYNAMODB,
// Add only to ISOLATED subnets
Subnets = new [] { new SubnetSelection { SubnetType = SubnetType.PRIVATE_ISOLATED } }
});
Vpc
The VPC network in which the gateway endpoint will be used.
public IVpc Vpc { get; set; }
Property Value