ServiceAttributes Struct
| Source | aws-servicediscovery/lib/service.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_servicediscovery as servicediscovery } from 'aws-cdk-lib';
declare const namespace: servicediscovery.INamespace;
const serviceAttributes: servicediscovery.ServiceAttributes = {
dnsRecordType: servicediscovery.DnsRecordType.A,
namespace: namespace,
routingPolicy: servicediscovery.RoutingPolicy.WEIGHTED,
serviceArn: 'serviceArn',
serviceId: 'serviceId',
serviceName: 'serviceName',
// the properties below are optional
discoveryType: servicediscovery.DiscoveryType.API,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_servicediscovery as servicediscovery
# namespace: servicediscovery.INamespace
service_attributes = servicediscovery.ServiceAttributes(
dns_record_type=servicediscovery.DnsRecordType.A,
namespace=namespace,
routing_policy=servicediscovery.RoutingPolicy.WEIGHTED,
service_arn="serviceArn",
service_id="serviceId",
service_name="serviceName",
# the properties below are optional
discovery_type=servicediscovery.DiscoveryType.API
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.servicediscovery.*;
INamespace namespace;
ServiceAttributes serviceAttributes = ServiceAttributes.builder()
.dnsRecordType(DnsRecordType.A)
.namespace(namespace)
.routingPolicy(RoutingPolicy.WEIGHTED)
.serviceArn("serviceArn")
.serviceId("serviceId")
.serviceName("serviceName")
// the properties below are optional
.discoveryType(DiscoveryType.API)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ServiceDiscovery;
INamespace namespace;
var serviceAttributes = new ServiceAttributes {
DnsRecordType = DnsRecordType.A,
Namespace = namespace,
RoutingPolicy = RoutingPolicy.WEIGHTED,
ServiceArn = "serviceArn",
ServiceId = "serviceId",
ServiceName = "serviceName",
// the properties below are optional
DiscoveryType = DiscoveryType.API
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var namespace INamespace
serviceAttributes := &ServiceAttributes{
DnsRecordType: awscdk.Aws_servicediscovery.DnsRecordType_A,
Namespace: namespace,
RoutingPolicy: awscdk.*Aws_servicediscovery.RoutingPolicy_WEIGHTED,
ServiceArn: jsii.String("serviceArn"),
ServiceId: jsii.String("serviceId"),
ServiceName: jsii.String("serviceName"),
// the properties below are optional
DiscoveryType: awscdk.*Aws_servicediscovery.DiscoveryType_API,
}
Properties
discoveryTypeoptionalDiscoveryTypediscovery_typeoptionalDiscoveryTypediscoveryTypeoptionalDiscoveryTypeDiscoveryTypeoptionalDiscoveryTypeDiscoveryTypeoptionalDiscoveryType #dnsRecordTypeDnsRecordTypedns_record_typeDnsRecordTypednsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordType required #namespaceINamespacenamespaceINamespacenamespaceINamespaceNamespaceINamespaceNamespaceINamespace required #routingPolicyRoutingPolicyrouting_policyRoutingPolicyroutingPolicyRoutingPolicyRoutingPolicyRoutingPolicyRoutingPolicyRoutingPolicy required #