com.pulumi.aws.servicediscovery.Instance Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
The newest version!
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.servicediscovery;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.servicediscovery.InstanceArgs;
import com.pulumi.aws.servicediscovery.inputs.InstanceState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.Map;
import javax.annotation.Nullable;
/**
* Provides a Service Discovery Instance resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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 com.pulumi.aws.servicediscovery.Instance;
* import com.pulumi.aws.servicediscovery.InstanceArgs;
* 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.domain.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());
*
* var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
* .instanceId("example-instance-id")
* .serviceId(exampleService.id())
* .attributes(Map.ofEntries(
* Map.entry("AWS_INSTANCE_IPV4", "172.18.0.1"),
* Map.entry("custom_attribute", "custom")
* ))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.servicediscovery.HttpNamespace;
* import com.pulumi.aws.servicediscovery.HttpNamespaceArgs;
* import com.pulumi.aws.servicediscovery.Service;
* import com.pulumi.aws.servicediscovery.ServiceArgs;
* import com.pulumi.aws.servicediscovery.Instance;
* import com.pulumi.aws.servicediscovery.InstanceArgs;
* 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 HttpNamespace("example", HttpNamespaceArgs.builder()
* .name("example.domain.test")
* .description("example")
* .build());
*
* var exampleService = new Service("exampleService", ServiceArgs.builder()
* .name("example")
* .namespaceId(example.id())
* .build());
*
* var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
* .instanceId("example-instance-id")
* .serviceId(exampleService.id())
* .attributes(Map.of("AWS_EC2_INSTANCE_ID", "i-0abdg374kd892cj6dl"))
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import Service Discovery Instance using the service ID and instance ID. For example:
*
* ```sh
* $ pulumi import aws:servicediscovery/instance:Instance example 0123456789/i-0123
* ```
*
*/
@ResourceType(type="aws:servicediscovery/instance:Instance")
public class Instance extends com.pulumi.resources.CustomResource {
/**
* A map contains the attributes of the instance. Check the [doc](https://docs.aws.amazon.com/cloud-map/latest/api/API_RegisterInstance.html#API_RegisterInstance_RequestSyntax) for the supported attributes and syntax.
*
*/
@Export(name="attributes", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy