Class Service
Define a CloudMap Service.
Inherited Members
Namespace: Amazon.CDK.AWS.ServiceDiscovery
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Service : Resource, IService, IResource
Syntax (vb)
Public Class Service
Inherits Resource
Implements IService, IResource
Remarks
ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-public-dns-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 PublicDnsNamespace(stack, "Namespace", new PublicDnsNamespaceProps {
Name = "foobar.com"
});
var service = namespace.CreateService("Service", new DnsServiceProps {
Name = "foo",
DnsRecordType = DnsRecordType.A,
DnsTtl = Duration.Seconds(30),
HealthCheck = new HealthCheckConfig {
Type = HealthCheckType.HTTPS,
ResourcePath = "/healthcheck",
FailureThreshold = 2
}
});
service.RegisterIpInstance("IpInstance", new IpInstanceBaseProps {
Ipv4 = "54.239.25.192",
Port = 443
});
app.Synth();
Synopsis
Constructors
Service(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Service(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Service(Construct, String, IServiceProps) |
Properties
DiscoveryType | The discovery type used by this service. |
DnsRecordType | The DnsRecordType used by the service. |
Namespace | The namespace for the Cloudmap Service. |
RoutingPolicy | The Routing Policy used by the service. |
ServiceArn | The Arn of the namespace that you want to use for DNS configuration. |
ServiceId | The ID of the namespace that you want to use for DNS configuration. |
ServiceName | A name for the Cloudmap Service. |
Methods
FromServiceAttributes(Construct, String, IServiceAttributes) | |
RegisterCnameInstance(String, ICnameInstanceBaseProps) | Registers a resource that is accessible using a CNAME. |
RegisterIpInstance(String, IIpInstanceBaseProps) | Registers a resource that is accessible using an IP address. |
RegisterLoadBalancer(String, ILoadBalancerV2, IDictionary<String, String>) | Registers an ELB as a new instance with unique name instanceId in this service. |
RegisterNonIpInstance(String, INonIpInstanceBaseProps) | Registers a resource that is accessible using values other than an IP address or a domain name (CNAME). |
Constructors
Service(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Service(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Service(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Service(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Service(Construct, String, IServiceProps)
public Service(Construct scope, string id, IServiceProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IServiceProps
Properties
DiscoveryType
The discovery type used by this service.
public virtual DiscoveryType DiscoveryType { get; }
Property Value
DnsRecordType
The DnsRecordType used by the service.
public virtual DnsRecordType DnsRecordType { get; }
Property Value
Namespace
The namespace for the Cloudmap Service.
public virtual INamespace Namespace { get; }
Property Value
RoutingPolicy
The Routing Policy used by the service.
public virtual RoutingPolicy RoutingPolicy { get; }
Property Value
ServiceArn
The Arn of the namespace that you want to use for DNS configuration.
public virtual string ServiceArn { get; }
Property Value
System.String
ServiceId
The ID of the namespace that you want to use for DNS configuration.
public virtual string ServiceId { get; }
Property Value
System.String
ServiceName
A name for the Cloudmap Service.
public virtual string ServiceName { get; }
Property Value
System.String
Methods
FromServiceAttributes(Construct, String, IServiceAttributes)
public static IService FromServiceAttributes(Construct scope, string id, IServiceAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IServiceAttributes
Returns
RegisterCnameInstance(String, ICnameInstanceBaseProps)
Registers a resource that is accessible using a CNAME.
public virtual IInstance RegisterCnameInstance(string id, ICnameInstanceBaseProps props)
Parameters
- id System.String
- props ICnameInstanceBaseProps
Returns
RegisterIpInstance(String, IIpInstanceBaseProps)
Registers a resource that is accessible using an IP address.
public virtual IInstance RegisterIpInstance(string id, IIpInstanceBaseProps props)
Parameters
- id System.String
- props IIpInstanceBaseProps
Returns
RegisterLoadBalancer(String, ILoadBalancerV2, IDictionary<String, String>)
Registers an ELB as a new instance with unique name instanceId in this service.
public virtual IInstance RegisterLoadBalancer(string id, ILoadBalancerV2 loadBalancer, IDictionary<string, string> customAttributes = null)
Parameters
- id System.String
- loadBalancer ILoadBalancerV2
- customAttributes System.Collections.Generic.IDictionary<System.String, System.String>
Returns
RegisterNonIpInstance(String, INonIpInstanceBaseProps)
Registers a resource that is accessible using values other than an IP address or a domain name (CNAME).
public virtual IInstance RegisterNonIpInstance(string id, INonIpInstanceBaseProps props)
Parameters
- id System.String
- props INonIpInstanceBaseProps
Returns