UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

219 lines • 9.52 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.HealthCheck = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Route53 health check. * * ## Example Usage * * ### Connectivity and HTTP Status Code Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.route53.HealthCheck("example", { * fqdn: "example.com", * port: 80, * type: "HTTP", * resourcePath: "/", * failureThreshold: 5, * requestInterval: 30, * tags: { * Name: "tf-test-health-check", * }, * }); * ``` * * ### Connectivity and String Matching Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.route53.HealthCheck("example", { * failureThreshold: 5, * fqdn: "example.com", * port: 443, * requestInterval: 30, * resourcePath: "/", * searchString: "example", * type: "HTTPS_STR_MATCH", * }); * ``` * * ### Aggregate Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const parent = new aws.route53.HealthCheck("parent", { * type: "CALCULATED", * childHealthThreshold: 1, * childHealthchecks: [child.id], * tags: { * Name: "tf-test-calculated-health-check", * }, * }); * ``` * * ### CloudWatch Alarm Check * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const foobar = new aws.cloudwatch.MetricAlarm("foobar", { * name: "test-foobar5", * comparisonOperator: "GreaterThanOrEqualToThreshold", * evaluationPeriods: 2, * metricName: "CPUUtilization", * namespace: "AWS/EC2", * period: 120, * statistic: "Average", * threshold: 80, * alarmDescription: "This metric monitors ec2 cpu utilization", * }); * const foo = new aws.route53.HealthCheck("foo", { * type: "CLOUDWATCH_METRIC", * cloudwatchAlarmName: foobar.name, * cloudwatchAlarmRegion: "us-west-2", * insufficientDataHealthStatus: "Healthy", * }); * ``` * * ### CloudWatch Alarm Check With Triggers * * The `triggers` argument allows the Route53 health check to be synchronized when a change to the upstream CloudWatch alarm is made. * In the configuration below, the health check will be synchronized any time the `threshold` of the alarm is changed. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudwatch.MetricAlarm("example", { * name: "example", * comparisonOperator: "GreaterThanOrEqualToThreshold", * evaluationPeriods: 2, * metricName: "CPUUtilization", * namespace: "AWS/EC2", * period: 120, * statistic: "Average", * threshold: 80, * alarmDescription: "This metric monitors ec2 cpu utilization", * }); * const exampleHealthCheck = new aws.route53.HealthCheck("example", { * type: "CLOUDWATCH_METRIC", * cloudwatchAlarmName: example.name, * cloudwatchAlarmRegion: "us-west-2", * insufficientDataHealthStatus: "Healthy", * triggers: { * threshold: example.threshold, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Route53 Health Checks using the health check `id`. For example: * * ```sh * $ pulumi import aws:route53/healthCheck:HealthCheck http_check abcdef11-2222-3333-4444-555555fedcba * ``` */ class HealthCheck extends pulumi.CustomResource { /** * Get an existing HealthCheck resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new HealthCheck(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of HealthCheck. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === HealthCheck.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["childHealthThreshold"] = state ? state.childHealthThreshold : undefined; resourceInputs["childHealthchecks"] = state ? state.childHealthchecks : undefined; resourceInputs["cloudwatchAlarmName"] = state ? state.cloudwatchAlarmName : undefined; resourceInputs["cloudwatchAlarmRegion"] = state ? state.cloudwatchAlarmRegion : undefined; resourceInputs["disabled"] = state ? state.disabled : undefined; resourceInputs["enableSni"] = state ? state.enableSni : undefined; resourceInputs["failureThreshold"] = state ? state.failureThreshold : undefined; resourceInputs["fqdn"] = state ? state.fqdn : undefined; resourceInputs["insufficientDataHealthStatus"] = state ? state.insufficientDataHealthStatus : undefined; resourceInputs["invertHealthcheck"] = state ? state.invertHealthcheck : undefined; resourceInputs["ipAddress"] = state ? state.ipAddress : undefined; resourceInputs["measureLatency"] = state ? state.measureLatency : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["referenceName"] = state ? state.referenceName : undefined; resourceInputs["regions"] = state ? state.regions : undefined; resourceInputs["requestInterval"] = state ? state.requestInterval : undefined; resourceInputs["resourcePath"] = state ? state.resourcePath : undefined; resourceInputs["routingControlArn"] = state ? state.routingControlArn : undefined; resourceInputs["searchString"] = state ? state.searchString : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["triggers"] = state ? state.triggers : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["childHealthThreshold"] = args ? args.childHealthThreshold : undefined; resourceInputs["childHealthchecks"] = args ? args.childHealthchecks : undefined; resourceInputs["cloudwatchAlarmName"] = args ? args.cloudwatchAlarmName : undefined; resourceInputs["cloudwatchAlarmRegion"] = args ? args.cloudwatchAlarmRegion : undefined; resourceInputs["disabled"] = args ? args.disabled : undefined; resourceInputs["enableSni"] = args ? args.enableSni : undefined; resourceInputs["failureThreshold"] = args ? args.failureThreshold : undefined; resourceInputs["fqdn"] = args ? args.fqdn : undefined; resourceInputs["insufficientDataHealthStatus"] = args ? args.insufficientDataHealthStatus : undefined; resourceInputs["invertHealthcheck"] = args ? args.invertHealthcheck : undefined; resourceInputs["ipAddress"] = args ? args.ipAddress : undefined; resourceInputs["measureLatency"] = args ? args.measureLatency : undefined; resourceInputs["port"] = args ? args.port : undefined; resourceInputs["referenceName"] = args ? args.referenceName : undefined; resourceInputs["regions"] = args ? args.regions : undefined; resourceInputs["requestInterval"] = args ? args.requestInterval : undefined; resourceInputs["resourcePath"] = args ? args.resourcePath : undefined; resourceInputs["routingControlArn"] = args ? args.routingControlArn : undefined; resourceInputs["searchString"] = args ? args.searchString : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["triggers"] = args ? args.triggers : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(HealthCheck.__pulumiType, name, resourceInputs, opts); } } exports.HealthCheck = HealthCheck; /** @internal */ HealthCheck.__pulumiType = 'aws:route53/healthCheck:HealthCheck'; //# sourceMappingURL=healthCheck.js.map