AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.servicediscovery.getService
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_aws as aws
test = aws.servicediscovery.get_service(name="example",
    namespace_id="NAMESPACE_ID_VALUE")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  test:
    fn::invoke:
      function: aws:servicediscovery:getService
      arguments:
        name: example
        namespaceId: NAMESPACE_ID_VALUE
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>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]func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput> 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)
}public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
public static Output<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
fn::invoke:
  function: aws:servicediscovery/getService:getService
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Name of the service.
- NamespaceId string
- ID of the namespace that the service belongs to.
- Dictionary<string, string>
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Dictionary<string, string>
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Name string
- Name of the service.
- NamespaceId string
- ID of the namespace that the service belongs to.
- map[string]string
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- map[string]string
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- name String
- Name of the service.
- namespaceId String
- ID of the namespace that the service belongs to.
- Map<String,String>
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String,String>
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- name string
- Name of the service.
- namespaceId string
- ID of the namespace that the service belongs to.
- {[key: string]: string}
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- {[key: string]: string}
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- name str
- Name of the service.
- namespace_id str
- ID of the namespace that the service belongs to.
- Mapping[str, str]
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Mapping[str, str]
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- name String
- Name of the service.
- namespaceId String
- ID of the namespace that the service belongs to.
- Map<String>
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Map<String>
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
getService Result
The following output properties are available:
- Arn string
- ARN of the service.
- Description string
- Description of the service.
- DnsConfigs List<GetService Dns Config> 
- 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_configBlock for details.
- HealthCheck List<GetConfigs Service Health Check Config> 
- Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_configBlock for details.
- HealthCheck List<GetCustom Configs Service Health Check Custom Config> 
- A complex type that contains settings for ECS managed health checks. See health_check_custom_configBlock 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.
- Dictionary<string, string>
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Dictionary<string, string>
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration 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 []GetService Dns Config 
- 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_configBlock for details.
- HealthCheck []GetConfigs Service Health Check Config 
- Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_configBlock for details.
- HealthCheck []GetCustom Configs Service Health Check Custom Config 
- A complex type that contains settings for ECS managed health checks. See health_check_custom_configBlock 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.
- map[string]string
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- map[string]string
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration 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<GetService Dns Config> 
- 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_configBlock for details.
- healthCheck List<GetConfigs Service Health Check Config> 
- Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_configBlock for details.
- healthCheck List<GetCustom Configs Service Health Check Custom Config> 
- A complex type that contains settings for ECS managed health checks. See health_check_custom_configBlock 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.
- Map<String,String>
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Map<String,String>
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration 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 GetService Dns Config[] 
- 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_configBlock for details.
- healthCheck GetConfigs Service Health Check Config[] 
- Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_configBlock for details.
- healthCheck GetCustom Configs Service Health Check Custom Config[] 
- A complex type that contains settings for ECS managed health checks. See health_check_custom_configBlock 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.
- {[key: string]: string}
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- {[key: string]: string}
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration 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[GetService Dns Config] 
- 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_configBlock for details.
- health_check_ Sequence[Getconfigs Service Health Check Config] 
- Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_configBlock for details.
- health_check_ Sequence[Getcustom_ configs Service Health Check Custom Config] 
- A complex type that contains settings for ECS managed health checks. See health_check_custom_configBlock 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.
- Mapping[str, str]
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Mapping[str, str]
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration 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_configBlock for details.
- healthCheck List<Property Map>Configs 
- Complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_configBlock for details.
- healthCheck List<Property Map>Custom Configs 
- A complex type that contains settings for ECS managed health checks. See health_check_custom_configBlock 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.
- Map<String>
- (Deprecated) Map of tags assigned to the resource, including those inherited from the provider default_tagsconfiguration block.
- Map<String>
- Map of tags to assign to the service. If configured with a provider default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
Supporting Types
GetServiceDnsConfig   
- DnsRecords List<GetService Dns Config Dns Record> 
- An array that contains one DnsRecord object for each resource record set. See dns_recordsBlock for details.
- NamespaceId string
- ID of the namespace that the service belongs to.
- RoutingPolicy 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 []GetService Dns Config Dns Record 
- An array that contains one DnsRecord object for each resource record set. See dns_recordsBlock for details.
- NamespaceId string
- ID of the namespace that the service belongs to.
- RoutingPolicy 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 List<GetService Dns Config Dns Record> 
- An array that contains one DnsRecord object for each resource record set. See dns_recordsBlock for details.
- namespaceId String
- ID of the namespace that the service belongs to.
- routingPolicy 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 GetService Dns Config Dns Record[] 
- An array that contains one DnsRecord object for each resource record set. See dns_recordsBlock for details.
- namespaceId string
- ID of the namespace that the service belongs to.
- routingPolicy 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 Sequence[GetService Dns Config Dns Record] 
- An array that contains one DnsRecord object for each resource record set. See dns_recordsBlock for details.
- namespace_id str
- ID of the namespace that the service belongs to.
- routing_policy 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 List<Property Map>
- An array that contains one DnsRecord object for each resource record set. See dns_recordsBlock for details.
- namespaceId String
- ID of the namespace that the service belongs to.
- routingPolicy 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     
GetServiceHealthCheckConfig    
- FailureThreshold 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 awsTerraform Provider.