Class RecordTarget

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.route53.RecordTarget
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-09T14:39:18.103Z") @Stability(Stable) public class RecordTarget extends software.amazon.jsii.JsiiObject
Type union for a record that accepts multiple types of target.

Example:

 Instance instance;
 HostedZone myZone;
 CfnEIP elasticIp = CfnEIP.Builder.create(this, "EIP")
         .domain("vpc")
         .instanceId(instance.getInstanceId())
         .build();
 ARecord.Builder.create(this, "ARecord")
         .zone(myZone)
         .target(RecordTarget.fromIpAddresses(elasticIp.getRef()))
         .build();
 
  • Constructor Details

    • RecordTarget

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

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

      @Stability(Stable) protected RecordTarget(@Nullable List<String> values, @Nullable IAliasRecordTarget aliasTarget)
      Parameters:
      values - correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses).
      aliasTarget - alias for targets such as CloudFront distribution to route traffic to.
    • RecordTarget

      @Stability(Stable) protected RecordTarget(@Nullable List<String> values)
      Parameters:
      values - correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses).
    • RecordTarget

      @Stability(Stable) protected RecordTarget()
  • Method Details

    • fromAlias

      @Stability(Stable) @NotNull public static RecordTarget fromAlias(@NotNull IAliasRecordTarget aliasTarget)
      Use an alias as target.

      Parameters:
      aliasTarget - This parameter is required.
    • fromIpAddresses

      @Stability(Stable) @NotNull public static RecordTarget fromIpAddresses(@NotNull String... ipAddresses)
      Use ip addresses as target.

      Parameters:
      ipAddresses - This parameter is required.
    • fromValues

      @Stability(Stable) @NotNull public static RecordTarget fromValues(@NotNull String... values)
      Use string values as target.

      Parameters:
      values - This parameter is required.
    • getAliasTarget

      @Stability(Stable) @Nullable public IAliasRecordTarget getAliasTarget()
      alias for targets such as CloudFront distribution to route traffic to.
    • getValues

      @Stability(Stable) @Nullable public List<String> getValues()
      correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses).