import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Check groups organize related checks together and allow optional shared configuration. * * Unlike `checkly.CheckGroup` (v1), which always imposed implicit defaults for various settings, `checkly.CheckGroupV2` does not override any check settings by default. A group can be as minimal as just a name. Use the optional `enforce_*` blocks only when you explicitly want the group to override individual check settings. * * The new `checkly.CheckGroupV2` resource should always be preferred over the old `checkly.CheckGroup` resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as checkly from "@checkly/pulumi"; * * // Minimal example: just a folder to organize checks. * const just_a_folder = new checkly.CheckGroupV2("just-a-folder", {name: "Just a Folder"}); * // Full example: a group with enforced settings that override individual checks. * const production_api = new checkly.CheckGroupV2("production-api", { * name: "Production API", * activated: true, * muted: false, * concurrency: 5, * tags: [ * "production", * "api", * ], * enforceLocations: { * enabled: true, * locations: [ * "us-east-1", * "eu-west-1", * "ap-southeast-1", * ], * privateLocations: ["my-datacenter"], * }, * enforceRetryStrategy: { * enabled: true, * retryStrategy: { * type: "LINEAR", * baseBackoffSeconds: 30, * maxRetries: 3, * maxDurationSeconds: 300, * sameRegion: true, * }, * }, * enforceSchedulingStrategy: { * enabled: true, * runParallel: true, * }, * enforceAlertSettings: { * enabled: true, * alertSettings: { * escalationType: "RUN_BASED", * runBasedEscalations: [{ * failedRunThreshold: 2, * }], * reminders: [{ * amount: 3, * interval: 10, * }], * parallelRunFailureThresholds: [{ * enabled: true, * percentage: 50, * }], * }, * alertChannelSubscriptions: [{ * channelId: 1234, * activated: true, * }], * }, * environmentVariables: [ * { * key: "BASE_URL", * value: "https://api.example.com", * locked: false, * }, * { * key: "API_TOKEN", * value: "super-secret-token", * locked: true, * secret: true, * }, * ], * defaultRuntime: { * runtimeId: "2024.02", * }, * apiCheckDefaults: { * url: "https://api.example.com/", * headers: { * "X-Api-Key": "{{API_TOKEN}}", * "Content-Type": "application/json", * }, * queryParameters: { * version: "v2", * }, * assertions: [ * { * source: "STATUS_CODE", * comparison: "LESS_THAN", * target: "400", * }, * { * source: "RESPONSE_TIME", * comparison: "LESS_THAN", * target: "3000", * }, * ], * basicAuth: { * username: "admin", * password: "pass", * }, * }, * setupScript: { * inlineScript: `// Runs before every API check in this group * console.log("Setting up...") * `, * }, * teardownScript: { * inlineScript: `// Runs after every API check in this group * console.log("Tearing down...") * `, * }, * }); * // Example: enforce only retry strategy with network-error-only retries. * const retry_on_network_errors = new checkly.CheckGroupV2("retry-on-network-errors", { * name: "Retry on Network Errors Only", * enforceRetryStrategy: { * enabled: true, * retryStrategy: { * type: "EXPONENTIAL", * baseBackoffSeconds: 10, * maxRetries: 5, * maxDurationSeconds: 600, * sameRegion: false, * onlyOn: { * networkError: true, * }, * }, * }, * }); * // Example: enforce time-based alert escalation. * const time_based_alerts = new checkly.CheckGroupV2("time-based-alerts", { * name: "Time-Based Alert Escalation", * enforceAlertSettings: { * enabled: true, * alertSettings: { * escalationType: "TIME_BASED", * timeBasedEscalations: [{ * minutesFailingThreshold: 10, * }], * reminders: [{ * amount: 5, * interval: 15, * }], * }, * }, * }); * // Example: use global alert settings instead of custom ones. * const use_global_alerts = new checkly.CheckGroupV2("use-global-alerts", { * name: "Use Global Alert Settings", * enforceAlertSettings: { * enabled: true, * useGlobalAlertSettings: true, * }, * }); * // Example: enforce alert channel subscriptions with custom alert settings. * const email = new checkly.AlertChannel("email", {email: { * address: "alerts@example.com", * }}); * const slack = new checkly.AlertChannel("slack", {slack: { * channel: "#alerts", * url: "https://hooks.slack.com/services/TXXXXX/XXXXX/XXXXXXXXXX", * }}); * const with_alert_channels = new checkly.CheckGroupV2("with-alert-channels", { * name: "Group with Alert Channels", * enforceAlertSettings: { * enabled: true, * alertSettings: { * escalationType: "RUN_BASED", * runBasedEscalations: [{ * failedRunThreshold: 1, * }], * reminders: [{ * amount: 0, * interval: 5, * }], * }, * alertChannelSubscriptions: [ * { * channelId: email.id, * activated: true, * }, * { * channelId: slack.id, * activated: true, * }, * ], * }, * }); * // Example: enforce no retries. * const no_retries = new checkly.CheckGroupV2("no-retries", { * name: "No Retries Group", * enforceRetryStrategy: { * enabled: true, * retryStrategy: { * type: "NO_RETRIES", * }, * }, * }); * // Example: enforce a single retry. * const single_retry = new checkly.CheckGroupV2("single-retry", { * name: "Single Retry Group", * enforceRetryStrategy: { * enabled: true, * retryStrategy: { * type: "SINGLE_RETRY", * baseBackoffSeconds: 10, * sameRegion: true, * }, * }, * }); * ``` */ export declare class CheckGroupV2 extends pulumi.CustomResource { /** * Get an existing CheckGroupV2 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: string, id: pulumi.Input, state?: CheckGroupV2State, opts?: pulumi.CustomResourceOptions): CheckGroupV2; /** * Returns true if the given object is an instance of CheckGroupV2. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is CheckGroupV2; /** * Determines whether activated checks in the group should run or not. Deactivating the group will prevent all checks in the group from running, regardless of their activated state. (Default `true`). */ readonly activated: pulumi.Output; readonly apiCheckDefaults: pulumi.Output; /** * Determines the number of checks to run concurrently when triggering the check group via CI/CD or the API. (Default `1`). */ readonly concurrency: pulumi.Output; /** * Sets a default runtime for the group. Used as a fallback when a check belonging to the group has no runtime set. Takes precedence over the account default runtime. */ readonly defaultRuntime: pulumi.Output; /** * Enforces alert settings for the whole group. Overrides check configuration. */ readonly enforceAlertSettings: pulumi.Output; /** * Enforces public and private locations for the whole group. Overrides check configuration. */ readonly enforceLocations: pulumi.Output; /** * Enforces a retry strategy for the whole group. Overrides check configuration. */ readonly enforceRetryStrategy: pulumi.Output; /** * Enforces a scheduling strategy for the whole group. Overrides check configuration. */ readonly enforceSchedulingStrategy: pulumi.Output; /** * Insert environment variables into the runtime environment of checks in the group. Only relevant for check types that support environment variables. Use global environment variables whenever possible. */ readonly environmentVariables: pulumi.Output; /** * Determines if any notifications will be sent out when a check in this group fails and/or recovers. Muting the group will deactivate all notifications for all checks in the group, regardless of their muted state. (Default `false`). */ readonly muted: pulumi.Output; /** * The name of the check group. */ readonly name: pulumi.Output; /** * A script to run in the setup phase of an API check. Runs in addition to the check's own setup script. */ readonly setupScript: pulumi.Output; /** * Additional tags to append to all checks in the group. */ readonly tags: pulumi.Output; /** * A script to run in the teardown phase of an API check. Runs in addition to the check's own teardown script. */ readonly teardownScript: pulumi.Output; /** * Create a CheckGroupV2 resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: CheckGroupV2Args, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CheckGroupV2 resources. */ export interface CheckGroupV2State { /** * Determines whether activated checks in the group should run or not. Deactivating the group will prevent all checks in the group from running, regardless of their activated state. (Default `true`). */ activated?: pulumi.Input; apiCheckDefaults?: pulumi.Input; /** * Determines the number of checks to run concurrently when triggering the check group via CI/CD or the API. (Default `1`). */ concurrency?: pulumi.Input; /** * Sets a default runtime for the group. Used as a fallback when a check belonging to the group has no runtime set. Takes precedence over the account default runtime. */ defaultRuntime?: pulumi.Input; /** * Enforces alert settings for the whole group. Overrides check configuration. */ enforceAlertSettings?: pulumi.Input; /** * Enforces public and private locations for the whole group. Overrides check configuration. */ enforceLocations?: pulumi.Input; /** * Enforces a retry strategy for the whole group. Overrides check configuration. */ enforceRetryStrategy?: pulumi.Input; /** * Enforces a scheduling strategy for the whole group. Overrides check configuration. */ enforceSchedulingStrategy?: pulumi.Input; /** * Insert environment variables into the runtime environment of checks in the group. Only relevant for check types that support environment variables. Use global environment variables whenever possible. */ environmentVariables?: pulumi.Input[]>; /** * Determines if any notifications will be sent out when a check in this group fails and/or recovers. Muting the group will deactivate all notifications for all checks in the group, regardless of their muted state. (Default `false`). */ muted?: pulumi.Input; /** * The name of the check group. */ name?: pulumi.Input; /** * A script to run in the setup phase of an API check. Runs in addition to the check's own setup script. */ setupScript?: pulumi.Input; /** * Additional tags to append to all checks in the group. */ tags?: pulumi.Input[]>; /** * A script to run in the teardown phase of an API check. Runs in addition to the check's own teardown script. */ teardownScript?: pulumi.Input; } /** * The set of arguments for constructing a CheckGroupV2 resource. */ export interface CheckGroupV2Args { /** * Determines whether activated checks in the group should run or not. Deactivating the group will prevent all checks in the group from running, regardless of their activated state. (Default `true`). */ activated?: pulumi.Input; apiCheckDefaults?: pulumi.Input; /** * Determines the number of checks to run concurrently when triggering the check group via CI/CD or the API. (Default `1`). */ concurrency?: pulumi.Input; /** * Sets a default runtime for the group. Used as a fallback when a check belonging to the group has no runtime set. Takes precedence over the account default runtime. */ defaultRuntime?: pulumi.Input; /** * Enforces alert settings for the whole group. Overrides check configuration. */ enforceAlertSettings?: pulumi.Input; /** * Enforces public and private locations for the whole group. Overrides check configuration. */ enforceLocations?: pulumi.Input; /** * Enforces a retry strategy for the whole group. Overrides check configuration. */ enforceRetryStrategy?: pulumi.Input; /** * Enforces a scheduling strategy for the whole group. Overrides check configuration. */ enforceSchedulingStrategy?: pulumi.Input; /** * Insert environment variables into the runtime environment of checks in the group. Only relevant for check types that support environment variables. Use global environment variables whenever possible. */ environmentVariables?: pulumi.Input[]>; /** * Determines if any notifications will be sent out when a check in this group fails and/or recovers. Muting the group will deactivate all notifications for all checks in the group, regardless of their muted state. (Default `false`). */ muted?: pulumi.Input; /** * The name of the check group. */ name?: pulumi.Input; /** * A script to run in the setup phase of an API check. Runs in addition to the check's own setup script. */ setupScript?: pulumi.Input; /** * Additional tags to append to all checks in the group. */ tags?: pulumi.Input[]>; /** * A script to run in the teardown phase of an API check. Runs in addition to the check's own teardown script. */ teardownScript?: pulumi.Input; }