How to use the @aws-cdk/aws-servicediscovery.NamespaceType function in @aws-cdk/aws-servicediscovery

To help you get started, we’ve selected a few @aws-cdk/aws-servicediscovery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-ecs / lib / cluster.ts View on Github external
public addDefaultCloudMapNamespace(options: CloudMapNamespaceOptions): cloudmap.INamespace {
    if (this._defaultCloudMapNamespace !== undefined) {
      throw new Error("Can only add default namespace once.");

    const namespaceType = options.type !== undefined
      ? options.type
      : cloudmap.NamespaceType.DNS_PRIVATE;

    const sdNamespace = namespaceType === cloudmap.NamespaceType.DNS_PRIVATE ?
      new cloudmap.PrivateDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {
        vpc: this.vpc
      }) :
      new cloudmap.PublicDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', {

    this._defaultCloudMapNamespace = sdNamespace;

    return sdNamespace;


The CDK Construct Library for AWS::ServiceDiscovery

Latest version published 11 months ago

Package Health Score

67 / 100
Full package analysis