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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:45.610Z") @Stability(Stable) public class CfnService extends CfnResource implements IInspectable
A CloudFormation AWS::ServiceDiscovery::Service.

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();
 
  • 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 Construct scope, @NotNull String id, @Nullable CfnServiceProps props)
      Create a new AWS::ServiceDiscovery::Service.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
    • CfnService

      @Stability(Stable) public CfnService(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::ServiceDiscovery::Service.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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()
      The tags for the service.

      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.

    • 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.

      The record types of a service can only be changed by deleting the service and recreating it with a new Dnsconfig .

    • 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.

      The record types of a service can only be changed by deleting the service and recreating it with a new Dnsconfig .

    • 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.

      The record types of a service can only be changed by deleting the service and recreating it with a new Dnsconfig .

    • 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 .

      For information about the charges for health checks, see Amazon Route 53 Pricing .

    • 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 .

      For information about the charges for health checks, see Amazon Route 53 Pricing .

    • 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 .

      For information about the charges for health checks, see Amazon Route 53 Pricing .

    • getHealthCheckCustomConfig

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

      If you specify a health check configuration, you can specify either HealthCheckCustomConfig or HealthCheckConfig but not both.

    • setHealthCheckCustomConfig

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

      If you specify a health check configuration, you can specify either HealthCheckCustomConfig or HealthCheckConfig but not both.

    • setHealthCheckCustomConfig

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

      If you specify a health check configuration, you can specify either HealthCheckCustomConfig or HealthCheckConfig but not both.

    • 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.

      You must specify a value for NamespaceId either for the service properties or for DnsConfig . Don't specify a value in both places.

    • setNamespaceId

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

      You must specify a value for NamespaceId either for the service properties or for DnsConfig . Don't specify a value in both places.

    • getType

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

      No DNS records is registered for the service instances. The only valid value is HTTP .

    • setType

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

      No DNS records is registered for the service instances. The only valid value is HTTP .