Class CfnTargetGroup

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:36.013Z") @Stability(Stable) public class CfnTargetGroup extends CfnResource implements IInspectable
A CloudFormation AWS::VpcLattice::TargetGroup.

Creates a target group. A target group is a collection of targets, or compute resources, that run your application or service. A target group can only be used by a single service.

For more information, see Target groups in the Amazon VPC Lattice User Guide .

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.vpclattice.*;
 CfnTargetGroup cfnTargetGroup = CfnTargetGroup.Builder.create(this, "MyCfnTargetGroup")
         .type("type")
         // the properties below are optional
         .config(TargetGroupConfigProperty.builder()
                 .port(123)
                 .protocol("protocol")
                 .vpcIdentifier("vpcIdentifier")
                 // the properties below are optional
                 .healthCheck(HealthCheckConfigProperty.builder()
                         .enabled(false)
                         .healthCheckIntervalSeconds(123)
                         .healthCheckTimeoutSeconds(123)
                         .healthyThresholdCount(123)
                         .matcher(MatcherProperty.builder()
                                 .httpCode("httpCode")
                                 .build())
                         .path("path")
                         .port(123)
                         .protocol("protocol")
                         .protocolVersion("protocolVersion")
                         .unhealthyThresholdCount(123)
                         .build())
                 .ipAddressType("ipAddressType")
                 .protocolVersion("protocolVersion")
                 .build())
         .name("name")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .targets(List.of(TargetProperty.builder()
                 .id("id")
                 // the properties below are optional
                 .port(123)
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnTargetGroup

      protected CfnTargetGroup(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnTargetGroup

      protected CfnTargetGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnTargetGroup

      @Stability(Stable) public CfnTargetGroup(@NotNull Construct scope, @NotNull String id, @NotNull CfnTargetGroupProps props)
      Create a new AWS::VpcLattice::TargetGroup.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the target group.
    • getAttrCreatedAt

      @Stability(Stable) @NotNull public String getAttrCreatedAt()
      The date and time that the target group was created, specified in ISO-8601 format.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the target group.
    • getAttrLastUpdatedAt

      @Stability(Stable) @NotNull public String getAttrLastUpdatedAt()
      The date and time that the target group was last updated, specified in ISO-8601 format.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The operation's status.

      You can retry the operation if the status is CREATE_FAILED . However, if you retry it while the status is CREATE_IN_PROGRESS , there is no change in the status.

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags for the target group.
    • getType

      @Stability(Stable) @NotNull public String getType()
      The type of target group.
    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      The type of target group.
    • getConfig

      @Stability(Stable) @Nullable public Object getConfig()
      The target group configuration.

      If type is set to LAMBDA , this parameter doesn't apply.

    • setConfig

      @Stability(Stable) public void setConfig(@Nullable IResolvable value)
      The target group configuration.

      If type is set to LAMBDA , this parameter doesn't apply.

    • setConfig

      @Stability(Stable) public void setConfig(@Nullable CfnTargetGroup.TargetGroupConfigProperty value)
      The target group configuration.

      If type is set to LAMBDA , this parameter doesn't apply.

    • getName

      @Stability(Stable) @Nullable public String getName()
      The 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.

      If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.

    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      The 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.

      If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.

    • getTargets

      @Stability(Stable) @Nullable public Object getTargets()
      Describes a target.
    • setTargets

      @Stability(Stable) public void setTargets(@Nullable IResolvable value)
      Describes a target.
    • setTargets

      @Stability(Stable) public void setTargets(@Nullable List<Object> value)
      Describes a target.