CfnServiceProps Struct
Properties for defining a CfnService.
| Source | |
|---|---|
| Type last changed |
Example
// 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';
const cfnServiceProps: servicediscovery.CfnServiceProps = {
description: 'description',
dnsConfig: {
dnsRecords: [{
ttl: 123,
type: 'type',
}],
// the properties below are optional
namespaceId: 'namespaceId',
routingPolicy: 'routingPolicy',
},
healthCheckConfig: {
type: 'type',
// the properties below are optional
failureThreshold: 123,
resourcePath: 'resourcePath',
},
healthCheckCustomConfig: {
failureThreshold: 123,
},
name: 'name',
namespaceId: 'namespaceId',
serviceAttributes: {
serviceAttributesKey: 'serviceAttributes',
},
tags: [{
key: 'key',
value: 'value',
}],
type: 'type',
};
from aws_cdk import CfnTag
# 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
cfn_service_props = servicediscovery.CfnServiceProps(
description="description",
dns_config=servicediscovery.CfnService.DnsConfigProperty(
dns_records=[servicediscovery.CfnService.DnsRecordProperty(
ttl=123,
type="type"
)],
# the properties below are optional
namespace_id="namespaceId",
routing_policy="routingPolicy"
),
health_check_config=servicediscovery.CfnService.HealthCheckConfigProperty(
type="type",
# the properties below are optional
failure_threshold=123,
resource_path="resourcePath"
),
health_check_custom_config=servicediscovery.CfnService.HealthCheckCustomConfigProperty(
failure_threshold=123
),
name="name",
namespace_id="namespaceId",
service_attributes={
"service_attributes_key": "serviceAttributes"
},
tags=[CfnTag(
key="key",
value="value"
)],
type="type"
)
// 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.*;
CfnServiceProps cfnServiceProps = CfnServiceProps.builder()
.description("description")
.dnsConfig(DnsConfigProperty.builder()
.dnsRecords(List.of(DnsRecordProperty.builder()
.ttl(123)
.type("type")
.build()))
// the properties below are optional
.namespaceId("namespaceId")
.routingPolicy("routingPolicy")
.build())
.healthCheckConfig(HealthCheckConfigProperty.builder()
.type("type")
// the properties below are optional
.failureThreshold(123)
.resourcePath("resourcePath")
.build())
.healthCheckCustomConfig(HealthCheckCustomConfigProperty.builder()
.failureThreshold(123)
.build())
.name("name")
.namespaceId("namespaceId")
.serviceAttributes(Map.of(
"serviceAttributesKey", "serviceAttributes"))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.type("type")
.build();
// 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;
var cfnServiceProps = new CfnServiceProps {
Description = "description",
DnsConfig = new DnsConfigProperty {
DnsRecords = new [] { new DnsRecordProperty {
Ttl = 123,
Type = "type"
} },
// the properties below are optional
NamespaceId = "namespaceId",
RoutingPolicy = "routingPolicy"
},
HealthCheckConfig = new HealthCheckConfigProperty {
Type = "type",
// the properties below are optional
FailureThreshold = 123,
ResourcePath = "resourcePath"
},
HealthCheckCustomConfig = new HealthCheckCustomConfigProperty {
FailureThreshold = 123
},
Name = "name",
NamespaceId = "namespaceId",
ServiceAttributes = new Dictionary<string, string> {
{ "serviceAttributesKey", "serviceAttributes" }
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
Type = "type"
};
// 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"
cfnServiceProps := &CfnServiceProps{
Description: jsii.String("description"),
DnsConfig: &DnsConfigProperty{
DnsRecords: []interface{}{
&DnsRecordProperty{
Ttl: jsii.Number(123),
Type: jsii.String("type"),
},
},
// the properties below are optional
NamespaceId: jsii.String("namespaceId"),
RoutingPolicy: jsii.String("routingPolicy"),
},
HealthCheckConfig: &HealthCheckConfigProperty{
Type: jsii.String("type"),
// the properties below are optional
FailureThreshold: jsii.Number(123),
ResourcePath: jsii.String("resourcePath"),
},
HealthCheckCustomConfig: &HealthCheckCustomConfigProperty{
FailureThreshold: jsii.Number(123),
},
Name: jsii.String("name"),
NamespaceId: jsii.String("namespaceId"),
ServiceAttributes: map[string]*string{
"serviceAttributesKey": jsii.String("serviceAttributes"),
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
Type: jsii.String("type"),
}
Properties
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #dnsConfigoptionalIResolvable | CfnService.DnsConfigPropertydns_configoptionaltyping.Union[IResolvable, DnsConfigProperty]dnsConfigoptionalIResolvableDnsConfigoptionalIResolvableDnsConfigoptionalinterface{} #The record types of a service can only be changed by deleting the service and recreating it with a new
Dnsconfig.
healthCheckConfigoptionalIResolvable | CfnService.health_check_configoptionaltyping.Union[IResolvable, HealthCheckConfigProperty]healthCheckConfigoptionalIResolvableHealthCheckConfigoptionalIResolvableHealthCheckConfigoptionalinterface{} #For information about the charges for health checks, see Amazon Route 53 Pricing .
healthCheckCustomConfigoptionalIResolvable | CfnService.health_check_custom_configoptionaltyping.Union[IResolvable, HealthCheckCustomConfigProperty]healthCheckCustomConfigoptionalIResolvableHealthCheckCustomConfigoptionalIResolvableHealthCheckCustomConfigoptionalinterface{} #If you specify a health check configuration, you can specify either
HealthCheckCustomConfigorHealthCheckConfigbut not both.
namespaceIdoptionalstringnamespace_idoptionalstrnamespaceIdoptionalStringNamespaceIdoptionalstringNamespaceIdoptional*string #notes
For namespaces shared with your AWS account, specify the namespace ARN. For more information about shared namespaces, see Cross-account AWS Cloud Map namespace sharing in the AWS Cloud Map Developer Guide .
serviceAttributesoptionalIResolvable | { [key: string]: string }service_attributesoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]serviceAttributesoptionalIResolvableServiceAttributesoptionalIResolvableServiceAttributesoptionalinterface{} #tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
No DNS records is registered for the service instances. The only valid value is HTTP .