aws.servicediscovery.Service
Explore with Pulumi AI
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={
"dnsRecords": [{
"ttl": 0,
"type": "string",
}],
"namespaceId": "string",
"routingPolicy": "string",
},
force_destroy=False,
health_check_config={
"failureThreshold": 0,
"resourcePath": "string",
"type": "string",
},
health_check_custom_config={
"failureThreshold": 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
The Service resource accepts the following input properties:
- Description string
- The description of the service.
- Dns
Config ServiceDns Config - 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 ServiceConfig Health Check Config - 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 ServiceCustom Config Health Check Custom Config - 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.
- Namespace
Id string - The ID of the namespace that you want to use to create the service.
- 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 isHTTP
.
- Description string
- The description of the service.
- Dns
Config ServiceDns Config Args - 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 ServiceConfig Health Check Config Args - 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 ServiceCustom Config Health Check Custom Config Args - 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.
- Namespace
Id string - The ID of the namespace that you want to use to create the service.
- 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 isHTTP
.
- description String
- The description of the service.
- dns
Config ServiceDns Config - 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 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
. - health
Check ServiceConfig Health Check Config - 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 ServiceCustom Config Health Check Custom Config - 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.
- namespace
Id String - The ID of the namespace that you want to use to create the service.
- 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 isHTTP
.
- description string
- The description of the service.
- dns
Config ServiceDns Config - 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 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
. - health
Check ServiceConfig Health Check Config - 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 ServiceCustom Config Health Check Custom Config - 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.
- namespace
Id string - The ID of the namespace that you want to use to create the service.
- {[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 isHTTP
.
- description str
- The description of the service.
- dns_
config ServiceDns Config Args - 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_ Serviceconfig Health Check Config Args - 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_ Servicecustom_ config Health Check Custom Config Args - 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.
- 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 isHTTP
.
- description String
- The description of the service.
- dns
Config 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. - force
Destroy 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
. - health
Check Property MapConfig - 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 Property MapCustom Config - 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.
- namespace
Id String - The ID of the namespace that you want to use to create the service.
- 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 isHTTP
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Service resource produces the following output properties:
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.
- Arn string
- The ARN of the service.
- Description string
- The description of the service.
- Dns
Config ServiceDns Config - 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 ServiceConfig Health Check Config - 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 ServiceCustom Config Health Check Custom Config - 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.
- Namespace
Id string - The ID of the namespace that you want to use to create the service.
- 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. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 isHTTP
.
- Arn string
- The ARN of the service.
- Description string
- The description of the service.
- Dns
Config ServiceDns Config Args - 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 ServiceConfig Health Check Config Args - 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 ServiceCustom Config Health Check Custom Config Args - 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.
- Namespace
Id string - The ID of the namespace that you want to use to create the service.
- 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. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 isHTTP
.
- arn String
- The ARN of the service.
- description String
- The description of the service.
- dns
Config ServiceDns Config - 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 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
. - health
Check ServiceConfig Health Check Config - 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 ServiceCustom Config Health Check Custom Config - 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.
- namespace
Id String - The ID of the namespace that you want to use to create the service.
- 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. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 isHTTP
.
- arn string
- The ARN of the service.
- description string
- The description of the service.
- dns
Config ServiceDns Config - 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 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
. - health
Check ServiceConfig Health Check Config - 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 ServiceCustom Config Health Check Custom Config - 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.
- namespace
Id string - The ID of the namespace that you want to use to create the service.
- {[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. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 isHTTP
.
- arn str
- The ARN of the service.
- description str
- The description of the service.
- dns_
config ServiceDns Config Args - 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_ Serviceconfig Health Check Config Args - 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_ Servicecustom_ config Health Check Custom Config Args - 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.
- 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. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 isHTTP
.
- arn String
- The ARN of the service.
- description String
- The description of the service.
- dns
Config 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. - force
Destroy 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
. - health
Check Property MapConfig - 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 Property MapCustom Config - 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.
- namespace
Id String - The ID of the namespace that you want to use to create the service.
- 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 isHTTP
.
Supporting Types
ServiceDnsConfig, ServiceDnsConfigArgs
- Dns
Records List<ServiceDns Config Dns Record> - An array that contains one DnsRecord object for each resource record set. See
dns_records
Block for details. - Namespace
Id string - The ID of the namespace to use for DNS configuration.
- Routing
Policy 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 []ServiceDns Config Dns Record - An array that contains one DnsRecord object for each resource record set. See
dns_records
Block for details. - Namespace
Id string - The ID of the namespace to use for DNS configuration.
- Routing
Policy 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 List<ServiceDns Config Dns Record> - An array that contains one DnsRecord object for each resource record set. See
dns_records
Block for details. - namespace
Id String - The ID of the namespace to use for DNS configuration.
- routing
Policy 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 ServiceDns Config Dns Record[] - An array that contains one DnsRecord object for each resource record set. See
dns_records
Block for details. - namespace
Id string - The ID of the namespace to use for DNS configuration.
- routing
Policy 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[ServiceDns Config Dns Record] - 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
- dns
Records List<Property Map> - An array that contains one DnsRecord object for each resource record set. See
dns_records
Block for details. - namespace
Id String - The ID of the namespace to use for DNS configuration.
- routing
Policy 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
ServiceHealthCheckConfig, ServiceHealthCheckConfigArgs
- Failure
Threshold int - The number of consecutive health checks. Maximum value of 10.
- Resource
Path 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 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 Integer - The number of consecutive health checks. Maximum value of 10.
- resource
Path 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 number - The number of consecutive health checks. Maximum value of 10.
- resource
Path 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
- failure
Threshold Number - The number of consecutive health checks. Maximum value of 10.
- resource
Path 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
- 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.
- 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.
- failure
Threshold 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.
- failure
Threshold 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.
- failure
Threshold 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.