Class PrivateDnsNamespace

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.servicediscovery.PrivateDnsNamespace
All Implemented Interfaces:
IEnvironmentAware, IPrivateDnsNamespaceRef, IResource, INamespace, IPrivateDnsNamespace, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.138.0 (build 0ca7ee8)", date="2026-07-31T10:49:38.656Z") @Stability(Stable) public class PrivateDnsNamespace extends Resource implements IPrivateDnsNamespace
Define a Service Discovery HTTP Namespace.

Example:

 Mesh mesh;
 Vpc vpc = new Vpc(this, "vpc");
 PrivateDnsNamespace namespace = PrivateDnsNamespace.Builder.create(this, "test-namespace")
         .vpc(vpc)
         .name("domain.local")
         .build();
 Service service = namespace.createService("Svc");
 VirtualNode node = mesh.addVirtualNode("virtual-node", VirtualNodeBaseProps.builder()
         .serviceDiscovery(ServiceDiscovery.cloudMap(service))
         .listeners(List.of(VirtualNodeListener.http(HttpVirtualNodeListenerOptions.builder()
                 .port(8081)
                 .healthCheck(HealthCheck.http(HttpHealthCheckOptions.builder()
                         .healthyThreshold(3)
                         .interval(Duration.seconds(5)) // minimum
                         .path("/health-check-path")
                         .timeout(Duration.seconds(2)) // minimum
                         .unhealthyThreshold(2)
                         .build()))
                 .build())))
         .accessLog(AccessLog.fromFilePath("/dev/stdout"))
         .build());
 
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Stable) public static final String PROPERTY_INJECTION_ID
      Uniquely identifies this class.
  • Constructor Details

    • PrivateDnsNamespace

      protected PrivateDnsNamespace(software.amazon.jsii.JsiiObjectRef objRef)
    • PrivateDnsNamespace

      protected PrivateDnsNamespace(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • PrivateDnsNamespace

      @Stability(Stable) public PrivateDnsNamespace(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull PrivateDnsNamespaceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromPrivateDnsNamespaceAttributes

      @Stability(Stable) @NotNull public static IPrivateDnsNamespace fromPrivateDnsNamespaceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull PrivateDnsNamespaceAttributes attrs)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • createService

      @Stability(Stable) @NotNull public Service createService(@NotNull String id, @Nullable DnsServiceProps props)
      Creates a service within the namespace.

      Parameters:
      id - This parameter is required.
      props -
    • createService

      @Stability(Stable) @NotNull public Service createService(@NotNull String id)
      Creates a service within the namespace.

      Parameters:
      id - This parameter is required.
    • getNamespaceArn

      @Stability(Stable) @NotNull public String getNamespaceArn()
      Namespace Arn of the namespace.
      Specified by:
      getNamespaceArn in interface INamespace
    • getNamespaceHostedZoneId

      @Stability(Stable) @NotNull public String getNamespaceHostedZoneId()
      ID of hosted zone created by namespace.
    • getNamespaceId

      @Stability(Stable) @NotNull public String getNamespaceId()
      Namespace Id of the PrivateDnsNamespace.
      Specified by:
      getNamespaceId in interface INamespace
    • getNamespaceName

      @Stability(Stable) @NotNull public String getNamespaceName()
      The name of the PrivateDnsNamespace.
      Specified by:
      getNamespaceName in interface INamespace
    • getPrivateDnsNamespaceArn

      @Stability(Stable) @NotNull public String getPrivateDnsNamespaceArn()
    • getPrivateDnsNamespaceId

      @Stability(Stable) @NotNull public String getPrivateDnsNamespaceId()
    • getPrivateDnsNamespaceName

      @Stability(Stable) @NotNull public String getPrivateDnsNamespaceName()
    • getPrivateDnsNamespaceRef

      @Stability(Stable) @NotNull public PrivateDnsNamespaceReference getPrivateDnsNamespaceRef()
      A reference to a PrivateDnsNamespace resource.
      Specified by:
      getPrivateDnsNamespaceRef in interface IPrivateDnsNamespaceRef
    • getType

      @Stability(Stable) @NotNull public NamespaceType getType()
      Type of the namespace.
      Specified by:
      getType in interface INamespace