@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
144 lines • 6.99 kB
JavaScript
// *** 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, { ...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?.arn;
resourceInputs["artifactConfig"] = state?.artifactConfig;
resourceInputs["artifactS3Location"] = state?.artifactS3Location;
resourceInputs["deleteLambda"] = state?.deleteLambda;
resourceInputs["engineArn"] = state?.engineArn;
resourceInputs["executionRoleArn"] = state?.executionRoleArn;
resourceInputs["failureRetentionPeriod"] = state?.failureRetentionPeriod;
resourceInputs["handler"] = state?.handler;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["runConfig"] = state?.runConfig;
resourceInputs["runtimeVersion"] = state?.runtimeVersion;
resourceInputs["s3Bucket"] = state?.s3Bucket;
resourceInputs["s3Key"] = state?.s3Key;
resourceInputs["s3Version"] = state?.s3Version;
resourceInputs["schedule"] = state?.schedule;
resourceInputs["sourceLocationArn"] = state?.sourceLocationArn;
resourceInputs["startCanary"] = state?.startCanary;
resourceInputs["status"] = state?.status;
resourceInputs["successRetentionPeriod"] = state?.successRetentionPeriod;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["timelines"] = state?.timelines;
resourceInputs["vpcConfig"] = state?.vpcConfig;
resourceInputs["zipFile"] = state?.zipFile;
}
else {
const args = argsOrState;
if (args?.artifactS3Location === undefined && !opts.urn) {
throw new Error("Missing required property 'artifactS3Location'");
}
if (args?.executionRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'executionRoleArn'");
}
if (args?.handler === undefined && !opts.urn) {
throw new Error("Missing required property 'handler'");
}
if (args?.runtimeVersion === undefined && !opts.urn) {
throw new Error("Missing required property 'runtimeVersion'");
}
if (args?.schedule === undefined && !opts.urn) {
throw new Error("Missing required property 'schedule'");
}
resourceInputs["artifactConfig"] = args?.artifactConfig;
resourceInputs["artifactS3Location"] = args?.artifactS3Location;
resourceInputs["deleteLambda"] = args?.deleteLambda;
resourceInputs["executionRoleArn"] = args?.executionRoleArn;
resourceInputs["failureRetentionPeriod"] = args?.failureRetentionPeriod;
resourceInputs["handler"] = args?.handler;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["runConfig"] = args?.runConfig;
resourceInputs["runtimeVersion"] = args?.runtimeVersion;
resourceInputs["s3Bucket"] = args?.s3Bucket;
resourceInputs["s3Key"] = args?.s3Key;
resourceInputs["s3Version"] = args?.s3Version;
resourceInputs["schedule"] = args?.schedule;
resourceInputs["startCanary"] = args?.startCanary;
resourceInputs["successRetentionPeriod"] = args?.successRetentionPeriod;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcConfig"] = args?.vpcConfig;
resourceInputs["zipFile"] = args?.zipFile;
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
;