Fugue.AWS.Route53.AliasTarget

Module Members

applicationLoadBalancer

(Function)

Create a new AliasTarget for an application load balancer.

Example:

import Fugue.AWS as AWS
import Fugue.AWS.ELBv2 as ELBv2
import Fugue.AWS.Route53 as Route53

zone: Route53.HostedZone.external("12345679ABCDEF")

targetALB: ELBv2.LoadBalancer.external("myApplicationLoadBalancer", AWS.Us-west-2)

aliasALB: Route53.ResourceRecordSet.A.alias {
  name: "alb-alias.example.com",
  hostedZone: zone,
  target: Route53.AliasTarget.applicationLoadBalancer {
    target: targetALB,
    evaluateTargetHealth: False,
  }
}

Type Signature

 fun { target: LoadBalancer,
       evaluateTargetHealth: Bool} -> AliasTarget
Argument: target

The load balancer to target.

Type: LoadBalancer

Argument: evaluateTargetHealth

Evaluate target’s health before responding with the alias value.

Type: Bool

Returns:

A Fugue.Core.AWS.Route53.AliasTarget value targeting the specified application load balancer.

Type: AliasTarget

bucket

(Function)

Create a new AliasTarget for a S3 bucket.

Example:

import Fugue.AWS as AWS
import Fugue.AWS.Route53 as Route53
import Fugue.AWS.S3 as S3

zone: Route53.HostedZone.external("12345679ABCDEF")

targetBucket: S3.Bucket.external("myBucket", AWS.Us-west-2)

aliasBucket: Route53.ResourceRecordSet.A.alias {
  name: "bucket-alias.example.com",
  hostedZone: zone,
  target: Route53.AliasTarget.bucket {
    target: targetBucket,
    evaluateTargetHealth: False,
  }
}

Type Signature

 fun { target: Bucket,
       evaluateTargetHealth: Bool} -> AliasTarget
Argument: target

The S3 bucket to target. The bucket must be configured as a website endpoint.

Type: Bucket

Argument: evaluateTargetHealth

Evaluate target’s health before responding with the alias value.

Type: Bool

Returns:

A Fugue.Core.AWS.Route53.AliasTarget value targeting the specified S3 bucket.

Type: AliasTarget

cloudFront

(Function)

Create a new AliasTarget for a CloudFront web distribution.

Example:

import Fugue.AWS as AWS
import Fugue.AWS.CloudFront as CloudFront
import Fugue.AWS.Route53 as Route53

zone: Route53.HostedZone.external("12345679ABCDEF")

targetDistro: CloudFront.WebDistribution.external("S11A16G5KZMEQD", AWS.Us-east-1)

aliasDistro: Route53.ResourceRecordSet.A.alias {
  name: "distro-alias.example.com",
  hostedZone: zone,
  target: Route53.AliasTarget.cloudFront {
    target: targetDistro,
  }
}

Type Signature

 fun { target: WebDistribution} -> AliasTarget
Argument: target

The CloudFront web distribution to target.

Type: WebDistribution

Returns:

A Fugue.Core.AWS.Route53.AliasTarget value targeting the specified CloudFront web distribution.

Type: AliasTarget

externalRecord

(Function)

Create a new AliasTarget for a resource record set defined in another hosted zone.

Example:

import Fugue.AWS as AWS
import Fugue.AWS.Route53 as Route53

zone: Route53.HostedZone.external("12345679ABCDEF")

aliasExternalRecord: Route53.ResourceRecordSet.A.alias {
  name: "external-alias.example.com",
  hostedZone: zone,
  target: Route53.AliasTarget.externalRecord {
    target: "target.example.net",
    hostedZone: Route53.HostedZone.external("ABCDEF123456789"),
    evaluateTargetHealth: False,
  }
}

Type Signature

 fun { target: String,
       hostedZone: HostedZone,
       evaluateTargetHealth: Bool} -> AliasTarget
Argument: target

The DNS name of the external resource record set to target.

Type: String

Argument: hostedZone

The hosted zone the target resource record set is defined in.

Type: HostedZone

Argument: evaluateTargetHealth

Evaluate target’s health before responding with the alias value.

Type: Bool

Returns:

A Fugue.Core.AWS.Route53.AliasTarget value targeting the specified resource record set.

Type: AliasTarget

loadBalancer

(Function)

Create a new AliasTarget for a classic load balancer.

Example:

import Fugue.AWS as AWS
import Fugue.AWS.ELB as ELB
import Fugue.AWS.Route53 as Route53

zone: Route53.HostedZone.external("12345679ABCDEF")

targetELB: ELB.LoadBalancer.external("myLoadBalancer", AWS.Us-east-2)

aliasELB: Route53.ResourceRecordSet.A.alias {
  name: "elb-alias.example.com",
  hostedZone: zone,
  target: Route53.AliasTarget.loadBalancer {
    target: targetA,
    evaluateTargetHealth: True,
  }
}

Type Signature

 fun { target: LoadBalancer,
       evaluateTargetHealth: Bool} -> AliasTarget
Argument: target

The classic load balancer to target.

Type: LoadBalancer

Argument: evaluateTargetHealth

Evaluate target’s health before responding with the alias value.

Type: Bool

Returns:

A Fugue.Core.AWS.Route53.AliasTarget value targeting the specified classic load balancer.

Type: AliasTarget

resourceRecordSet

(Function)

Create a new AliasTarget for a resource record set.

Example:

import Fugue.AWS.Route53 as Route53

zone: Route53.HostedZone.external("12345679ABCDEF")

targetA: Route53.ResourceRecordSet.A.new {
  name: "target.example.com",
  values: ["10.0.0.1", "10.0.0.2"],
  ttl: 60,
  hostedZone: zone,
}

aliasA: Route53.ResourceRecordSet.A.alias {
  name: "a-alias.example.com",
  hostedZone: zone,
  target: Route53.AliasTarget.resourceRecordSet {
    target: targetA,
    evaluateTargetHealth: False,
  }
}

Type Signature

 fun { target: ResourceRecordSet,
       evaluateTargetHealth: Bool} -> AliasTarget
Argument: target

The resource record set to alias. Must be the same record type as the alias resource record set.

Type: ResourceRecordSet

Argument: evaluateTargetHealth

Evaluate target’s health before responding with the alias value.

Type: Bool

Returns:

A Fugue.Core.AWS.Route53.AliasTarget value targeting the specified resource record set.

Type: AliasTarget