Class Service
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.servicediscovery.Service
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IService,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:45.665Z")
@Stability(Stable)
public class Service
extends Resource
implements IService
Define a CloudMap Service.
Example:
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();
-
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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.servicediscovery.IService
IService.Jsii$Default, IService.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedService(software.amazon.jsii.JsiiObjectRef objRef) Service(software.constructs.Construct scope, String id, ServiceProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IServicefromServiceAttributes(software.constructs.Construct scope, String id, ServiceAttributes attrs) The DnsRecordType used by the service.The namespace for the Cloudmap Service.The Routing Policy used by the service.The Arn of the namespace that you want to use for DNS configuration.The ID of the namespace that you want to use for DNS configuration.A name for the Cloudmap Service.registerCnameInstance(String id, CnameInstanceBaseProps props) Registers a resource that is accessible using a CNAME.registerIpInstance(String id, IpInstanceBaseProps props) Registers a resource that is accessible using an IP address.registerLoadBalancer(String id, ILoadBalancerV2 loadBalancer) Registers an ELB as a new instance with unique name instanceId in this service.registerLoadBalancer(String id, ILoadBalancerV2 loadBalancer, Map<String, String> customAttributes) Registers an ELB as a new instance with unique name instanceId in this service.registerNonIpInstance(String id, NonIpInstanceBaseProps props) Registers a resource that is accessible using values other than an IP address or a domain name (CNAME).Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
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.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Service
protected Service(software.amazon.jsii.JsiiObjectRef objRef) -
Service
protected Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Service
@Stability(Stable) public Service(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ServiceProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromServiceAttributes
@Stability(Stable) @NotNull public static IService fromServiceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ServiceAttributes attrs) - Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
registerCnameInstance
@Stability(Stable) @NotNull public IInstance registerCnameInstance(@NotNull String id, @NotNull CnameInstanceBaseProps props) Registers a resource that is accessible using a CNAME.- Parameters:
id- This parameter is required.props- This parameter is required.
-
registerIpInstance
@Stability(Stable) @NotNull public IInstance registerIpInstance(@NotNull String id, @NotNull IpInstanceBaseProps props) Registers a resource that is accessible using an IP address.- Parameters:
id- This parameter is required.props- This parameter is required.
-
registerLoadBalancer
@Stability(Stable) @NotNull public IInstance registerLoadBalancer(@NotNull String id, @NotNull ILoadBalancerV2 loadBalancer, @Nullable Map<String, String> customAttributes) Registers an ELB as a new instance with unique name instanceId in this service.- Parameters:
id- This parameter is required.loadBalancer- This parameter is required.customAttributes-
-
registerLoadBalancer
@Stability(Stable) @NotNull public IInstance registerLoadBalancer(@NotNull String id, @NotNull ILoadBalancerV2 loadBalancer) Registers an ELB as a new instance with unique name instanceId in this service.- Parameters:
id- This parameter is required.loadBalancer- This parameter is required.
-
registerNonIpInstance
@Stability(Stable) @NotNull public IInstance registerNonIpInstance(@NotNull String id, @NotNull NonIpInstanceBaseProps props) Registers a resource that is accessible using values other than an IP address or a domain name (CNAME).- Parameters:
id- This parameter is required.props- This parameter is required.
-
getDnsRecordType
The DnsRecordType used by the service.- Specified by:
getDnsRecordTypein interfaceIService
-
getNamespace
The namespace for the Cloudmap Service.- Specified by:
getNamespacein interfaceIService
-
getRoutingPolicy
The Routing Policy used by the service.- Specified by:
getRoutingPolicyin interfaceIService
-
getServiceArn
The Arn of the namespace that you want to use for DNS configuration.- Specified by:
getServiceArnin interfaceIService
-
getServiceId
The ID of the namespace that you want to use for DNS configuration.- Specified by:
getServiceIdin interfaceIService
-
getServiceName
A name for the Cloudmap Service.- Specified by:
getServiceNamein interfaceIService
-