UNPKG

@aws-cdk/aws-route53

Version:

The CDK Construct Library for AWS::Route53

980 lines 585 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g; Object.defineProperty(exports, "__esModule", { value: true }); exports.CfnRecordSetGroup = exports.CfnRecordSet = exports.CfnKeySigningKey = exports.CfnHostedZone = exports.CfnHealthCheck = exports.CfnDNSSEC = exports.CfnCidrCollection = void 0; const jsiiDeprecationWarnings = require("../.warnings.jsii.js"); const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); // Copyright 2012-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. // Generated from the AWS CloudFormation Resource Specification // See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html // @cfn2ts:meta@ {"generated":"2023-06-19T15:18:57.225Z","fingerprint":"x98R1RtiROkQoFQjK4PPRmmdTN3P6bDRRv9wpM95yXg="} /* eslint-disable max-len */ // This is generated code - line lengths are difficult to control const cdk = require("@aws-cdk/core"); const cfn_parse = require("@aws-cdk/core/lib/helpers-internal"); /** * Determine whether the given properties match those of a `CfnCidrCollectionProps` * * @param properties - the TypeScript properties of a `CfnCidrCollectionProps` * * @returns the result of the validation. */ function CfnCidrCollectionPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('locations', cdk.listValidator(CfnCidrCollection_LocationPropertyValidator))(properties.locations)); errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); return errors.wrap('supplied properties not correct for "CfnCidrCollectionProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::CidrCollection` resource * * @param properties - the TypeScript properties of a `CfnCidrCollectionProps` * * @returns the AWS CloudFormation properties of an `AWS::Route53::CidrCollection` resource. */ // @ts-ignore TS6133 function cfnCidrCollectionPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnCidrCollectionPropsValidator(properties).assertSuccess(); return { Name: cdk.stringToCloudFormation(properties.name), Locations: cdk.listMapper(cfnCidrCollectionLocationPropertyToCloudFormation)(properties.locations), }; } // @ts-ignore TS6133 function CfnCidrCollectionPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('name', 'Name', cfn_parse.FromCloudFormation.getString(properties.Name)); ret.addPropertyResult('locations', 'Locations', properties.Locations != null ? cfn_parse.FromCloudFormation.getArray(CfnCidrCollectionLocationPropertyFromCloudFormation)(properties.Locations) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Route53::CidrCollection` * * Creates a CIDR collection in the current AWS account. * * @cloudformationResource AWS::Route53::CidrCollection * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-cidrcollection.html */ class CfnCidrCollection extends cdk.CfnResource { /** * Create a new `AWS::Route53::CidrCollection`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnCidrCollection.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_route53_CfnCidrCollectionProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnCidrCollection); } throw error; } cdk.requireProperty(props, 'name', this); this.attrArn = cdk.Token.asString(this.getAtt('Arn')); this.attrId = cdk.Token.asString(this.getAtt('Id')); this.name = props.name; this.locations = props.locations; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnCidrCollectionPropsFromCloudFormation(resourceProperties); const ret = new CfnCidrCollection(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnCidrCollection.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { name: this.name, locations: this.locations, }; } renderProperties(props) { return cfnCidrCollectionPropsToCloudFormation(props); } } exports.CfnCidrCollection = CfnCidrCollection; _a = JSII_RTTI_SYMBOL_1; CfnCidrCollection[_a] = { fqn: "@aws-cdk/aws-route53.CfnCidrCollection", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnCidrCollection.CFN_RESOURCE_TYPE_NAME = "AWS::Route53::CidrCollection"; /** * Determine whether the given properties match those of a `LocationProperty` * * @param properties - the TypeScript properties of a `LocationProperty` * * @returns the result of the validation. */ function CfnCidrCollection_LocationPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('cidrList', cdk.requiredValidator)(properties.cidrList)); errors.collect(cdk.propertyValidator('cidrList', cdk.listValidator(cdk.validateString))(properties.cidrList)); errors.collect(cdk.propertyValidator('locationName', cdk.requiredValidator)(properties.locationName)); errors.collect(cdk.propertyValidator('locationName', cdk.validateString)(properties.locationName)); return errors.wrap('supplied properties not correct for "LocationProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::CidrCollection.Location` resource * * @param properties - the TypeScript properties of a `LocationProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::CidrCollection.Location` resource. */ // @ts-ignore TS6133 function cfnCidrCollectionLocationPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnCidrCollection_LocationPropertyValidator(properties).assertSuccess(); return { CidrList: cdk.listMapper(cdk.stringToCloudFormation)(properties.cidrList), LocationName: cdk.stringToCloudFormation(properties.locationName), }; } // @ts-ignore TS6133 function CfnCidrCollectionLocationPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('cidrList', 'CidrList', cfn_parse.FromCloudFormation.getStringArray(properties.CidrList)); ret.addPropertyResult('locationName', 'LocationName', cfn_parse.FromCloudFormation.getString(properties.LocationName)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `CfnDNSSECProps` * * @param properties - the TypeScript properties of a `CfnDNSSECProps` * * @returns the result of the validation. */ function CfnDNSSECPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('hostedZoneId', cdk.requiredValidator)(properties.hostedZoneId)); errors.collect(cdk.propertyValidator('hostedZoneId', cdk.validateString)(properties.hostedZoneId)); return errors.wrap('supplied properties not correct for "CfnDNSSECProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::DNSSEC` resource * * @param properties - the TypeScript properties of a `CfnDNSSECProps` * * @returns the AWS CloudFormation properties of an `AWS::Route53::DNSSEC` resource. */ // @ts-ignore TS6133 function cfnDNSSECPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnDNSSECPropsValidator(properties).assertSuccess(); return { HostedZoneId: cdk.stringToCloudFormation(properties.hostedZoneId), }; } // @ts-ignore TS6133 function CfnDNSSECPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('hostedZoneId', 'HostedZoneId', cfn_parse.FromCloudFormation.getString(properties.HostedZoneId)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Route53::DNSSEC` * * The `AWS::Route53::DNSSEC` resource is used to enable DNSSEC signing in a hosted zone. * * @cloudformationResource AWS::Route53::DNSSEC * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-dnssec.html */ class CfnDNSSEC extends cdk.CfnResource { /** * Create a new `AWS::Route53::DNSSEC`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnDNSSEC.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_route53_CfnDNSSECProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnDNSSEC); } throw error; } cdk.requireProperty(props, 'hostedZoneId', this); this.hostedZoneId = props.hostedZoneId; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnDNSSECPropsFromCloudFormation(resourceProperties); const ret = new CfnDNSSEC(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnDNSSEC.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { hostedZoneId: this.hostedZoneId, }; } renderProperties(props) { return cfnDNSSECPropsToCloudFormation(props); } } exports.CfnDNSSEC = CfnDNSSEC; _b = JSII_RTTI_SYMBOL_1; CfnDNSSEC[_b] = { fqn: "@aws-cdk/aws-route53.CfnDNSSEC", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnDNSSEC.CFN_RESOURCE_TYPE_NAME = "AWS::Route53::DNSSEC"; /** * Determine whether the given properties match those of a `CfnHealthCheckProps` * * @param properties - the TypeScript properties of a `CfnHealthCheckProps` * * @returns the result of the validation. */ function CfnHealthCheckPropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('healthCheckConfig', cdk.requiredValidator)(properties.healthCheckConfig)); errors.collect(cdk.propertyValidator('healthCheckConfig', CfnHealthCheck_HealthCheckConfigPropertyValidator)(properties.healthCheckConfig)); errors.collect(cdk.propertyValidator('healthCheckTags', cdk.listValidator(CfnHealthCheck_HealthCheckTagPropertyValidator))(properties.healthCheckTags)); return errors.wrap('supplied properties not correct for "CfnHealthCheckProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HealthCheck` resource * * @param properties - the TypeScript properties of a `CfnHealthCheckProps` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HealthCheck` resource. */ // @ts-ignore TS6133 function cfnHealthCheckPropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHealthCheckPropsValidator(properties).assertSuccess(); return { HealthCheckConfig: cfnHealthCheckHealthCheckConfigPropertyToCloudFormation(properties.healthCheckConfig), HealthCheckTags: cdk.listMapper(cfnHealthCheckHealthCheckTagPropertyToCloudFormation)(properties.healthCheckTags), }; } // @ts-ignore TS6133 function CfnHealthCheckPropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('healthCheckConfig', 'HealthCheckConfig', CfnHealthCheckHealthCheckConfigPropertyFromCloudFormation(properties.HealthCheckConfig)); ret.addPropertyResult('healthCheckTags', 'HealthCheckTags', properties.HealthCheckTags != null ? cfn_parse.FromCloudFormation.getArray(CfnHealthCheckHealthCheckTagPropertyFromCloudFormation)(properties.HealthCheckTags) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Route53::HealthCheck` * * The `AWS::Route53::HealthCheck` resource is a Route 53 resource type that contains settings for a Route 53 health check. * * For information about associating health checks with records, see [HealthCheckId](https://docs.aws.amazon.com/Route53/latest/APIReference/API_ResourceRecordSet.html#Route53-Type-ResourceRecordSet-HealthCheckId) in [ChangeResourceRecordSets](https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html) . * * > You can't create a health check with simple routing. * * *ELB Load Balancers* * * If you're registering EC2 instances with an Elastic Load Balancing (ELB) load balancer, do not create Amazon Route 53 health checks for the EC2 instances. When you register an EC2 instance with a load balancer, you configure settings for an ELB health check, which performs a similar function to a Route 53 health check. * * *Private Hosted Zones* * * You can associate health checks with failover records in a private hosted zone. Note the following: * * - Route 53 health checkers are outside the VPC. To check the health of an endpoint within a VPC by IP address, you must assign a public IP address to the instance in the VPC. * - You can configure a health checker to check the health of an external resource that the instance relies on, such as a database server. * - You can create a CloudWatch metric, associate an alarm with the metric, and then create a health check that is based on the state of the alarm. For example, you might create a CloudWatch metric that checks the status of the Amazon EC2 `StatusCheckFailed` metric, add an alarm to the metric, and then create a health check that is based on the state of the alarm. For information about creating CloudWatch metrics and alarms by using the CloudWatch console, see the [Amazon CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatch.html) . * * @cloudformationResource AWS::Route53::HealthCheck * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-healthcheck.html */ class CfnHealthCheck extends cdk.CfnResource { /** * Create a new `AWS::Route53::HealthCheck`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props) { super(scope, id, { type: CfnHealthCheck.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_route53_CfnHealthCheckProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnHealthCheck); } throw error; } cdk.requireProperty(props, 'healthCheckConfig', this); this.attrHealthCheckId = cdk.Token.asString(this.getAtt('HealthCheckId')); this.healthCheckConfig = props.healthCheckConfig; this.healthCheckTags = props.healthCheckTags; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnHealthCheckPropsFromCloudFormation(resourceProperties); const ret = new CfnHealthCheck(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnHealthCheck.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { healthCheckConfig: this.healthCheckConfig, healthCheckTags: this.healthCheckTags, }; } renderProperties(props) { return cfnHealthCheckPropsToCloudFormation(props); } } exports.CfnHealthCheck = CfnHealthCheck; _c = JSII_RTTI_SYMBOL_1; CfnHealthCheck[_c] = { fqn: "@aws-cdk/aws-route53.CfnHealthCheck", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnHealthCheck.CFN_RESOURCE_TYPE_NAME = "AWS::Route53::HealthCheck"; /** * Determine whether the given properties match those of a `AlarmIdentifierProperty` * * @param properties - the TypeScript properties of a `AlarmIdentifierProperty` * * @returns the result of the validation. */ function CfnHealthCheck_AlarmIdentifierPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('region', cdk.requiredValidator)(properties.region)); errors.collect(cdk.propertyValidator('region', cdk.validateString)(properties.region)); return errors.wrap('supplied properties not correct for "AlarmIdentifierProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HealthCheck.AlarmIdentifier` resource * * @param properties - the TypeScript properties of a `AlarmIdentifierProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HealthCheck.AlarmIdentifier` resource. */ // @ts-ignore TS6133 function cfnHealthCheckAlarmIdentifierPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHealthCheck_AlarmIdentifierPropertyValidator(properties).assertSuccess(); return { Name: cdk.stringToCloudFormation(properties.name), Region: cdk.stringToCloudFormation(properties.region), }; } // @ts-ignore TS6133 function CfnHealthCheckAlarmIdentifierPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('name', 'Name', cfn_parse.FromCloudFormation.getString(properties.Name)); ret.addPropertyResult('region', 'Region', cfn_parse.FromCloudFormation.getString(properties.Region)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `HealthCheckConfigProperty` * * @param properties - the TypeScript properties of a `HealthCheckConfigProperty` * * @returns the result of the validation. */ function CfnHealthCheck_HealthCheckConfigPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('alarmIdentifier', CfnHealthCheck_AlarmIdentifierPropertyValidator)(properties.alarmIdentifier)); errors.collect(cdk.propertyValidator('childHealthChecks', cdk.listValidator(cdk.validateString))(properties.childHealthChecks)); errors.collect(cdk.propertyValidator('enableSni', cdk.validateBoolean)(properties.enableSni)); errors.collect(cdk.propertyValidator('failureThreshold', cdk.validateNumber)(properties.failureThreshold)); errors.collect(cdk.propertyValidator('fullyQualifiedDomainName', cdk.validateString)(properties.fullyQualifiedDomainName)); errors.collect(cdk.propertyValidator('healthThreshold', cdk.validateNumber)(properties.healthThreshold)); errors.collect(cdk.propertyValidator('ipAddress', cdk.validateString)(properties.ipAddress)); errors.collect(cdk.propertyValidator('insufficientDataHealthStatus', cdk.validateString)(properties.insufficientDataHealthStatus)); errors.collect(cdk.propertyValidator('inverted', cdk.validateBoolean)(properties.inverted)); errors.collect(cdk.propertyValidator('measureLatency', cdk.validateBoolean)(properties.measureLatency)); errors.collect(cdk.propertyValidator('port', cdk.validateNumber)(properties.port)); errors.collect(cdk.propertyValidator('regions', cdk.listValidator(cdk.validateString))(properties.regions)); errors.collect(cdk.propertyValidator('requestInterval', cdk.validateNumber)(properties.requestInterval)); errors.collect(cdk.propertyValidator('resourcePath', cdk.validateString)(properties.resourcePath)); errors.collect(cdk.propertyValidator('routingControlArn', cdk.validateString)(properties.routingControlArn)); errors.collect(cdk.propertyValidator('searchString', cdk.validateString)(properties.searchString)); errors.collect(cdk.propertyValidator('type', cdk.requiredValidator)(properties.type)); errors.collect(cdk.propertyValidator('type', cdk.validateString)(properties.type)); return errors.wrap('supplied properties not correct for "HealthCheckConfigProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HealthCheck.HealthCheckConfig` resource * * @param properties - the TypeScript properties of a `HealthCheckConfigProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HealthCheck.HealthCheckConfig` resource. */ // @ts-ignore TS6133 function cfnHealthCheckHealthCheckConfigPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHealthCheck_HealthCheckConfigPropertyValidator(properties).assertSuccess(); return { AlarmIdentifier: cfnHealthCheckAlarmIdentifierPropertyToCloudFormation(properties.alarmIdentifier), ChildHealthChecks: cdk.listMapper(cdk.stringToCloudFormation)(properties.childHealthChecks), EnableSNI: cdk.booleanToCloudFormation(properties.enableSni), FailureThreshold: cdk.numberToCloudFormation(properties.failureThreshold), FullyQualifiedDomainName: cdk.stringToCloudFormation(properties.fullyQualifiedDomainName), HealthThreshold: cdk.numberToCloudFormation(properties.healthThreshold), IPAddress: cdk.stringToCloudFormation(properties.ipAddress), InsufficientDataHealthStatus: cdk.stringToCloudFormation(properties.insufficientDataHealthStatus), Inverted: cdk.booleanToCloudFormation(properties.inverted), MeasureLatency: cdk.booleanToCloudFormation(properties.measureLatency), Port: cdk.numberToCloudFormation(properties.port), Regions: cdk.listMapper(cdk.stringToCloudFormation)(properties.regions), RequestInterval: cdk.numberToCloudFormation(properties.requestInterval), ResourcePath: cdk.stringToCloudFormation(properties.resourcePath), RoutingControlArn: cdk.stringToCloudFormation(properties.routingControlArn), SearchString: cdk.stringToCloudFormation(properties.searchString), Type: cdk.stringToCloudFormation(properties.type), }; } // @ts-ignore TS6133 function CfnHealthCheckHealthCheckConfigPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('alarmIdentifier', 'AlarmIdentifier', properties.AlarmIdentifier != null ? CfnHealthCheckAlarmIdentifierPropertyFromCloudFormation(properties.AlarmIdentifier) : undefined); ret.addPropertyResult('childHealthChecks', 'ChildHealthChecks', properties.ChildHealthChecks != null ? cfn_parse.FromCloudFormation.getStringArray(properties.ChildHealthChecks) : undefined); ret.addPropertyResult('enableSni', 'EnableSNI', properties.EnableSNI != null ? cfn_parse.FromCloudFormation.getBoolean(properties.EnableSNI) : undefined); ret.addPropertyResult('failureThreshold', 'FailureThreshold', properties.FailureThreshold != null ? cfn_parse.FromCloudFormation.getNumber(properties.FailureThreshold) : undefined); ret.addPropertyResult('fullyQualifiedDomainName', 'FullyQualifiedDomainName', properties.FullyQualifiedDomainName != null ? cfn_parse.FromCloudFormation.getString(properties.FullyQualifiedDomainName) : undefined); ret.addPropertyResult('healthThreshold', 'HealthThreshold', properties.HealthThreshold != null ? cfn_parse.FromCloudFormation.getNumber(properties.HealthThreshold) : undefined); ret.addPropertyResult('ipAddress', 'IPAddress', properties.IPAddress != null ? cfn_parse.FromCloudFormation.getString(properties.IPAddress) : undefined); ret.addPropertyResult('insufficientDataHealthStatus', 'InsufficientDataHealthStatus', properties.InsufficientDataHealthStatus != null ? cfn_parse.FromCloudFormation.getString(properties.InsufficientDataHealthStatus) : undefined); ret.addPropertyResult('inverted', 'Inverted', properties.Inverted != null ? cfn_parse.FromCloudFormation.getBoolean(properties.Inverted) : undefined); ret.addPropertyResult('measureLatency', 'MeasureLatency', properties.MeasureLatency != null ? cfn_parse.FromCloudFormation.getBoolean(properties.MeasureLatency) : undefined); ret.addPropertyResult('port', 'Port', properties.Port != null ? cfn_parse.FromCloudFormation.getNumber(properties.Port) : undefined); ret.addPropertyResult('regions', 'Regions', properties.Regions != null ? cfn_parse.FromCloudFormation.getStringArray(properties.Regions) : undefined); ret.addPropertyResult('requestInterval', 'RequestInterval', properties.RequestInterval != null ? cfn_parse.FromCloudFormation.getNumber(properties.RequestInterval) : undefined); ret.addPropertyResult('resourcePath', 'ResourcePath', properties.ResourcePath != null ? cfn_parse.FromCloudFormation.getString(properties.ResourcePath) : undefined); ret.addPropertyResult('routingControlArn', 'RoutingControlArn', properties.RoutingControlArn != null ? cfn_parse.FromCloudFormation.getString(properties.RoutingControlArn) : undefined); ret.addPropertyResult('searchString', 'SearchString', properties.SearchString != null ? cfn_parse.FromCloudFormation.getString(properties.SearchString) : undefined); ret.addPropertyResult('type', 'Type', cfn_parse.FromCloudFormation.getString(properties.Type)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `HealthCheckTagProperty` * * @param properties - the TypeScript properties of a `HealthCheckTagProperty` * * @returns the result of the validation. */ function CfnHealthCheck_HealthCheckTagPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key)); errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key)); errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value)); errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value)); return errors.wrap('supplied properties not correct for "HealthCheckTagProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HealthCheck.HealthCheckTag` resource * * @param properties - the TypeScript properties of a `HealthCheckTagProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HealthCheck.HealthCheckTag` resource. */ // @ts-ignore TS6133 function cfnHealthCheckHealthCheckTagPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHealthCheck_HealthCheckTagPropertyValidator(properties).assertSuccess(); return { Key: cdk.stringToCloudFormation(properties.key), Value: cdk.stringToCloudFormation(properties.value), }; } // @ts-ignore TS6133 function CfnHealthCheckHealthCheckTagPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('key', 'Key', cfn_parse.FromCloudFormation.getString(properties.Key)); ret.addPropertyResult('value', 'Value', cfn_parse.FromCloudFormation.getString(properties.Value)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `CfnHostedZoneProps` * * @param properties - the TypeScript properties of a `CfnHostedZoneProps` * * @returns the result of the validation. */ function CfnHostedZonePropsValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('hostedZoneConfig', CfnHostedZone_HostedZoneConfigPropertyValidator)(properties.hostedZoneConfig)); errors.collect(cdk.propertyValidator('hostedZoneTags', cdk.listValidator(CfnHostedZone_HostedZoneTagPropertyValidator))(properties.hostedZoneTags)); errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name)); errors.collect(cdk.propertyValidator('queryLoggingConfig', CfnHostedZone_QueryLoggingConfigPropertyValidator)(properties.queryLoggingConfig)); errors.collect(cdk.propertyValidator('vpcs', cdk.listValidator(CfnHostedZone_VPCPropertyValidator))(properties.vpcs)); return errors.wrap('supplied properties not correct for "CfnHostedZoneProps"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HostedZone` resource * * @param properties - the TypeScript properties of a `CfnHostedZoneProps` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HostedZone` resource. */ // @ts-ignore TS6133 function cfnHostedZonePropsToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHostedZonePropsValidator(properties).assertSuccess(); return { HostedZoneConfig: cfnHostedZoneHostedZoneConfigPropertyToCloudFormation(properties.hostedZoneConfig), HostedZoneTags: cdk.listMapper(cfnHostedZoneHostedZoneTagPropertyToCloudFormation)(properties.hostedZoneTags), Name: cdk.stringToCloudFormation(properties.name), QueryLoggingConfig: cfnHostedZoneQueryLoggingConfigPropertyToCloudFormation(properties.queryLoggingConfig), VPCs: cdk.listMapper(cfnHostedZoneVPCPropertyToCloudFormation)(properties.vpcs), }; } // @ts-ignore TS6133 function CfnHostedZonePropsFromCloudFormation(properties) { properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('hostedZoneConfig', 'HostedZoneConfig', properties.HostedZoneConfig != null ? CfnHostedZoneHostedZoneConfigPropertyFromCloudFormation(properties.HostedZoneConfig) : undefined); ret.addPropertyResult('hostedZoneTags', 'HostedZoneTags', properties.HostedZoneTags != null ? cfn_parse.FromCloudFormation.getArray(CfnHostedZoneHostedZoneTagPropertyFromCloudFormation)(properties.HostedZoneTags) : undefined); ret.addPropertyResult('name', 'Name', properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined); ret.addPropertyResult('queryLoggingConfig', 'QueryLoggingConfig', properties.QueryLoggingConfig != null ? CfnHostedZoneQueryLoggingConfigPropertyFromCloudFormation(properties.QueryLoggingConfig) : undefined); ret.addPropertyResult('vpcs', 'VPCs', properties.VPCs != null ? cfn_parse.FromCloudFormation.getArray(CfnHostedZoneVPCPropertyFromCloudFormation)(properties.VPCs) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * A CloudFormation `AWS::Route53::HostedZone` * * Creates a new public or private hosted zone. You create records in a public hosted zone to define how you want to route traffic on the internet for a domain, such as example.com, and its subdomains (apex.example.com, acme.example.com). You create records in a private hosted zone to define how you want to route traffic for a domain and its subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs). * * > You can't convert a public hosted zone to a private hosted zone or vice versa. Instead, you must create a new hosted zone with the same name and create new resource record sets. * * For more information about charges for hosted zones, see [Amazon Route 53 Pricing](https://docs.aws.amazon.com/route53/pricing/) . * * Note the following: * * - You can't create a hosted zone for a top-level domain (TLD) such as .com. * - If your domain is registered with a registrar other than Route 53, you must update the name servers with your registrar to make Route 53 the DNS service for the domain. For more information, see [Migrating DNS Service for an Existing Domain to Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html) in the *Amazon Route 53 Developer Guide* . * * When you submit a `CreateHostedZone` request, the initial status of the hosted zone is `PENDING` . For public hosted zones, this means that the NS and SOA records are not yet available on all Route 53 DNS servers. When the NS and SOA records are available, the status of the zone changes to `INSYNC` . * * The `CreateHostedZone` request requires the caller to have an `ec2:DescribeVpcs` permission. * * > When creating private hosted zones, the Amazon VPC must belong to the same partition where the hosted zone is created. A partition is a group of AWS Regions . Each AWS account is scoped to one partition. * > * > The following are the supported partitions: * > * > - `aws` - AWS Regions * > - `aws-cn` - China Regions * > - `aws-us-gov` - AWS GovCloud (US) Region * > * > For more information, see [Access Management](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the *AWS General Reference* . * * @cloudformationResource AWS::Route53::HostedZone * @stability external * * @link http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-hostedzone.html */ class CfnHostedZone extends cdk.CfnResource { /** * Create a new `AWS::Route53::HostedZone`. * * @param scope - scope in which this resource is defined * @param id - scoped id of the resource * @param props - resource properties */ constructor(scope, id, props = {}) { super(scope, id, { type: CfnHostedZone.CFN_RESOURCE_TYPE_NAME, properties: props }); try { jsiiDeprecationWarnings._aws_cdk_aws_route53_CfnHostedZoneProps(props); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, CfnHostedZone); } throw error; } this.attrId = cdk.Token.asString(this.getAtt('Id')); this.attrNameServers = cdk.Token.asList(this.getAtt('NameServers')); this.hostedZoneConfig = props.hostedZoneConfig; this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::Route53::HostedZone", props.hostedZoneTags, { tagPropertyName: 'hostedZoneTags' }); this.name = props.name; this.queryLoggingConfig = props.queryLoggingConfig; this.vpcs = props.vpcs; } /** * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope, id, resourceAttributes, options) { resourceAttributes = resourceAttributes || {}; const resourceProperties = options.parser.parseValue(resourceAttributes.Properties); const propsResult = CfnHostedZonePropsFromCloudFormation(resourceProperties); const ret = new CfnHostedZone(scope, id, propsResult.value); for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) { ret.addPropertyOverride(propKey, propVal); } options.parser.handleAttributes(ret, resourceAttributes, id); return ret; } /** * Examines the CloudFormation resource and discloses attributes. * * @param inspector - tree inspector to collect and process attributes * */ inspect(inspector) { inspector.addAttribute("aws:cdk:cloudformation:type", CfnHostedZone.CFN_RESOURCE_TYPE_NAME); inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties); } get cfnProperties() { return { hostedZoneConfig: this.hostedZoneConfig, hostedZoneTags: this.tags.renderTags(), name: this.name, queryLoggingConfig: this.queryLoggingConfig, vpcs: this.vpcs, }; } renderProperties(props) { return cfnHostedZonePropsToCloudFormation(props); } } exports.CfnHostedZone = CfnHostedZone; _d = JSII_RTTI_SYMBOL_1; CfnHostedZone[_d] = { fqn: "@aws-cdk/aws-route53.CfnHostedZone", version: "1.204.0" }; /** * The CloudFormation resource type name for this resource class. */ CfnHostedZone.CFN_RESOURCE_TYPE_NAME = "AWS::Route53::HostedZone"; /** * Determine whether the given properties match those of a `HostedZoneConfigProperty` * * @param properties - the TypeScript properties of a `HostedZoneConfigProperty` * * @returns the result of the validation. */ function CfnHostedZone_HostedZoneConfigPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('comment', cdk.validateString)(properties.comment)); return errors.wrap('supplied properties not correct for "HostedZoneConfigProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HostedZone.HostedZoneConfig` resource * * @param properties - the TypeScript properties of a `HostedZoneConfigProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HostedZone.HostedZoneConfig` resource. */ // @ts-ignore TS6133 function cfnHostedZoneHostedZoneConfigPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHostedZone_HostedZoneConfigPropertyValidator(properties).assertSuccess(); return { Comment: cdk.stringToCloudFormation(properties.comment), }; } // @ts-ignore TS6133 function CfnHostedZoneHostedZoneConfigPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('comment', 'Comment', properties.Comment != null ? cfn_parse.FromCloudFormation.getString(properties.Comment) : undefined); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `HostedZoneTagProperty` * * @param properties - the TypeScript properties of a `HostedZoneTagProperty` * * @returns the result of the validation. */ function CfnHostedZone_HostedZoneTagPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key)); errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key)); errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value)); errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value)); return errors.wrap('supplied properties not correct for "HostedZoneTagProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HostedZone.HostedZoneTag` resource * * @param properties - the TypeScript properties of a `HostedZoneTagProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HostedZone.HostedZoneTag` resource. */ // @ts-ignore TS6133 function cfnHostedZoneHostedZoneTagPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHostedZone_HostedZoneTagPropertyValidator(properties).assertSuccess(); return { Key: cdk.stringToCloudFormation(properties.key), Value: cdk.stringToCloudFormation(properties.value), }; } // @ts-ignore TS6133 function CfnHostedZoneHostedZoneTagPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new cfn_parse.FromCloudFormationResult(properties); } properties = properties == null ? {} : properties; if (typeof properties !== 'object') { return new cfn_parse.FromCloudFormationResult(properties); } const ret = new cfn_parse.FromCloudFormationPropertyObject(); ret.addPropertyResult('key', 'Key', cfn_parse.FromCloudFormation.getString(properties.Key)); ret.addPropertyResult('value', 'Value', cfn_parse.FromCloudFormation.getString(properties.Value)); ret.addUnrecognizedPropertiesAsExtra(properties); return ret; } /** * Determine whether the given properties match those of a `QueryLoggingConfigProperty` * * @param properties - the TypeScript properties of a `QueryLoggingConfigProperty` * * @returns the result of the validation. */ function CfnHostedZone_QueryLoggingConfigPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties))); } errors.collect(cdk.propertyValidator('cloudWatchLogsLogGroupArn', cdk.requiredValidator)(properties.cloudWatchLogsLogGroupArn)); errors.collect(cdk.propertyValidator('cloudWatchLogsLogGroupArn', cdk.validateString)(properties.cloudWatchLogsLogGroupArn)); return errors.wrap('supplied properties not correct for "QueryLoggingConfigProperty"'); } /** * Renders the AWS CloudFormation properties of an `AWS::Route53::HostedZone.QueryLoggingConfig` resource * * @param properties - the TypeScript properties of a `QueryLoggingConfigProperty` * * @returns the AWS CloudFormation properties of an `AWS::Route53::HostedZone.QueryLoggingConfig` resource. */ // @ts-ignore TS6133 function cfnHostedZoneQueryLoggingConfigPropertyToCloudFormation(properties) { if (!cdk.canInspect(properties)) { return properties; } CfnHostedZone_QueryLoggingConfigPropertyValidator(properties).assertSuccess(); return { CloudWatchLogsLogGroupArn: cdk.stringToCloudFormation(properties.cloudWatchLogsLogGroupArn), }; } // @ts-ignore TS6133 function CfnHostedZoneQueryLoggingConfigPropertyFromCloudFormation(properties) { if (cdk.isResolvableObject(properties)) { return new