@pulumiverse/dynatrace
Version:
A Pulumi package for creating and managing Dynatrace cloud resources.
259 lines (258 loc) • 9.79 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* > **Dynatrace SaaS only**
*
* > To utilize this resource, please define the environment variables `DT_CLIENT_ID`, `DT_CLIENT_SECRET`, `DT_ACCOUNT_ID` with an OAuth client including the following permissions: **View workflows** (`automation:workflows:read`) and **Create and edit workflows** (`automation:workflows:write`).
*
* > This resource is excluded by default in the export utility, please explicitly specify the resource to retrieve existing configuration.
*
* ## Dynatrace Documentation
*
* - Dynatrace Workflows - https://www.dynatrace.com/support/help/platform-modules/cloud-automation/workflows
*
* ## Resource Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumiverse/dynatrace";
*
* const sampleWorklowTF = new dynatrace.AutomationWorkflow("sampleWorklowTF", {
* description: "Desc",
* actor: "########-####-####-####-############",
* title: "Sample Worklow TF1",
* owner: "########-####-####-####-############",
* "private": true,
* tasks: {
* tasks: [
* {
* name: "http_request_1",
* description: "Issue an HTTP request to any API",
* action: "dynatrace.automations:http-function",
* active: true,
* input: JSON.stringify({
* method: "GET",
* url: "https://www.google.at/",
* }),
* position: {
* x: 0,
* y: 1,
* },
* },
* {
* name: "http_request_2",
* description: "Issue an HTTP request to any API",
* action: "dynatrace.automations:http-function",
* active: false,
* input: JSON.stringify({
* method: "GET",
* url: "https://www.second-task.com/",
* }),
* conditions: {
* states: {
* http_request_1: "SUCCESS",
* run_javascript_1: "OK",
* },
* custom: "",
* },
* position: {
* x: -1,
* y: 2,
* },
* timeout: "50000",
* },
* {
* name: "http_request_3",
* description: "Issue an HTTP request to any API",
* action: "dynatrace.automations:http-function",
* active: false,
* input: JSON.stringify({
* method: "GET",
* url: "https://www.third-task.com",
* }),
* conditions: {
* states: {
* http_request_2: "OK",
* },
* custom: "{{http_request_1}}",
* },
* position: {
* x: 0,
* y: 3,
* },
* },
* {
* name: "run_javascript_1",
* description: "Build a custom task running js Code",
* action: "dynatrace.automations:run-javascript",
* active: false,
* input: JSON.stringify({
* script: `// optional import of sdk modules
* import { execution } from '@dynatrace-sdk/automation-utils';
*
* export default async function ({ execution_id }) {
* // your code goes here
* // e.g. get the current execution
* const ex = await execution(execution_id);
* console.log('Automated script execution on behalf of', ex.trigger);
*
* return { triggeredBy: ex.trigger };
* }`,
* }),
* position: {
* x: -2,
* y: 1,
* },
* },
* ],
* },
* trigger: {
* event: {
* active: false,
* config: {
* davisEvent: {
* entityTagsMatch: "all",
* entityTags: {
* asdf: "",
* },
* onProblemClose: false,
* types: ["CUSTOM_ANNOTATION"],
* },
* },
* },
* },
* });
* ```
*/
export declare class AutomationWorkflow extends pulumi.CustomResource {
/**
* Get an existing AutomationWorkflow 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<pulumi.ID>, state?: AutomationWorkflowState, opts?: pulumi.CustomResourceOptions): AutomationWorkflow;
/**
* Returns true if the given object is an instance of AutomationWorkflow. 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 AutomationWorkflow;
/**
* The user context the executions of the workflow will happen with
*/
readonly actor: pulumi.Output<string | undefined>;
/**
* An optional description for the workflow
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The ID of the owner of this workflow
*/
readonly owner: pulumi.Output<string | undefined>;
/**
* Defines whether this workflow is private to the owner or not. Default is `true`
*/
readonly private: pulumi.Output<boolean | undefined>;
/**
* The tasks to run for every execution of this workflow
*/
readonly tasks: pulumi.Output<outputs.AutomationWorkflowTasks>;
/**
* The title / name of the workflow
*/
readonly title: pulumi.Output<string>;
/**
* Configures how executions of the workflows are getting triggered. If no trigger is specified it means the workflow is getting manually triggered
*/
readonly trigger: pulumi.Output<outputs.AutomationWorkflowTrigger | undefined>;
/**
* The type of the workflow. Possible values are `STANDARD` and `SIMPLE`. Defaults to `STANDARD`. Workflows of type `SIMPLE` are allowed to contain only one action
*/
readonly type: pulumi.Output<string | undefined>;
/**
* Create a AutomationWorkflow 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: AutomationWorkflowArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AutomationWorkflow resources.
*/
export interface AutomationWorkflowState {
/**
* The user context the executions of the workflow will happen with
*/
actor?: pulumi.Input<string>;
/**
* An optional description for the workflow
*/
description?: pulumi.Input<string>;
/**
* The ID of the owner of this workflow
*/
owner?: pulumi.Input<string>;
/**
* Defines whether this workflow is private to the owner or not. Default is `true`
*/
private?: pulumi.Input<boolean>;
/**
* The tasks to run for every execution of this workflow
*/
tasks?: pulumi.Input<inputs.AutomationWorkflowTasks>;
/**
* The title / name of the workflow
*/
title?: pulumi.Input<string>;
/**
* Configures how executions of the workflows are getting triggered. If no trigger is specified it means the workflow is getting manually triggered
*/
trigger?: pulumi.Input<inputs.AutomationWorkflowTrigger>;
/**
* The type of the workflow. Possible values are `STANDARD` and `SIMPLE`. Defaults to `STANDARD`. Workflows of type `SIMPLE` are allowed to contain only one action
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a AutomationWorkflow resource.
*/
export interface AutomationWorkflowArgs {
/**
* The user context the executions of the workflow will happen with
*/
actor?: pulumi.Input<string>;
/**
* An optional description for the workflow
*/
description?: pulumi.Input<string>;
/**
* The ID of the owner of this workflow
*/
owner?: pulumi.Input<string>;
/**
* Defines whether this workflow is private to the owner or not. Default is `true`
*/
private?: pulumi.Input<boolean>;
/**
* The tasks to run for every execution of this workflow
*/
tasks: pulumi.Input<inputs.AutomationWorkflowTasks>;
/**
* The title / name of the workflow
*/
title: pulumi.Input<string>;
/**
* Configures how executions of the workflows are getting triggered. If no trigger is specified it means the workflow is getting manually triggered
*/
trigger?: pulumi.Input<inputs.AutomationWorkflowTrigger>;
/**
* The type of the workflow. Possible values are `STANDARD` and `SIMPLE`. Defaults to `STANDARD`. Workflows of type `SIMPLE` are allowed to contain only one action
*/
type?: pulumi.Input<string>;
}