Show / Hide Table of Contents

Class GatewayVpcEndpointAwsService

An AWS service for a gateway VPC endpoint.

Inheritance
object
GatewayVpcEndpointAwsService
Implements
IGatewayVpcEndpointService
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GatewayVpcEndpointAwsService : DeputyBase, IGatewayVpcEndpointService
Syntax (vb)
Public Class GatewayVpcEndpointAwsService Inherits DeputyBase Implements IGatewayVpcEndpointService
Remarks

ExampleMetadata: lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

Examples
// Add gateway endpoints when creating the VPC
            var vpc = new Vpc(this, "MyVpc", new VpcProps {
                GatewayEndpoints = new Dictionary<string, GatewayVpcEndpointOptions> {
                    { "S3", new GatewayVpcEndpointOptions {
                        Service = GatewayVpcEndpointAwsService.S3
                    } }
                }
            });

            // Alternatively gateway endpoints can be added on the VPC
            var dynamoDbEndpoint = vpc.AddGatewayEndpoint("DynamoDbEndpoint", new GatewayVpcEndpointOptions {
                Service = GatewayVpcEndpointAwsService.DYNAMODB
            });

            // This allows to customize the endpoint policy
            dynamoDbEndpoint.AddToPolicy(
            new PolicyStatement(new PolicyStatementProps {  // Restrict to listing and describing tables
                Principals = new [] { new AnyPrincipal() },
                Actions = new [] { "dynamodb:DescribeTable", "dynamodb:ListTables" },
                Resources = new [] { "*" } }));

            // Add an interface endpoint
            vpc.AddInterfaceEndpoint("EcrDockerEndpoint", new InterfaceVpcEndpointOptions {
                Service = InterfaceVpcEndpointAwsService.ECR_DOCKER
            });

Synopsis

Constructors

GatewayVpcEndpointAwsService(string, string?)

An AWS service for a gateway VPC endpoint.

Properties

DYNAMODB

An AWS service for a gateway VPC endpoint.

Name

The name of the service.

S3

An AWS service for a gateway VPC endpoint.

S3_EXPRESS

An AWS service for a gateway VPC endpoint.

Constructors

GatewayVpcEndpointAwsService(string, string?)

An AWS service for a gateway VPC endpoint.

public GatewayVpcEndpointAwsService(string name, string? prefix = null)
Parameters
name string

The name of the service.

prefix string

The name of the service.

Remarks

ExampleMetadata: lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

Properties

DYNAMODB

An AWS service for a gateway VPC endpoint.

public static GatewayVpcEndpointAwsService DYNAMODB { get; }
Property Value

GatewayVpcEndpointAwsService

Remarks

ExampleMetadata: lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

Examples
// Add gateway endpoints when creating the VPC
            var vpc = new Vpc(this, "MyVpc", new VpcProps {
                GatewayEndpoints = new Dictionary<string, GatewayVpcEndpointOptions> {
                    { "S3", new GatewayVpcEndpointOptions {
                        Service = GatewayVpcEndpointAwsService.S3
                    } }
                }
            });

            // Alternatively gateway endpoints can be added on the VPC
            var dynamoDbEndpoint = vpc.AddGatewayEndpoint("DynamoDbEndpoint", new GatewayVpcEndpointOptions {
                Service = GatewayVpcEndpointAwsService.DYNAMODB
            });

            // This allows to customize the endpoint policy
            dynamoDbEndpoint.AddToPolicy(
            new PolicyStatement(new PolicyStatementProps {  // Restrict to listing and describing tables
                Principals = new [] { new AnyPrincipal() },
                Actions = new [] { "dynamodb:DescribeTable", "dynamodb:ListTables" },
                Resources = new [] { "*" } }));

            // Add an interface endpoint
            vpc.AddInterfaceEndpoint("EcrDockerEndpoint", new InterfaceVpcEndpointOptions {
                Service = InterfaceVpcEndpointAwsService.ECR_DOCKER
            });

Name

The name of the service.

public virtual string Name { get; }
Property Value

string

Remarks

ExampleMetadata: lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

S3

An AWS service for a gateway VPC endpoint.

public static GatewayVpcEndpointAwsService S3 { get; }
Property Value

GatewayVpcEndpointAwsService

Remarks

ExampleMetadata: lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

Examples
// Add gateway endpoints when creating the VPC
            var vpc = new Vpc(this, "MyVpc", new VpcProps {
                GatewayEndpoints = new Dictionary<string, GatewayVpcEndpointOptions> {
                    { "S3", new GatewayVpcEndpointOptions {
                        Service = GatewayVpcEndpointAwsService.S3
                    } }
                }
            });

            // Alternatively gateway endpoints can be added on the VPC
            var dynamoDbEndpoint = vpc.AddGatewayEndpoint("DynamoDbEndpoint", new GatewayVpcEndpointOptions {
                Service = GatewayVpcEndpointAwsService.DYNAMODB
            });

            // This allows to customize the endpoint policy
            dynamoDbEndpoint.AddToPolicy(
            new PolicyStatement(new PolicyStatementProps {  // Restrict to listing and describing tables
                Principals = new [] { new AnyPrincipal() },
                Actions = new [] { "dynamodb:DescribeTable", "dynamodb:ListTables" },
                Resources = new [] { "*" } }));

            // Add an interface endpoint
            vpc.AddInterfaceEndpoint("EcrDockerEndpoint", new InterfaceVpcEndpointOptions {
                Service = InterfaceVpcEndpointAwsService.ECR_DOCKER
            });

S3_EXPRESS

An AWS service for a gateway VPC endpoint.

public static GatewayVpcEndpointAwsService S3_EXPRESS { get; }
Property Value

GatewayVpcEndpointAwsService

Remarks

ExampleMetadata: lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

Examples
// Add gateway endpoints when creating the VPC
            var vpc = new Vpc(this, "MyVpc", new VpcProps {
                GatewayEndpoints = new Dictionary<string, GatewayVpcEndpointOptions> {
                    { "S3", new GatewayVpcEndpointOptions {
                        Service = GatewayVpcEndpointAwsService.S3
                    } }
                }
            });

            // Alternatively gateway endpoints can be added on the VPC
            var dynamoDbEndpoint = vpc.AddGatewayEndpoint("DynamoDbEndpoint", new GatewayVpcEndpointOptions {
                Service = GatewayVpcEndpointAwsService.DYNAMODB
            });

            // This allows to customize the endpoint policy
            dynamoDbEndpoint.AddToPolicy(
            new PolicyStatement(new PolicyStatementProps {  // Restrict to listing and describing tables
                Principals = new [] { new AnyPrincipal() },
                Actions = new [] { "dynamodb:DescribeTable", "dynamodb:ListTables" },
                Resources = new [] { "*" } }));

            // Add an interface endpoint
            vpc.AddInterfaceEndpoint("EcrDockerEndpoint", new InterfaceVpcEndpointOptions {
                Service = InterfaceVpcEndpointAwsService.ECR_DOCKER
            });

Implements

IGatewayVpcEndpointService
Back to top Generated by DocFX