1. Packages
  2. AWS
  3. API Docs
  4. servicediscovery
  5. Service
AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi

aws.servicediscovery.Service

Explore with Pulumi AI

aws logo
AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi

    Provides a Service Discovery Service resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.Vpc("example", {
        cidrBlock: "10.0.0.0/16",
        enableDnsSupport: true,
        enableDnsHostnames: true,
    });
    const examplePrivateDnsNamespace = new aws.servicediscovery.PrivateDnsNamespace("example", {
        name: "example.mydomain.local",
        description: "example",
        vpc: example.id,
    });
    const exampleService = new aws.servicediscovery.Service("example", {
        name: "example",
        dnsConfig: {
            namespaceId: examplePrivateDnsNamespace.id,
            dnsRecords: [{
                ttl: 10,
                type: "A",
            }],
            routingPolicy: "MULTIVALUE",
        },
        healthCheckCustomConfig: {
            failureThreshold: 1,
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.Vpc("example",
        cidr_block="10.0.0.0/16",
        enable_dns_support=True,
        enable_dns_hostnames=True)
    example_private_dns_namespace = aws.servicediscovery.PrivateDnsNamespace("example",
        name="example.mydomain.local",
        description="example",
        vpc=example.id)
    example_service = aws.servicediscovery.Service("example",
        name="example",
        dns_config={
            "namespace_id": example_private_dns_namespace.id,
            "dns_records": [{
                "ttl": 10,
                "type": "A",
            }],
            "routing_policy": "MULTIVALUE",
        },
        health_check_custom_config={
            "failure_threshold": 1,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"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 {
    		example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
    			CidrBlock:          pulumi.String("10.0.0.0/16"),
    			EnableDnsSupport:   pulumi.Bool(true),
    			EnableDnsHostnames: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		examplePrivateDnsNamespace, err := servicediscovery.NewPrivateDnsNamespace(ctx, "example", &servicediscovery.PrivateDnsNamespaceArgs{
    			Name:        pulumi.String("example.mydomain.local"),
    			Description: pulumi.String("example"),
    			Vpc:         example.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = servicediscovery.NewService(ctx, "example", &servicediscovery.ServiceArgs{
    			Name: pulumi.String("example"),
    			DnsConfig: &servicediscovery.ServiceDnsConfigArgs{
    				NamespaceId: examplePrivateDnsNamespace.ID(),
    				DnsRecords: servicediscovery.ServiceDnsConfigDnsRecordArray{
    					&servicediscovery.ServiceDnsConfigDnsRecordArgs{
    						Ttl:  pulumi.Int(10),
    						Type: pulumi.String("A"),
    					},
    				},
    				RoutingPolicy: pulumi.String("MULTIVALUE"),
    			},
    			HealthCheckCustomConfig: &servicediscovery.ServiceHealthCheckCustomConfigArgs{
    				FailureThreshold: pulumi.Int(1),
    			},
    		})
    		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 example = new Aws.Ec2.Vpc("example", new()
        {
            CidrBlock = "10.0.0.0/16",
            EnableDnsSupport = true,
            EnableDnsHostnames = true,
        });
    
        var examplePrivateDnsNamespace = new Aws.ServiceDiscovery.PrivateDnsNamespace("example", new()
        {
            Name = "example.mydomain.local",
            Description = "example",
            Vpc = example.Id,
        });
    
        var exampleService = new Aws.ServiceDiscovery.Service("example", new()
        {
            Name = "example",
            DnsConfig = new Aws.ServiceDiscovery.Inputs.ServiceDnsConfigArgs
            {
                NamespaceId = examplePrivateDnsNamespace.Id,
                DnsRecords = new[]
                {
                    new Aws.ServiceDiscovery.Inputs.ServiceDnsConfigDnsRecordArgs
                    {
                        Ttl = 10,
                        Type = "A",
                    },
                },
                RoutingPolicy = "MULTIVALUE",
            },
            HealthCheckCustomConfig = new Aws.ServiceDiscovery.Inputs.ServiceHealthCheckCustomConfigArgs
            {
                FailureThreshold = 1,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.Vpc;
    import com.pulumi.aws.ec2.VpcArgs;
    import com.pulumi.aws.servicediscovery.PrivateDnsNamespace;
    import com.pulumi.aws.servicediscovery.PrivateDnsNamespaceArgs;
    import com.pulumi.aws.servicediscovery.Service;
    import com.pulumi.aws.servicediscovery.ServiceArgs;
    import com.pulumi.aws.servicediscovery.inputs.ServiceDnsConfigArgs;
    import com.pulumi.aws.servicediscovery.inputs.ServiceHealthCheckCustomConfigArgs;
    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) {
            var example = new Vpc("example", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .enableDnsSupport(true)
                .enableDnsHostnames(true)
                .build());
    
            var examplePrivateDnsNamespace = new PrivateDnsNamespace("examplePrivateDnsNamespace", PrivateDnsNamespaceArgs.builder()
                .name("example.mydomain.local")
                .description("example")
                .vpc(example.id())
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("example")
                .dnsConfig(ServiceDnsConfigArgs.builder()
                    .namespaceId(examplePrivateDnsNamespace.id())
                    .dnsRecords(ServiceDnsConfigDnsRecordArgs.builder()
                        .ttl(10)
                        .type("A")
                        .build())
                    .routingPolicy("MULTIVALUE")
                    .build())
                .healthCheckCustomConfig(ServiceHealthCheckCustomConfigArgs.builder()
                    .failureThreshold(1)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
          enableDnsSupport: true
          enableDnsHostnames: true
      examplePrivateDnsNamespace:
        type: aws:servicediscovery:PrivateDnsNamespace
        name: example
        properties:
          name: example.mydomain.local
          description: example
          vpc: ${example.id}
      exampleService:
        type: aws:servicediscovery:Service
        name: example
        properties:
          name: example
          dnsConfig:
            namespaceId: ${examplePrivateDnsNamespace.id}
            dnsRecords:
              - ttl: 10
                type: A
            routingPolicy: MULTIVALUE
          healthCheckCustomConfig:
            failureThreshold: 1
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.servicediscovery.PublicDnsNamespace("example", {
        name: "example.mydomain.com",
        description: "example",
    });
    const exampleService = new aws.servicediscovery.Service("example", {
        name: "example",
        dnsConfig: {
            namespaceId: example.id,
            dnsRecords: [{
                ttl: 10,
                type: "A",
            }],
        },
        healthCheckConfig: {
            failureThreshold: 10,
            resourcePath: "path",
            type: "HTTP",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.servicediscovery.PublicDnsNamespace("example",
        name="example.mydomain.com",
        description="example")
    example_service = aws.servicediscovery.Service("example",
        name="example",
        dns_config={
            "namespace_id": example.id,
            "dns_records": [{
                "ttl": 10,
                "type": "A",
            }],
        },
        health_check_config={
            "failure_threshold": 10,
            "resource_path": "path",
            "type": "HTTP",
        })
    
    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 {
    		example, err := servicediscovery.NewPublicDnsNamespace(ctx, "example", &servicediscovery.PublicDnsNamespaceArgs{
    			Name:        pulumi.String("example.mydomain.com"),
    			Description: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = servicediscovery.NewService(ctx, "example", &servicediscovery.ServiceArgs{
    			Name: pulumi.String("example"),
    			DnsConfig: &servicediscovery.ServiceDnsConfigArgs{
    				NamespaceId: example.ID(),
    				DnsRecords: servicediscovery.ServiceDnsConfigDnsRecordArray{
    					&servicediscovery.ServiceDnsConfigDnsRecordArgs{
    						Ttl:  pulumi.Int(10),
    						Type: pulumi.String("A"),
    					},
    				},
    			},
    			HealthCheckConfig: &servicediscovery.ServiceHealthCheckConfigArgs{
    				FailureThreshold: pulumi.Int(10),
    				ResourcePath:     pulumi.String("path"),
    				Type:             pulumi.String("HTTP"),
    			},
    		})
    		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 example = new Aws.ServiceDiscovery.PublicDnsNamespace("example", new()
        {
            Name = "example.mydomain.com",
            Description = "example",
        });
    
        var exampleService = new Aws.ServiceDiscovery.Service("example", new()
        {
            Name = "example",
            DnsConfig = new Aws.ServiceDiscovery.Inputs.ServiceDnsConfigArgs
            {
                NamespaceId = example.Id,
                DnsRecords = new[]
                {
                    new Aws.ServiceDiscovery.Inputs.ServiceDnsConfigDnsRecordArgs
                    {
                        Ttl = 10,
                        Type = "A",
                    },
                },
            },
            HealthCheckConfig = new Aws.ServiceDiscovery.Inputs.ServiceHealthCheckConfigArgs
            {
                FailureThreshold = 10,
                ResourcePath = "path",
                Type = "HTTP",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.servicediscovery.PublicDnsNamespace;
    import com.pulumi.aws.servicediscovery.PublicDnsNamespaceArgs;
    import com.pulumi.aws.servicediscovery.Service;
    import com.pulumi.aws.servicediscovery.ServiceArgs;
    import com.pulumi.aws.servicediscovery.inputs.ServiceDnsConfigArgs;
    import com.pulumi.aws.servicediscovery.inputs.ServiceHealthCheckConfigArgs;
    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) {
            var example = new PublicDnsNamespace("example", PublicDnsNamespaceArgs.builder()
                .name("example.mydomain.com")
                .description("example")
                .build());
    
            var exampleService = new Service("exampleService", ServiceArgs.builder()
                .name("example")
                .dnsConfig(ServiceDnsConfigArgs.builder()
                    .namespaceId(example.id())
                    .dnsRecords(ServiceDnsConfigDnsRecordArgs.builder()
                        .ttl(10)
                        .type("A")
                        .build())
                    .build())
                .healthCheckConfig(ServiceHealthCheckConfigArgs.builder()
                    .failureThreshold(10)
                    .resourcePath("path")
                    .type("HTTP")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:servicediscovery:PublicDnsNamespace
        properties:
          name: example.mydomain.com
          description: example
      exampleService:
        type: aws:servicediscovery:Service
        name: example
        properties:
          name: example
          dnsConfig:
            namespaceId: ${example.id}
            dnsRecords:
              - ttl: 10
                type: A
          healthCheckConfig:
            failureThreshold: 10
            resourcePath: path
            type: HTTP
    

    Create Service Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Service(name: string, args?: ServiceArgs, opts?: CustomResourceOptions);
    @overload
    def Service(resource_name: str,
                args: Optional[ServiceArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Service(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                description: Optional[str] = None,
                dns_config: Optional[ServiceDnsConfigArgs] = None,
                force_destroy: Optional[bool] = None,
                health_check_config: Optional[ServiceHealthCheckConfigArgs] = None,
                health_check_custom_config: Optional[ServiceHealthCheckCustomConfigArgs] = None,
                name: Optional[str] = None,
                namespace_id: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None,
                type: Optional[str] = None)
    func NewService(ctx *Context, name string, args *ServiceArgs, opts ...ResourceOption) (*Service, error)
    public Service(string name, ServiceArgs? args = null, CustomResourceOptions? opts = null)
    public Service(String name, ServiceArgs args)
    public Service(String name, ServiceArgs args, CustomResourceOptions options)
    
    type: aws:servicediscovery:Service
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ServiceArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ServiceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var exampleserviceResourceResourceFromServicediscoveryservice = new Aws.ServiceDiscovery.Service("exampleserviceResourceResourceFromServicediscoveryservice", new()
    {
        Description = "string",
        DnsConfig = new Aws.ServiceDiscovery.Inputs.ServiceDnsConfigArgs
        {
            DnsRecords = new[]
            {
                new Aws.ServiceDiscovery.Inputs.ServiceDnsConfigDnsRecordArgs
                {
                    Ttl = 0,
                    Type = "string",
                },
            },
            NamespaceId = "string",
            RoutingPolicy = "string",
        },
        ForceDestroy = false,
        HealthCheckConfig = new Aws.ServiceDiscovery.Inputs.ServiceHealthCheckConfigArgs
        {
            FailureThreshold = 0,
            ResourcePath = "string",
            Type = "string",
        },
        HealthCheckCustomConfig = new Aws.ServiceDiscovery.Inputs.ServiceHealthCheckCustomConfigArgs
        {
            FailureThreshold = 0,
        },
        Name = "string",
        NamespaceId = "string",
        Tags = 
        {
            { "string", "string" },
        },
        Type = "string",
    });
    
    example, err := servicediscovery.NewService(ctx, "exampleserviceResourceResourceFromServicediscoveryservice", &servicediscovery.ServiceArgs{
    	Description: pulumi.String("string"),
    	DnsConfig: &servicediscovery.ServiceDnsConfigArgs{
    		DnsRecords: servicediscovery.ServiceDnsConfigDnsRecordArray{
    			&servicediscovery.ServiceDnsConfigDnsRecordArgs{
    				Ttl:  pulumi.Int(0),
    				Type: pulumi.String("string"),
    			},
    		},
    		NamespaceId:   pulumi.String("string"),
    		RoutingPolicy: pulumi.String("string"),
    	},
    	ForceDestroy: pulumi.Bool(false),
    	HealthCheckConfig: &servicediscovery.ServiceHealthCheckConfigArgs{
    		FailureThreshold: pulumi.Int(0),
    		ResourcePath:     pulumi.String("string"),
    		Type:             pulumi.String("string"),
    	},
    	HealthCheckCustomConfig: &servicediscovery.ServiceHealthCheckCustomConfigArgs{
    		FailureThreshold: pulumi.Int(0),
    	},
    	Name:        pulumi.String("string"),
    	NamespaceId: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Type: pulumi.String("string"),
    })
    
    var exampleserviceResourceResourceFromServicediscoveryservice = new Service("exampleserviceResourceResourceFromServicediscoveryservice", ServiceArgs.builder()
        .description("string")
        .dnsConfig(ServiceDnsConfigArgs.builder()
            .dnsRecords(ServiceDnsConfigDnsRecordArgs.builder()
                .ttl(0)
                .type("string")
                .build())
            .namespaceId("string")
            .routingPolicy("string")
            .build())
        .forceDestroy(false)
        .healthCheckConfig(ServiceHealthCheckConfigArgs.builder()
            .failureThreshold(0)
            .resourcePath("string")
            .type("string")
            .build())
        .healthCheckCustomConfig(ServiceHealthCheckCustomConfigArgs.builder()
            .failureThreshold(0)
            .build())
        .name("string")
        .namespaceId("string")
        .tags(Map.of("string", "string"))
        .type("string")
        .build());
    
    exampleservice_resource_resource_from_servicediscoveryservice = aws.servicediscovery.Service("exampleserviceResourceResourceFromServicediscoveryservice",
        description="string",
        dns_config={
            "dns_records": [{
                "ttl": 0,
                "type": "string",
            }],
            "namespace_id": "string",
            "routing_policy": "string",
        },
        force_destroy=False,
        health_check_config={
            "failure_threshold": 0,
            "resource_path": "string",
            "type": "string",
        },
        health_check_custom_config={
            "failure_threshold": 0,
        },
        name="string",
        namespace_id="string",
        tags={
            "string": "string",
        },
        type="string")
    
    const exampleserviceResourceResourceFromServicediscoveryservice = new aws.servicediscovery.Service("exampleserviceResourceResourceFromServicediscoveryservice", {
        description: "string",
        dnsConfig: {
            dnsRecords: [{
                ttl: 0,
                type: "string",
            }],
            namespaceId: "string",
            routingPolicy: "string",
        },
        forceDestroy: false,
        healthCheckConfig: {
            failureThreshold: 0,
            resourcePath: "string",
            type: "string",
        },
        healthCheckCustomConfig: {
            failureThreshold: 0,
        },
        name: "string",
        namespaceId: "string",
        tags: {
            string: "string",
        },
        type: "string",
    });
    
    type: aws:servicediscovery:Service
    properties:
        description: string
        dnsConfig:
            dnsRecords:
                - ttl: 0
                  type: string
            namespaceId: string
            routingPolicy: string
        forceDestroy: false
        healthCheckConfig:
            failureThreshold: 0
            resourcePath: string
            type: string
        healthCheckCustomConfig:
            failureThreshold: 0
        name: string
        namespaceId: string
        tags:
            string: string
        type: string
    

    Service Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Service resource accepts the following input properties:

    Description string
    The description of the service.
    DnsConfig ServiceDnsConfig
    A 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.
    ForceDestroy bool
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    HealthCheckConfig ServiceHealthCheckConfig
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    HealthCheckCustomConfig ServiceHealthCheckCustomConfig
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    Name string
    The name of the service.
    NamespaceId string
    The ID of the namespace that you want to use to create the service.
    Tags Dictionary<string, string>
    A 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.
    Type string
    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.
    Description string
    The description of the service.
    DnsConfig ServiceDnsConfigArgs
    A 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.
    ForceDestroy bool
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    HealthCheckConfig ServiceHealthCheckConfigArgs
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    HealthCheckCustomConfig ServiceHealthCheckCustomConfigArgs
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    Name string
    The name of the service.
    NamespaceId string
    The ID of the namespace that you want to use to create the service.
    Tags map[string]string
    A 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.
    Type string
    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.
    description String
    The description of the service.
    dnsConfig ServiceDnsConfig
    A 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.
    forceDestroy Boolean
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    healthCheckConfig ServiceHealthCheckConfig
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    healthCheckCustomConfig ServiceHealthCheckCustomConfig
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name String
    The name of the service.
    namespaceId String
    The ID of the namespace that you want to use to create the service.
    tags Map<String,String>
    A 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.
    type String
    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.
    description string
    The description of the service.
    dnsConfig ServiceDnsConfig
    A 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.
    forceDestroy boolean
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    healthCheckConfig ServiceHealthCheckConfig
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    healthCheckCustomConfig ServiceHealthCheckCustomConfig
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name string
    The name of the service.
    namespaceId string
    The ID of the namespace that you want to use to create the service.
    tags {[key: string]: string}
    A 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.
    type string
    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.
    description str
    The description of the service.
    dns_config ServiceDnsConfigArgs
    A 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.
    force_destroy bool
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    health_check_config ServiceHealthCheckConfigArgs
    A 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_config ServiceHealthCheckCustomConfigArgs
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name str
    The name of the service.
    namespace_id str
    The ID of the namespace that you want to use to create the service.
    tags Mapping[str, str]
    A 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.
    type str
    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.
    description String
    The description of the service.
    dnsConfig Property Map
    A 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.
    forceDestroy Boolean
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    healthCheckConfig Property Map
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    healthCheckCustomConfig Property Map
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name String
    The name of the service.
    namespaceId String
    The ID of the namespace that you want to use to create the service.
    tags Map<String>
    A 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.
    type String
    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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Service resource produces the following output properties:

    Arn string
    The ARN of the service.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    The ARN of the service.
    Id string
    The provider-assigned unique ID for this managed resource.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN of the service.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    The ARN of the service.
    id string
    The provider-assigned unique ID for this managed resource.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    The ARN of the service.
    id str
    The provider-assigned unique ID for this managed resource.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    The ARN of the service.
    id String
    The provider-assigned unique ID for this managed resource.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Look up Existing Service Resource

    Get an existing Service resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ServiceState, opts?: CustomResourceOptions): Service
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            description: Optional[str] = None,
            dns_config: Optional[ServiceDnsConfigArgs] = None,
            force_destroy: Optional[bool] = None,
            health_check_config: Optional[ServiceHealthCheckConfigArgs] = None,
            health_check_custom_config: Optional[ServiceHealthCheckCustomConfigArgs] = None,
            name: Optional[str] = None,
            namespace_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            type: Optional[str] = None) -> Service
    func GetService(ctx *Context, name string, id IDInput, state *ServiceState, opts ...ResourceOption) (*Service, error)
    public static Service Get(string name, Input<string> id, ServiceState? state, CustomResourceOptions? opts = null)
    public static Service get(String name, Output<String> id, ServiceState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Arn string
    The ARN of the service.
    Description string
    The description of the service.
    DnsConfig ServiceDnsConfig
    A 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.
    ForceDestroy bool
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    HealthCheckConfig ServiceHealthCheckConfig
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    HealthCheckCustomConfig ServiceHealthCheckCustomConfig
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    Name string
    The name of the service.
    NamespaceId string
    The ID of the namespace that you want to use to create the service.
    Tags Dictionary<string, string>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Type string
    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.
    Arn string
    The ARN of the service.
    Description string
    The description of the service.
    DnsConfig ServiceDnsConfigArgs
    A 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.
    ForceDestroy bool
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    HealthCheckConfig ServiceHealthCheckConfigArgs
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    HealthCheckCustomConfig ServiceHealthCheckCustomConfigArgs
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    Name string
    The name of the service.
    NamespaceId string
    The ID of the namespace that you want to use to create the service.
    Tags map[string]string
    A 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
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Type string
    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.
    arn String
    The ARN of the service.
    description String
    The description of the service.
    dnsConfig ServiceDnsConfig
    A 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.
    forceDestroy Boolean
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    healthCheckConfig ServiceHealthCheckConfig
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    healthCheckCustomConfig ServiceHealthCheckCustomConfig
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name String
    The name of the service.
    namespaceId String
    The ID of the namespace that you want to use to create the service.
    tags Map<String,String>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type String
    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.
    arn string
    The ARN of the service.
    description string
    The description of the service.
    dnsConfig ServiceDnsConfig
    A 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.
    forceDestroy boolean
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    healthCheckConfig ServiceHealthCheckConfig
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    healthCheckCustomConfig ServiceHealthCheckCustomConfig
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name string
    The name of the service.
    namespaceId string
    The ID of the namespace that you want to use to create the service.
    tags {[key: string]: string}
    A 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}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type string
    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.
    arn str
    The ARN of the service.
    description str
    The description of the service.
    dns_config ServiceDnsConfigArgs
    A 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.
    force_destroy bool
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    health_check_config ServiceHealthCheckConfigArgs
    A 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_config ServiceHealthCheckCustomConfigArgs
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name str
    The name of the service.
    namespace_id str
    The ID of the namespace that you want to use to create the service.
    tags Mapping[str, str]
    A 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]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type str
    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.
    arn String
    The ARN of the service.
    description String
    The description of the service.
    dnsConfig Property Map
    A 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.
    forceDestroy Boolean
    A boolean that indicates all instances should be deleted from the service so that the service can be destroyed without error. These instances are not recoverable. Defaults to false.
    healthCheckConfig Property Map
    A complex type that contains settings for an optional health check. Only for Public DNS namespaces. See health_check_config Block for details.
    healthCheckCustomConfig Property Map
    A complex type that contains settings for ECS managed health checks. See health_check_custom_config Block for details.
    name String
    The name of the service.
    namespaceId String
    The ID of the namespace that you want to use to create the service.
    tags Map<String>
    A 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>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    type String
    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.

    Supporting Types

    ServiceDnsConfig, ServiceDnsConfigArgs

    DnsRecords List<ServiceDnsConfigDnsRecord>
    An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
    NamespaceId string
    The ID of the namespace to use for DNS configuration.
    RoutingPolicy string
    The 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 []ServiceDnsConfigDnsRecord
    An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
    NamespaceId string
    The ID of the namespace to use for DNS configuration.
    RoutingPolicy string
    The 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<ServiceDnsConfigDnsRecord>
    An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
    namespaceId String
    The ID of the namespace to use for DNS configuration.
    routingPolicy String
    The 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 ServiceDnsConfigDnsRecord[]
    An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
    namespaceId string
    The ID of the namespace to use for DNS configuration.
    routingPolicy string
    The 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[ServiceDnsConfigDnsRecord]
    An array that contains one DnsRecord object for each resource record set. See dns_records Block for details.
    namespace_id str
    The ID of the namespace to use for DNS configuration.
    routing_policy str
    The 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_records Block for details.
    namespaceId String
    The ID of the namespace to use for DNS configuration.
    routingPolicy String
    The 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

    ServiceDnsConfigDnsRecord, ServiceDnsConfigDnsRecordArgs

    Ttl int
    The amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
    Type string
    The type of the resource, which indicates the value that Amazon Route 53 returns in response to DNS queries. Valid Values: A, AAAA, SRV, CNAME
    Ttl int
    The amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
    Type string
    The type of the resource, which indicates the value that Amazon Route 53 returns in response to DNS queries. Valid Values: A, AAAA, SRV, CNAME
    ttl Integer
    The amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
    type String
    The type of the resource, which indicates the value that Amazon Route 53 returns in response to DNS queries. Valid Values: A, AAAA, SRV, CNAME
    ttl number
    The amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
    type string
    The type of the resource, which indicates the value that Amazon Route 53 returns in response to DNS queries. Valid Values: A, AAAA, SRV, CNAME
    ttl int
    The amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
    type str
    The type of the resource, which indicates the value that Amazon Route 53 returns in response to DNS queries. Valid Values: A, AAAA, SRV, CNAME
    ttl Number
    The amount of time, in seconds, that you want DNS resolvers to cache the settings for this resource record set.
    type String
    The type of the resource, which indicates the value that Amazon Route 53 returns in response to DNS queries. Valid Values: A, AAAA, SRV, CNAME

    ServiceHealthCheckConfig, ServiceHealthCheckConfigArgs

    FailureThreshold int
    The number of consecutive health checks. Maximum value of 10.
    ResourcePath string
    The 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 consecutive health checks. Maximum value of 10.
    ResourcePath string
    The 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 consecutive health checks. Maximum value of 10.
    resourcePath String
    The 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 consecutive health checks. Maximum value of 10.
    resourcePath string
    The 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 consecutive health checks. Maximum value of 10.
    resource_path str
    The 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 consecutive health checks. Maximum value of 10.
    resourcePath String
    The 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

    ServiceHealthCheckCustomConfig, ServiceHealthCheckCustomConfigArgs

    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.

    Import

    Using pulumi import, import Service Discovery Service using the service ID. For example:

    $ pulumi import aws:servicediscovery/service:Service example 0123456789
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi