Creates an MX type DNS record set.
// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { TerraformStack } from "cdktf";
/*
* Provider bindings are generated by running `cdktf get`.
* See https://cdk.tf/provider-generation for more details.
*/
import { ARecordSet } from "./.gen/providers/dns/a-record-set";
import { MxRecordSet } from "./.gen/providers/dns/mx-record-set";
class MyConvertedCode extends TerraformStack {
constructor(scope: Construct, name: string) {
super(scope, name);
new ARecordSet(this, "backup", {
addresses: ["192.0.2.2"],
name: "backup",
ttl: 300,
zone: "example.com.",
});
new ARecordSet(this, "smtp", {
addresses: ["192.0.2.1"],
name: "smtp",
ttl: 300,
zone: "example.com.",
});
new MxRecordSet(this, "mx", {
dependsOn: ["dns_a_record_set.smtp", "dns_a_record_set.backup"],
mx: [
{
exchange: "smtp.example.com.",
preference: 10,
},
{
exchange: "backup.example.com.",
preference: 20,
},
],
ttl: 300,
zone: "example.com.",
});
}
}
zone
(String) DNS zone the record set belongs to. It must be an FQDN, that is, include the trailing dot.mx
(Block Set) Can be specified multiple times for each MX record. (see below for nested schema)name
(String) The name of the record set. The zone
argument will be appended to this value to create the full record path.ttl
(Number) The TTL of the record set. Defaults to 3600
.id
(String) Always set to the fully qualified domain name of the record setmx
Required:
exchange
(String) The FQDN of the mail exchange, include the trailing dot.preference
(Number) The preference for the record.Import is supported using the following syntax:
# Import using the FQDN.
terraform import dns_mx_record_set.mx example.com.