java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:37.540Z") @Stability(Stable) public class CfnService extends CfnResource implements IInspectable, ITaggable
A complex type that contains information about a service, which defines the configuration of the following entities:.

  • For public and private DNS namespaces, one of the following combinations of DNS records in Amazon Route 53:
  • A
  • AAAA
  • A and AAAA
  • SRV
  • CNAME
  • Optionally, a health check

Example:

 // 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.*;
 CfnService cfnService = CfnService.Builder.create(this, "MyCfnService")
         .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")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .type("type")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnService

      protected CfnService(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnService

      protected CfnService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnService

      @Stability(Stable) public CfnService(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnServiceProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnService

      @Stability(Stable) public CfnService(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the service.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the service.
    • getAttrName

      @Stability(Stable) @NotNull public String getAttrName()
      The name that you assigned to the service.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the service.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the service.
    • getDnsConfig

      @Stability(Stable) @Nullable public Object getDnsConfig()
      A complex type that contains information about the Route 53 DNS records that you want AWS Cloud Map to create when you register an instance.
    • setDnsConfig

      @Stability(Stable) public void setDnsConfig(@Nullable IResolvable value)
      A complex type that contains information about the Route 53 DNS records that you want AWS Cloud Map to create when you register an instance.
    • setDnsConfig

      @Stability(Stable) public void setDnsConfig(@Nullable CfnService.DnsConfigProperty value)
      A complex type that contains information about the Route 53 DNS records that you want AWS Cloud Map to create when you register an instance.
    • getHealthCheckConfig

      @Stability(Stable) @Nullable public Object getHealthCheckConfig()
      Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. If you specify settings for a health check, AWS Cloud Map associates the health check with the records that you specify in DnsConfig .
    • setHealthCheckConfig

      @Stability(Stable) public void setHealthCheckConfig(@Nullable IResolvable value)
      Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. If you specify settings for a health check, AWS Cloud Map associates the health check with the records that you specify in DnsConfig .
    • setHealthCheckConfig

      @Stability(Stable) public void setHealthCheckConfig(@Nullable CfnService.HealthCheckConfigProperty value)
      Public DNS and HTTP namespaces only. A complex type that contains settings for an optional health check. If you specify settings for a health check, AWS Cloud Map associates the health check with the records that you specify in DnsConfig .
    • getHealthCheckCustomConfig

      @Stability(Stable) @Nullable public Object getHealthCheckCustomConfig()
      A complex type that contains information about an optional custom health check.
    • setHealthCheckCustomConfig

      @Stability(Stable) public void setHealthCheckCustomConfig(@Nullable IResolvable value)
      A complex type that contains information about an optional custom health check.
    • setHealthCheckCustomConfig

      @Stability(Stable) public void setHealthCheckCustomConfig(@Nullable CfnService.HealthCheckCustomConfigProperty value)
      A complex type that contains information about an optional custom health check.
    • getName

      @Stability(Stable) @Nullable public String getName()
      The name of the service.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      The name of the service.
    • getNamespaceId

      @Stability(Stable) @Nullable public String getNamespaceId()
      The ID of the namespace that was used to create the service.
    • setNamespaceId

      @Stability(Stable) public void setNamespaceId(@Nullable String value)
      The ID of the namespace that was used to create the service.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The tags for the service.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The tags for the service.
    • getType

      @Stability(Stable) @Nullable public String getType()
      If present, specifies that the service instances are only discoverable using the DiscoverInstances API operation.
    • setType

      @Stability(Stable) public void setType(@Nullable String value)
      If present, specifies that the service instances are only discoverable using the DiscoverInstances API operation.