aws-cdk-lib 2.190.0__py3-none-any.whl → 2.192.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aws-cdk-lib might be problematic. Click here for more details.

@@ -4982,29 +4982,44 @@ class PrivateDnsNamespace(
4982
4982
  ):
4983
4983
  '''Define a Service Discovery HTTP Namespace.
4984
4984
 
4985
- :exampleMetadata: infused
4985
+ :exampleMetadata: lit=aws-servicediscovery/test/integ.service-with-private-dns-namespace.lit.ts infused
4986
4986
 
4987
4987
  Example::
4988
4988
 
4989
- # mesh: appmesh.Mesh
4990
- # Cloud Map service discovery is currently required for host ejection by outlier detection
4991
- vpc = ec2.Vpc(self, "vpc")
4992
- namespace = cloudmap.PrivateDnsNamespace(self, "test-namespace",
4993
- vpc=vpc,
4994
- name="domain.local"
4989
+ import aws_cdk.aws_ec2 as ec2
4990
+ import aws_cdk.aws_elasticloadbalancingv2 as elbv2
4991
+ import aws_cdk as cdk
4992
+ import aws_cdk as servicediscovery
4993
+
4994
+ app = cdk.App()
4995
+ stack = cdk.Stack(app, "aws-servicediscovery-integ")
4996
+
4997
+ vpc = ec2.Vpc(stack, "Vpc", max_azs=2)
4998
+
4999
+ namespace = servicediscovery.PrivateDnsNamespace(stack, "Namespace",
5000
+ name="boobar.com",
5001
+ vpc=vpc
4995
5002
  )
4996
- service = namespace.create_service("Svc")
4997
- node = mesh.add_virtual_node("virtual-node",
4998
- service_discovery=appmesh.ServiceDiscovery.cloud_map(service),
4999
- listeners=[appmesh.VirtualNodeListener.http(
5000
- outlier_detection=appmesh.OutlierDetection(
5001
- base_ejection_duration=Duration.seconds(10),
5002
- interval=Duration.seconds(30),
5003
- max_ejection_percent=50,
5004
- max_server_errors=5
5005
- )
5006
- )]
5003
+
5004
+ service = namespace.create_service("Service",
5005
+ dns_record_type=servicediscovery.DnsRecordType.A_AAAA,
5006
+ dns_ttl=cdk.Duration.seconds(30),
5007
+ load_balancer=True
5007
5008
  )
5009
+
5010
+ loadbalancer = elbv2.ApplicationLoadBalancer(stack, "LB", vpc=vpc, internet_facing=True)
5011
+
5012
+ service.register_load_balancer("Loadbalancer", loadbalancer)
5013
+
5014
+ arn_service = namespace.create_service("ArnService",
5015
+ discovery_type=servicediscovery.DiscoveryType.API
5016
+ )
5017
+
5018
+ arn_service.register_non_ip_instance("NonIpInstance",
5019
+ custom_attributes={"arn": "arn://"}
5020
+ )
5021
+
5022
+ app.synth()
5008
5023
  '''
5009
5024
 
5010
5025
  def __init__(
@@ -5259,29 +5274,44 @@ class PrivateDnsNamespaceProps(BaseNamespaceProps):
5259
5274
  :param description: A description of the Namespace. Default: none
5260
5275
  :param vpc: The Amazon VPC that you want to associate the namespace with.
5261
5276
 
5262
- :exampleMetadata: infused
5277
+ :exampleMetadata: lit=aws-servicediscovery/test/integ.service-with-private-dns-namespace.lit.ts infused
5263
5278
 
5264
5279
  Example::
5265
5280
 
5266
- # mesh: appmesh.Mesh
5267
- # Cloud Map service discovery is currently required for host ejection by outlier detection
5268
- vpc = ec2.Vpc(self, "vpc")
5269
- namespace = cloudmap.PrivateDnsNamespace(self, "test-namespace",
5270
- vpc=vpc,
5271
- name="domain.local"
5281
+ import aws_cdk.aws_ec2 as ec2
5282
+ import aws_cdk.aws_elasticloadbalancingv2 as elbv2
5283
+ import aws_cdk as cdk
5284
+ import aws_cdk as servicediscovery
5285
+
5286
+ app = cdk.App()
5287
+ stack = cdk.Stack(app, "aws-servicediscovery-integ")
5288
+
5289
+ vpc = ec2.Vpc(stack, "Vpc", max_azs=2)
5290
+
5291
+ namespace = servicediscovery.PrivateDnsNamespace(stack, "Namespace",
5292
+ name="boobar.com",
5293
+ vpc=vpc
5272
5294
  )
5273
- service = namespace.create_service("Svc")
5274
- node = mesh.add_virtual_node("virtual-node",
5275
- service_discovery=appmesh.ServiceDiscovery.cloud_map(service),
5276
- listeners=[appmesh.VirtualNodeListener.http(
5277
- outlier_detection=appmesh.OutlierDetection(
5278
- base_ejection_duration=Duration.seconds(10),
5279
- interval=Duration.seconds(30),
5280
- max_ejection_percent=50,
5281
- max_server_errors=5
5282
- )
5283
- )]
5295
+
5296
+ service = namespace.create_service("Service",
5297
+ dns_record_type=servicediscovery.DnsRecordType.A_AAAA,
5298
+ dns_ttl=cdk.Duration.seconds(30),
5299
+ load_balancer=True
5300
+ )
5301
+
5302
+ loadbalancer = elbv2.ApplicationLoadBalancer(stack, "LB", vpc=vpc, internet_facing=True)
5303
+
5304
+ service.register_load_balancer("Loadbalancer", loadbalancer)
5305
+
5306
+ arn_service = namespace.create_service("ArnService",
5307
+ discovery_type=servicediscovery.DiscoveryType.API
5284
5308
  )
5309
+
5310
+ arn_service.register_non_ip_instance("NonIpInstance",
5311
+ custom_attributes={"arn": "arn://"}
5312
+ )
5313
+
5314
+ app.synth()
5285
5315
  '''
5286
5316
  if __debug__:
5287
5317
  type_hints = typing.get_type_hints(_typecheckingstub__f5a438cb76c40139835b65e440e9010402611db76baf5e4c500427a16a0b00e7)