@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.172Z") @Stability(value=Stable) public class Service extends Resource implements IService
Example:
import software.amazon.awscdk.*;
import software.amazon.awscdk.*;
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
Service.Builder
A fluent builder for
Service. |
software.amazon.jsii.JsiiObject.InitializationModeIService.Jsii$Default, IService.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Service(software.constructs.Construct scope,
String id,
ServiceProps props) |
protected |
Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Service(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static IService |
fromServiceAttributes(software.constructs.Construct scope,
String id,
ServiceAttributes attrs) |
DiscoveryType |
getDiscoveryType()
The discovery type used by this service.
|
DnsRecordType |
getDnsRecordType()
The DnsRecordType used by the service.
|
INamespace |
getNamespace()
The namespace for the Cloudmap Service.
|
RoutingPolicy |
getRoutingPolicy()
The Routing Policy used by the service.
|
String |
getServiceArn()
The Arn of the namespace that you want to use for DNS configuration.
|
String |
getServiceId()
The ID of the namespace that you want to use for DNS configuration.
|
String |
getServiceName()
A name for the Cloudmap Service.
|
IInstance |
registerCnameInstance(String id,
CnameInstanceBaseProps props)
Registers a resource that is accessible using a CNAME.
|
IInstance |
registerIpInstance(String id,
IpInstanceBaseProps props)
Registers a resource that is accessible using an IP address.
|
IInstance |
registerLoadBalancer(String id,
ILoadBalancerV2 loadBalancer)
Registers an ELB as a new instance with unique name instanceId in this service.
|
IInstance |
registerLoadBalancer(String id,
ILoadBalancerV2 loadBalancer,
Map<String,String> customAttributes)
Registers an ELB as a new instance with unique name instanceId in this service.
|
IInstance |
registerNonIpInstance(String id,
NonIpInstanceBaseProps props)
Registers a resource that is accessible using values other than an IP address or a domain name (CNAME).
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected Service(software.amazon.jsii.JsiiObjectRef objRef)
protected Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Service(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
ServiceProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static IService fromServiceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ServiceAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Stable) @NotNull public IInstance registerCnameInstance(@NotNull String id, @NotNull CnameInstanceBaseProps props)
id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public IInstance registerIpInstance(@NotNull String id, @NotNull IpInstanceBaseProps props)
id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public IInstance registerLoadBalancer(@NotNull String id, @NotNull ILoadBalancerV2 loadBalancer, @Nullable Map<String,String> customAttributes)
id - This parameter is required.loadBalancer - This parameter is required.customAttributes - @Stability(value=Stable) @NotNull public IInstance registerLoadBalancer(@NotNull String id, @NotNull ILoadBalancerV2 loadBalancer)
id - This parameter is required.loadBalancer - This parameter is required.@Stability(value=Stable) @NotNull public IInstance registerNonIpInstance(@NotNull String id, @NotNull NonIpInstanceBaseProps props)
id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public DiscoveryType getDiscoveryType()
getDiscoveryType in interface IService@Stability(value=Stable) @NotNull public DnsRecordType getDnsRecordType()
getDnsRecordType in interface IService@Stability(value=Stable) @NotNull public INamespace getNamespace()
getNamespace in interface IService@Stability(value=Stable) @NotNull public RoutingPolicy getRoutingPolicy()
getRoutingPolicy in interface IService@Stability(value=Stable) @NotNull public String getServiceArn()
getServiceArn in interface IService@Stability(value=Stable) @NotNull public String getServiceId()
getServiceId in interface IService@Stability(value=Stable) @NotNull public String getServiceName()
getServiceName in interface IServiceCopyright © 2022. All rights reserved.