1. Packages
  2. AWS
  3. API Docs
  4. servicediscovery
  5. getService
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.servicediscovery.getService

Explore with Pulumi AI

AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

Retrieves information about a Service Discovery Service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = aws.servicediscovery.getService({
    name: "example",
    namespaceId: "NAMESPACE_ID_VALUE",
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.servicediscovery.get_service(name="example",
    namespace_id="NAMESPACE_ID_VALUE")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicediscovery"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := servicediscovery.LookupService(ctx, &servicediscovery.LookupServiceArgs{
			Name:        "example",
			NamespaceId: "NAMESPACE_ID_VALUE",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = Aws.ServiceDiscovery.GetService.Invoke(new()
    {
        Name = "example",
        NamespaceId = "NAMESPACE_ID_VALUE",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.servicediscovery.ServicediscoveryFunctions;
import com.pulumi.aws.servicediscovery.inputs.GetServiceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var test = ServicediscoveryFunctions.getService(GetServiceArgs.builder()
            .name("example")
            .namespaceId("NAMESPACE_ID_VALUE")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: aws:servicediscovery:getService
      arguments:
        name: example
        namespaceId: NAMESPACE_ID_VALUE
Copy

Using getService

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
Copy
def get_service(name: Optional[str] = None,
                namespace_id: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None,
                tags_all: Optional[Mapping[str, str]] = None,
                opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(name: Optional[pulumi.Input[str]] = None,
                namespace_id: Optional[pulumi.Input[str]] = None,
                tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                tags_all: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
Copy
func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput
Copy

> Note: This function is named LookupService in the Go SDK.

public static class GetService 
{
    public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
public static Output<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:servicediscovery/getService:getService
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the service.
NamespaceId This property is required. string
ID of the namespace that the service belongs to.
Tags Dictionary<string, string>
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

Name This property is required. string
Name of the service.
NamespaceId This property is required. string
ID of the namespace that the service belongs to.
Tags map[string]string
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

name This property is required. String
Name of the service.
namespaceId This property is required. String
ID of the namespace that the service belongs to.
tags Map<String,String>
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

name This property is required. string
Name of the service.
namespaceId This property is required. string
ID of the namespace that the service belongs to.
tags {[key: string]: string}
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

name This property is required. str
Name of the service.
namespace_id This property is required. str
ID of the namespace that the service belongs to.
tags Mapping[str, str]
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

name This property is required. String
Name of the service.
namespaceId This property is required. String
ID of the namespace that the service belongs to.
tags Map<String>
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

getService Result

The following output properties are available:

Arn string
ARN of the service.
Description string
Description of the service.
DnsConfigs List<GetServiceDnsConfig>
Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. See dns_config Block for details.
HealthCheckConfigs List<GetServiceHealthCheckConfig>
Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
HealthCheckCustomConfigs List<GetServiceHealthCheckCustomConfig>
A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
Id string
The provider-assigned unique ID for this managed resource.
Name string
NamespaceId string
ID of the namespace to use for DNS configuration.
TagsAll Dictionary<string, string>
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

Tags Dictionary<string, string>
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Arn string
ARN of the service.
Description string
Description of the service.
DnsConfigs []GetServiceDnsConfig
Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. See dns_config Block for details.
HealthCheckConfigs []GetServiceHealthCheckConfig
Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
HealthCheckCustomConfigs []GetServiceHealthCheckCustomConfig
A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
Id string
The provider-assigned unique ID for this managed resource.
Name string
NamespaceId string
ID of the namespace to use for DNS configuration.
TagsAll map[string]string
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

Tags map[string]string
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
arn String
ARN of the service.
description String
Description of the service.
dnsConfigs List<GetServiceDnsConfig>
Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. See dns_config Block for details.
healthCheckConfigs List<GetServiceHealthCheckConfig>
Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
healthCheckCustomConfigs List<GetServiceHealthCheckCustomConfig>
A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
id String
The provider-assigned unique ID for this managed resource.
name String
namespaceId String
ID of the namespace to use for DNS configuration.
tagsAll Map<String,String>
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

tags Map<String,String>
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
arn string
ARN of the service.
description string
Description of the service.
dnsConfigs GetServiceDnsConfig[]
Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. See dns_config Block for details.
healthCheckConfigs GetServiceHealthCheckConfig[]
Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
healthCheckCustomConfigs GetServiceHealthCheckCustomConfig[]
A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
id string
The provider-assigned unique ID for this managed resource.
name string
namespaceId string
ID of the namespace to use for DNS configuration.
tagsAll {[key: string]: string}
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

tags {[key: string]: string}
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
arn str
ARN of the service.
description str
Description of the service.
dns_configs Sequence[GetServiceDnsConfig]
Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. See dns_config Block for details.
health_check_configs Sequence[GetServiceHealthCheckConfig]
Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
health_check_custom_configs Sequence[GetServiceHealthCheckCustomConfig]
A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
id str
The provider-assigned unique ID for this managed resource.
name str
namespace_id str
ID of the namespace to use for DNS configuration.
tags_all Mapping[str, str]
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

tags Mapping[str, str]
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
arn String
ARN of the service.
description String
Description of the service.
dnsConfigs List<Property Map>
Complex type that contains information about the resource record sets that you want Amazon Route 53 to create when you register an instance. See dns_config Block for details.
healthCheckConfigs List<Property Map>
Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
healthCheckCustomConfigs List<Property Map>
A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
id String
The provider-assigned unique ID for this managed resource.
name String
namespaceId String
ID of the namespace to use for DNS configuration.
tagsAll Map<String>
(Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: tags_all is deprecated. This argument will be removed in a future major version.

tags Map<String>
Map of tags to assign to the service. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Supporting Types

GetServiceDnsConfig

DnsRecords This property is required. List<GetServiceDnsConfigDnsRecord>
An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
NamespaceId This property is required. string
ID of the namespace that the service belongs to.
RoutingPolicy This property is required. string
Routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED
DnsRecords This property is required. []GetServiceDnsConfigDnsRecord
An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
NamespaceId This property is required. string
ID of the namespace that the service belongs to.
RoutingPolicy This property is required. string
Routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED
dnsRecords This property is required. List<GetServiceDnsConfigDnsRecord>
An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
namespaceId This property is required. String
ID of the namespace that the service belongs to.
routingPolicy This property is required. String
Routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED
dnsRecords This property is required. GetServiceDnsConfigDnsRecord[]
An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
namespaceId This property is required. string
ID of the namespace that the service belongs to.
routingPolicy This property is required. string
Routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED
dns_records This property is required. Sequence[GetServiceDnsConfigDnsRecord]
An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
namespace_id This property is required. str
ID of the namespace that the service belongs to.
routing_policy This property is required. str
Routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED
dnsRecords This property is required. List<Property Map>
An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
namespaceId This property is required. String
ID of the namespace that the service belongs to.
routingPolicy This property is required. String
Routing policy that you want to apply to all records that Route 53 creates when you register an instance and specify the service. Valid Values: MULTIVALUE, WEIGHTED

GetServiceDnsConfigDnsRecord

Ttl This property is required. int
Amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
Type This property is required. string
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
Ttl This property is required. int
Amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
Type This property is required. string
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
ttl This property is required. Integer
Amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
type This property is required. String
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
ttl This property is required. number
Amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
type This property is required. string
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
ttl This property is required. int
Amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
type This property is required. str
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
ttl This property is required. Number
Amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
type This property is required. String
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP

GetServiceHealthCheckConfig

FailureThreshold This property is required. int
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
ResourcePath This property is required. string
Path that you want Route 53 to request when performing health checks. Route 53 automatically adds the DNS name for the service. If you don't specify a value, the default value is /.
Type This property is required. string
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
FailureThreshold This property is required. int
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
ResourcePath This property is required. string
Path that you want Route 53 to request when performing health checks. Route 53 automatically adds the DNS name for the service. If you don't specify a value, the default value is /.
Type This property is required. string
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
failureThreshold This property is required. Integer
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
resourcePath This property is required. String
Path that you want Route 53 to request when performing health checks. Route 53 automatically adds the DNS name for the service. If you don't specify a value, the default value is /.
type This property is required. String
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
failureThreshold This property is required. number
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
resourcePath This property is required. string
Path that you want Route 53 to request when performing health checks. Route 53 automatically adds the DNS name for the service. If you don't specify a value, the default value is /.
type This property is required. string
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
failure_threshold This property is required. int
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
resource_path This property is required. str
Path that you want Route 53 to request when performing health checks. Route 53 automatically adds the DNS name for the service. If you don't specify a value, the default value is /.
type This property is required. str
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP
failureThreshold This property is required. Number
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
resourcePath This property is required. String
Path that you want Route 53 to request when performing health checks. Route 53 automatically adds the DNS name for the service. If you don't specify a value, the default value is /.
type This property is required. String
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. Valid Values: HTTP, HTTPS, TCP

GetServiceHealthCheckCustomConfig

FailureThreshold This property is required. int
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
FailureThreshold This property is required. int
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
failureThreshold This property is required. Integer
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
failureThreshold This property is required. number
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
failure_threshold This property is required. int
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.
failureThreshold This property is required. Number
The number of 30-second intervals that you want service discovery to wait before it changes the health status of a service instance. Maximum value of 10.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi