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:
IResource,INamespace,IPrivateDnsNamespace,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:47.258Z")
@Stability(Stable)
public class PrivateDnsNamespace
extends Resource
implements IPrivateDnsNamespace
Define a Service Discovery HTTP Namespace.
Example:
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.elasticloadbalancingv2.*;
import software.amazon.awscdk.*;
import software.amazon.awscdk.*;
App app = new App();
Stack stack = new Stack(app, "aws-servicediscovery-integ");
Vpc vpc = Vpc.Builder.create(stack, "Vpc").maxAzs(2).build();
PrivateDnsNamespace namespace = PrivateDnsNamespace.Builder.create(stack, "Namespace")
.name("boobar.com")
.vpc(vpc)
.build();
Service service = namespace.createService("Service", DnsServiceProps.builder()
.dnsRecordType(DnsRecordType.A_AAAA)
.dnsTtl(Duration.seconds(30))
.loadBalancer(true)
.build());
ApplicationLoadBalancer loadbalancer = ApplicationLoadBalancer.Builder.create(stack, "LB").vpc(vpc).internetFacing(true).build();
service.registerLoadBalancer("Loadbalancer", loadbalancer);
Service arnService = namespace.createService("ArnService", DnsServiceProps.builder()
.discoveryType(DiscoveryType.API)
.build());
arnService.registerNonIpInstance("NonIpInstance", NonIpInstanceBaseProps.builder()
.customAttributes(Map.of("arn", "arn://"))
.build());
app.synth();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.servicediscovery.IPrivateDnsNamespace
IPrivateDnsNamespace.Jsii$Default, IPrivateDnsNamespace.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrivateDnsNamespace(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedPrivateDnsNamespace(software.amazon.jsii.JsiiObjectRef objRef) PrivateDnsNamespace(software.constructs.Construct scope, String id, PrivateDnsNamespaceProps props) -
Method Summary
Modifier and TypeMethodDescriptioncreateService(String id) Creates a service within the namespace.createService(String id, DnsServiceProps props) Creates a service within the namespace.static IPrivateDnsNamespacefromPrivateDnsNamespaceAttributes(software.constructs.Construct scope, String id, PrivateDnsNamespaceAttributes attrs) Namespace Arn of the namespace.ID of hosted zone created by namespace.Namespace Id of the PrivateDnsNamespace.The name of the PrivateDnsNamespace.getType()Type of the namespace.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
Creates a service within the namespace.- Parameters:
id- This parameter is required.
-
getNamespaceArn
Namespace Arn of the namespace.- Specified by:
getNamespaceArnin interfaceINamespace
-
getNamespaceHostedZoneId
ID of hosted zone created by namespace. -
getNamespaceId
Namespace Id of the PrivateDnsNamespace.- Specified by:
getNamespaceIdin interfaceINamespace
-
getNamespaceName
The name of the PrivateDnsNamespace.- Specified by:
getNamespaceNamein interfaceINamespace
-
getPrivateDnsNamespaceArn
-
getPrivateDnsNamespaceId
-
getPrivateDnsNamespaceName
-
getType
Type of the namespace.- Specified by:
getTypein interfaceINamespace
-