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

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:30.209Z") @Stability(Stable) public class HttpNamespace extends Resource implements IHttpNamespace
Define an HTTP Namespace.

Example:

 import software.amazon.awscdk.*;
 import software.amazon.awscdk.*;
 App app = new App();
 Stack stack = new Stack(app, "aws-servicediscovery-integ");
 HttpNamespace namespace = HttpNamespace.Builder.create(stack, "MyNamespace")
         .name("MyHTTPNamespace")
         .build();
 Service service1 = namespace.createService("NonIpService", BaseServiceProps.builder()
         .description("service registering non-ip instances")
         .build());
 service1.registerNonIpInstance("NonIpInstance", NonIpInstanceBaseProps.builder()
         .customAttributes(Map.of("arn", "arn:aws:s3:::mybucket"))
         .build());
 Service service2 = namespace.createService("IpService", BaseServiceProps.builder()
         .description("service registering ip instances")
         .healthCheck(HealthCheckConfig.builder()
                 .type(HealthCheckType.HTTP)
                 .resourcePath("/check")
                 .build())
         .build());
 service2.registerIpInstance("IpInstance", IpInstanceBaseProps.builder()
         .ipv4("54.239.25.192")
         .build());
 app.synth();
 
  • Constructor Details

    • HttpNamespace

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

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

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

    • fromHttpNamespaceAttributes

      @Stability(Stable) @NotNull public static IHttpNamespace fromHttpNamespaceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HttpNamespaceAttributes 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 BaseServiceProps 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.
    • getHttpNamespaceArn

      @Stability(Stable) @NotNull public String getHttpNamespaceArn()
    • getHttpNamespaceId

      @Stability(Stable) @NotNull public String getHttpNamespaceId()
    • getHttpNamespaceName

      @Stability(Stable) @NotNull public String getHttpNamespaceName()
    • getNamespaceArn

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

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

      @Stability(Stable) @NotNull public String getNamespaceName()
      A name for the namespace.
      Specified by:
      getNamespaceName in interface INamespace
    • getType

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