Class BaseServiceProps
Basic props needed to create a service in a given namespace.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ServiceDiscovery
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BaseServiceProps : Object, IBaseServiceProps
Syntax (vb)
Public Class BaseServiceProps
Inherits Object
Implements IBaseServiceProps
Remarks
Used by HttpNamespace.createService
ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts infused
Examples
using Amazon.CDK;
using Amazon.CDK;
var app = new App();
var stack = new Stack(app, "aws-servicediscovery-integ");
var namespace = new HttpNamespace(stack, "MyNamespace", new HttpNamespaceProps {
Name = "MyHTTPNamespace"
});
var service1 = namespace.CreateService("NonIpService", new BaseServiceProps {
Description = "service registering non-ip instances"
});
service1.RegisterNonIpInstance("NonIpInstance", new NonIpInstanceBaseProps {
CustomAttributes = new Dictionary<string, string> { { "arn", "arn:aws:s3:::mybucket" } }
});
var service2 = namespace.CreateService("IpService", new BaseServiceProps {
Description = "service registering ip instances",
HealthCheck = new HealthCheckConfig {
Type = HealthCheckType.HTTP,
ResourcePath = "/check"
}
});
service2.RegisterIpInstance("IpInstance", new IpInstanceBaseProps {
Ipv4 = "54.239.25.192"
});
app.Synth();
Synopsis
Constructors
BaseServiceProps() |
Properties
CustomHealthCheck | Structure containing failure threshold for a custom health checker. |
Description | A description of the service. |
HealthCheck | Settings for an optional health check. |
Name | A name for the Service. |
Constructors
BaseServiceProps()
public BaseServiceProps()
Properties
CustomHealthCheck
Structure containing failure threshold for a custom health checker.
public IHealthCheckCustomConfig CustomHealthCheck { get; set; }
Property Value
Remarks
Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html
Default: none
Description
A description of the service.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: none
HealthCheck
Settings for an optional health check.
public IHealthCheckConfig HealthCheck { get; set; }
Property Value
Remarks
If you specify health check settings, AWS Cloud Map associates the health check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to this service.
Default: none
Name
A name for the Service.
public string Name { get; set; }
Property Value
System.String
Remarks
Default: CloudFormation-generated name