Interface IBaseServiceProps
Basic props needed to create a service in a given namespace.
Namespace: Amazon.CDK.AWS.ServiceDiscovery
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IBaseServiceProps
Syntax (vb)
Public Interface 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:::amzn-s3-demo-bucket" } }
});
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
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. |
Properties
CustomHealthCheck
Structure containing failure threshold for a custom health checker.
virtual IHealthCheckCustomConfig CustomHealthCheck { get; }
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.
virtual string Description { get; }
Property Value
System.String
Remarks
Default: none
HealthCheck
Settings for an optional health check.
virtual IHealthCheckConfig HealthCheck { get; }
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.
virtual string Name { get; }
Property Value
System.String
Remarks
Default: CloudFormation-generated name