UNPKG

@pulumi/aws

Version:

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

144 lines • 7.89 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.Canary = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Synthetics Canary resource. * * > **NOTE:** When you create a canary, AWS creates supporting implicit resources. See the Amazon CloudWatch Synthetics documentation on [DeleteCanary](https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DeleteCanary.html) for a full list. Neither AWS nor this provider deletes these implicit resources automatically when the canary is deleted. Before deleting a canary, ensure you have all the information about the canary that you need to delete the implicit resources using the AWS Console, or AWS CLI. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const some = new aws.synthetics.Canary("some", { * name: "some-canary", * artifactS3Location: "s3://some-bucket/", * executionRoleArn: "some-role", * handler: "exports.handler", * zipFile: "test-fixtures/lambdatest.zip", * runtimeVersion: "syn-1.0", * schedule: { * expression: "rate(0 minute)", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Synthetics Canaries using the `name`. For example: * * ```sh * $ pulumi import aws:synthetics/canary:Canary some some-canary * ``` */ class Canary extends pulumi.CustomResource { /** * Get an existing Canary 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 Canary(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Canary. 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'] === Canary.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["artifactConfig"] = state ? state.artifactConfig : undefined; resourceInputs["artifactS3Location"] = state ? state.artifactS3Location : undefined; resourceInputs["deleteLambda"] = state ? state.deleteLambda : undefined; resourceInputs["engineArn"] = state ? state.engineArn : undefined; resourceInputs["executionRoleArn"] = state ? state.executionRoleArn : undefined; resourceInputs["failureRetentionPeriod"] = state ? state.failureRetentionPeriod : undefined; resourceInputs["handler"] = state ? state.handler : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["runConfig"] = state ? state.runConfig : undefined; resourceInputs["runtimeVersion"] = state ? state.runtimeVersion : undefined; resourceInputs["s3Bucket"] = state ? state.s3Bucket : undefined; resourceInputs["s3Key"] = state ? state.s3Key : undefined; resourceInputs["s3Version"] = state ? state.s3Version : undefined; resourceInputs["schedule"] = state ? state.schedule : undefined; resourceInputs["sourceLocationArn"] = state ? state.sourceLocationArn : undefined; resourceInputs["startCanary"] = state ? state.startCanary : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["successRetentionPeriod"] = state ? state.successRetentionPeriod : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["timelines"] = state ? state.timelines : undefined; resourceInputs["vpcConfig"] = state ? state.vpcConfig : undefined; resourceInputs["zipFile"] = state ? state.zipFile : undefined; } else { const args = argsOrState; if ((!args || args.artifactS3Location === undefined) && !opts.urn) { throw new Error("Missing required property 'artifactS3Location'"); } if ((!args || args.executionRoleArn === undefined) && !opts.urn) { throw new Error("Missing required property 'executionRoleArn'"); } if ((!args || args.handler === undefined) && !opts.urn) { throw new Error("Missing required property 'handler'"); } if ((!args || args.runtimeVersion === undefined) && !opts.urn) { throw new Error("Missing required property 'runtimeVersion'"); } if ((!args || args.schedule === undefined) && !opts.urn) { throw new Error("Missing required property 'schedule'"); } resourceInputs["artifactConfig"] = args ? args.artifactConfig : undefined; resourceInputs["artifactS3Location"] = args ? args.artifactS3Location : undefined; resourceInputs["deleteLambda"] = args ? args.deleteLambda : undefined; resourceInputs["executionRoleArn"] = args ? args.executionRoleArn : undefined; resourceInputs["failureRetentionPeriod"] = args ? args.failureRetentionPeriod : undefined; resourceInputs["handler"] = args ? args.handler : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["runConfig"] = args ? args.runConfig : undefined; resourceInputs["runtimeVersion"] = args ? args.runtimeVersion : undefined; resourceInputs["s3Bucket"] = args ? args.s3Bucket : undefined; resourceInputs["s3Key"] = args ? args.s3Key : undefined; resourceInputs["s3Version"] = args ? args.s3Version : undefined; resourceInputs["schedule"] = args ? args.schedule : undefined; resourceInputs["startCanary"] = args ? args.startCanary : undefined; resourceInputs["successRetentionPeriod"] = args ? args.successRetentionPeriod : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vpcConfig"] = args ? args.vpcConfig : undefined; resourceInputs["zipFile"] = args ? args.zipFile : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["engineArn"] = undefined /*out*/; resourceInputs["sourceLocationArn"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["timelines"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Canary.__pulumiType, name, resourceInputs, opts); } } exports.Canary = Canary; /** @internal */ Canary.__pulumiType = 'aws:synthetics/canary:Canary'; //# sourceMappingURL=canary.js.map