Package com.pulumi.aws.vpclattice
Class TargetGroup
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.vpclattice.TargetGroup
-
public class TargetGroup extends com.pulumi.resources.CustomResourceResource for managing an AWS VPC Lattice Target Group. ## Example Usage ### Basic Usage
### Basic usage with Health checkpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.vpclattice.TargetGroup; import com.pulumi.aws.vpclattice.TargetGroupArgs; import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs; import java.util.ArrayList; import java.util.Arrays; 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 TargetGroup("example", TargetGroupArgs.builder() .config(TargetGroupConfigArgs.builder() .vpcIdentifier(exampleAwsVpc.id()) .port(443) .protocol("HTTPS") .build()) .name("example") .type("INSTANCE") .build()); } }
### ALB If the type is ALB, `healthCheck` block is not supported.package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.vpclattice.TargetGroup; import com.pulumi.aws.vpclattice.TargetGroupArgs; import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs; import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigHealthCheckArgs; import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigHealthCheckMatcherArgs; import java.util.ArrayList; import java.util.Arrays; 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 TargetGroup("example", TargetGroupArgs.builder() .config(TargetGroupConfigArgs.builder() .healthCheck(TargetGroupConfigHealthCheckArgs.builder() .matcher(TargetGroupConfigHealthCheckMatcherArgs.builder() .value("200-299") .build()) .enabled(true) .healthCheckIntervalSeconds(20) .healthCheckTimeoutSeconds(10) .healthyThresholdCount(7) .unhealthyThresholdCount(3) .path("/instance") .port(80) .protocol("HTTP") .protocolVersion("HTTP1") .build()) .vpcIdentifier(exampleAwsVpc.id()) .ipAddressType("IPV4") .port(443) .protocol("HTTPS") .protocolVersion("HTTP1") .build()) .name("example") .type("IP") .build()); } }
### Lambda If the type is Lambda, `config` block is not supported.package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.vpclattice.TargetGroup; import com.pulumi.aws.vpclattice.TargetGroupArgs; import com.pulumi.aws.vpclattice.inputs.TargetGroupConfigArgs; import java.util.ArrayList; import java.util.Arrays; 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 TargetGroup("example", TargetGroupArgs.builder() .config(TargetGroupConfigArgs.builder() .vpcIdentifier(exampleAwsVpc.id()) .port(443) .protocol("HTTPS") .protocolVersion("HTTP1") .build()) .name("example") .type("ALB") .build()); } }
## Import Using `pulumi import`, import VPC Lattice Target Group using the `id`. For example: ```sh $ pulumi import aws:vpclattice/targetGroup:TargetGroup example tg-0c11d4dc16ed96bdb ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.vpclattice.TargetGroup; import com.pulumi.aws.vpclattice.TargetGroupArgs; import java.util.ArrayList; import java.util.Arrays; 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 TargetGroup("example", TargetGroupArgs.builder() .name("example") .type("LAMBDA") .build()); } }
-
-
Constructor Summary
Constructors Constructor Description TargetGroup(java.lang.String name)TargetGroup(java.lang.String name, TargetGroupArgs args)TargetGroup(java.lang.String name, TargetGroupArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<TargetGroupConfig>>config()static TargetGroupget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TargetGroupState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>status()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.lang.String>type()
-
-
-
Constructor Detail
-
TargetGroup
public TargetGroup(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
TargetGroup
public TargetGroup(java.lang.String name, TargetGroupArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
TargetGroup
public TargetGroup(java.lang.String name, TargetGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the target group.
-
config
public com.pulumi.core.Output<java.util.Optional<TargetGroupConfig>> config()
- Returns:
- Target group configuration. See `config` Block below.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
status
public com.pulumi.core.Output<java.lang.String> status()
- Returns:
- Status of the target group.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
type
public com.pulumi.core.Output<java.lang.String> type()
- Returns:
- Type of target group. Valid values are `IP`, `LAMBDA`, `INSTANCE`, or `ALB`. The following arguments are optional:
-
get
public static TargetGroup get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable TargetGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-