See: Description
Interface | Description |
---|---|
AliasTargetInstanceProps |
Example:
|
BaseInstanceProps |
Used when the resource that's associated with the service instance is accessible using values other than an IP address or a domain name (CNAME), i.e.
|
BaseNamespaceProps |
Example:
|
BaseServiceProps |
Basic props needed to create a service in a given namespace.
|
CfnHttpNamespaceProps |
Properties for defining a `CfnHttpNamespace`.
|
CfnInstanceProps |
Properties for defining a `CfnInstance`.
|
CfnPrivateDnsNamespace.PrivateDnsPropertiesMutableProperty |
DNS properties for the private DNS namespace.
|
CfnPrivateDnsNamespace.PropertiesProperty |
Properties for the private DNS namespace.
|
CfnPrivateDnsNamespace.SOAProperty |
Start of Authority (SOA) properties for a public or private DNS namespace.
|
CfnPrivateDnsNamespaceProps |
Properties for defining a `CfnPrivateDnsNamespace`.
|
CfnPublicDnsNamespace.PropertiesProperty |
Properties for the public DNS namespace.
|
CfnPublicDnsNamespace.PublicDnsPropertiesMutableProperty |
DNS properties for the public DNS namespace.
|
CfnPublicDnsNamespace.SOAProperty |
Start of Authority (SOA) properties for a public or private DNS namespace.
|
CfnPublicDnsNamespaceProps |
Properties for defining a `CfnPublicDnsNamespace`.
|
CfnService.DnsConfigProperty |
A complex type that contains information about the Amazon RouteĀ 53 DNS records that you want AWS Cloud Map to create when you register an instance.
|
CfnService.DnsRecordProperty |
A complex type that contains information about the RouteĀ 53 DNS records that you want AWS Cloud Map to create when you register an instance.
|
CfnService.HealthCheckConfigProperty |
*Public DNS and HTTP namespaces only.* A complex type that contains settings for an optional health check.
|
CfnService.HealthCheckCustomConfigProperty |
A complex type that contains information about an optional custom health check.
|
CfnServiceProps |
Properties for defining a `CfnService`.
|
CnameInstanceBaseProps |
Example:
|
CnameInstanceProps |
Example:
|
DnsServiceProps |
Service props needed to create a service in a given namespace.
|
HealthCheckConfig |
Settings for an optional Amazon Route 53 health check.
|
HealthCheckCustomConfig |
Specifies information about an optional custom health check.
|
HttpNamespaceAttributes |
Example:
|
HttpNamespaceProps |
Example:
|
IHttpNamespace | |
IHttpNamespace.Jsii$Default |
Internal default implementation for
IHttpNamespace . |
IInstance | |
IInstance.Jsii$Default |
Internal default implementation for
IInstance . |
INamespace | |
INamespace.Jsii$Default |
Internal default implementation for
INamespace . |
IpInstanceBaseProps |
Example:
|
IpInstanceProps |
Example:
|
IPrivateDnsNamespace | |
IPrivateDnsNamespace.Jsii$Default |
Internal default implementation for
IPrivateDnsNamespace . |
IPublicDnsNamespace | |
IPublicDnsNamespace.Jsii$Default |
Internal default implementation for
IPublicDnsNamespace . |
IService | |
IService.Jsii$Default |
Internal default implementation for
IService . |
NonIpInstanceBaseProps |
Example:
|
NonIpInstanceProps |
Example:
|
PrivateDnsNamespaceAttributes |
Example:
|
PrivateDnsNamespaceProps |
Example:
|
PublicDnsNamespaceAttributes |
Example:
|
PublicDnsNamespaceProps |
Example:
|
ServiceAttributes |
Example:
|
ServiceProps |
Example:
|
Enum | Description |
---|---|
DnsRecordType |
Example:
|
HealthCheckType |
Example:
|
NamespaceType | |
RoutingPolicy |
---
This module is part of the AWS Cloud Development Kit project.
This package contains constructs for working with AWS Cloud Map
AWS Cloud Map is a fully managed service that you can use to create and maintain a map of the backend services and resources that your applications depend on.
For further information on AWS Cloud Map, see the AWS Cloud Map documentation
The following example creates an AWS Cloud Map namespace that supports API calls, creates a service in that namespace, and registers an instance to it:
import software.amazon.awscdk.core.*; import software.amazon.awscdk.services.servicediscovery.*; App app = new App(); Stack stack = new Stack(app, "aws-servicediscovery-integ"); HttpNamespace namespace = HttpNamespace.Builder.create(stack, "MyNamespace") .name("covfefe") .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();
The following example creates an AWS Cloud Map namespace that supports both API calls and DNS queries within a vpc, creates a service in that namespace, and registers a loadbalancer as an instance:
import software.amazon.awscdk.services.ec2.*; import software.amazon.awscdk.services.elasticloadbalancingv2.*; import software.amazon.awscdk.core.*; import software.amazon.awscdk.services.servicediscovery.*; 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); app.synth();
The following example creates an AWS Cloud Map namespace that supports both API calls and public DNS queries, creates a service in that namespace, and registers an IP instance:
import software.amazon.awscdk.core.*; import software.amazon.awscdk.services.servicediscovery.*; App app = new App(); Stack stack = new Stack(app, "aws-servicediscovery-integ"); PublicDnsNamespace namespace = PublicDnsNamespace.Builder.create(stack, "Namespace") .name("foobar.com") .build(); Service service = namespace.createService("Service", DnsServiceProps.builder() .name("foo") .dnsRecordType(DnsRecordType.A) .dnsTtl(Duration.seconds(30)) .healthCheck(HealthCheckConfig.builder() .type(HealthCheckType.HTTPS) .resourcePath("/healthcheck") .failureThreshold(2) .build()) .build()); service.registerIpInstance("IpInstance", IpInstanceBaseProps.builder() .ipv4("54.239.25.192") .port(443) .build()); app.synth();
For DNS namespaces, you can also register instances to services with CNAME records:
import software.amazon.awscdk.core.*; import software.amazon.awscdk.services.servicediscovery.*; App app = new App(); Stack stack = new Stack(app, "aws-servicediscovery-integ"); PublicDnsNamespace namespace = PublicDnsNamespace.Builder.create(stack, "Namespace") .name("foobar.com") .build(); Service service = namespace.createService("Service", DnsServiceProps.builder() .name("foo") .dnsRecordType(DnsRecordType.CNAME) .dnsTtl(Duration.seconds(30)) .build()); service.registerCnameInstance("CnameInstance", CnameInstanceBaseProps.builder() .instanceCname("service.pizza") .build()); app.synth();