import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a Datadog Execution Policy resource. Execution policies control which Action Platform actions may run, and where. Each policy pairs an effect (`allow` or `deny`) with a pattern of actions, optionally narrowed to specific Kubernetes namespaces, scripts, remote shell paths or Slack channel names, and optionally scoped to targets matching a set of tags, such as agents matching Fleet Automation tags or a Slack workspace. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as datadog from "@pulumi/datadog"; * * // Kubernetes: allow read-only actions against prod namespaces, on agents/PARs * // matching either target tag set below. * const kubernetesProdRead = new datadog.ActionExecutionPolicy("kubernetes_prod_read", { * name: "allow-kubernetes-prod-read", * effect: "allow", * actionPattern: [{ * integration: "INTEGRATION_KUBERNETES", * actionFqns: [ * "com.datadoghq.kubernetes.core.getPod", * "com.datadoghq.kubernetes.core.listPod", * ], * }], * scope: [{ * kubernetes: [{ * rules: [{ * targetNamespaces: [ * "prod", * "prod-system", * ], * }], * }], * }], * targets: [ * { * name: "prod-us", * agentTags: [ * "env:prod", * "region:us-east-1", * ], * }, * { * name: "prod-eu", * agentTags: [ * "env:prod", * "region:eu-west-1", * ], * }, * ], * }); * // Remote action (rshell): allow command execution restricted to a read-only path on staging agents. * const rshellStagingReadonly = new datadog.ActionExecutionPolicy("rshell_staging_readonly", { * name: "rshell-staging-readonly", * effect: "allow", * actionPattern: [{ * integration: "INTEGRATION_REMOTE_ACTION", * actionFqns: ["com.datadoghq.remoteaction.rshell.runCommand"], * }], * scope: [{ * remoteActionRshell: [{ * rules: [{ * targetPaths: ["/etc/datadog-agent/"], * access: "read_only", * }], * }], * }], * targets: [{ * name: "staging", * agentTags: ["env:staging"], * }], * }); * // Scripts: deny a specific shell script action everywhere, regardless of agent tags * // (no `target` block means the policy applies fleet-wide). * const denyDangerousScript = new datadog.ActionExecutionPolicy("deny_dangerous_script", { * name: "deny-dangerous-cleanup-script", * effect: "deny", * actionPattern: [{ * integration: "INTEGRATION_SCRIPT", * actionFqns: ["com.datadoghq.script.runShellScript"], * }], * scope: [{ * scripts: [{ * rules: [{ * targetScriptNames: ["dangerous-cleanup.sh"], * }], * }], * }], * }); * // Slack: allow posting messages to incident channels in one Slack workspace. * const slackIncidentChannels = new datadog.ActionExecutionPolicy("slack_incident_channels", { * name: "slack-incident-channels", * effect: "allow", * actionPattern: [{ * integration: "INTEGRATION_SLACK", * actionFqns: ["com.datadoghq.slack.send_simple_message"], * }], * scope: [{ * slack: [{ * rules: [{ * channelNameSelectors: ["incident-*"], * }], * }], * }], * targets: [{ * name: "main-workspace", * agentTags: ["slack_workspace_id:T0123456789"], * }], * }); * // Access to a policy is managed separately via datadog_restriction_policy, * // keyed by "execution-policy:". * const kubernetesProdPerms = new datadog.RestrictionPolicy("kubernetes_prod_perms", { * resourceId: pulumi.interpolate`execution-policy:${kubernetesProdRead.id}`, * bindings: [{ * relation: "editor", * principals: ["role:sre-oncall"], * }], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * ```sh * $ pulumi import datadog:index/actionExecutionPolicy:ActionExecutionPolicy my_policy 11111111-2222-3333-4444-555555555555 * ``` */ export declare class ActionExecutionPolicy extends pulumi.CustomResource { /** * Get an existing ActionExecutionPolicy 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?: ActionExecutionPolicyState, opts?: pulumi.CustomResourceOptions): ActionExecutionPolicy; /** * Check whether an existing ActionExecutionPolicy resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: ActionExecutionPolicyState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of ActionExecutionPolicy. 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 ActionExecutionPolicy; /** * The set of actions this policy applies to. Required. */ readonly actionPattern: pulumi.Output; /** * The date and time the execution policy was created, as an RFC3339 timestamp. */ readonly createdAt: pulumi.Output; /** * The ID of the user who created the execution policy. */ readonly createdBy: pulumi.Output; /** * Whether the policy allows or denies the matched actions. Valid values are `allow`, `deny`. */ readonly effect: pulumi.Output; /** * The name of the execution policy. */ readonly name: pulumi.Output; /** * Restricts where the policy applies, beyond `actionPattern`. When configured, exactly one of `kubernetes`, `scripts`, `remoteActionRshell` or `slack` must be set, and it must match `action_pattern.integration`. Omitting this block means the policy has no scope restriction. */ readonly scope: pulumi.Output; /** * A target this policy is scoped to, expressed as a set of tags. Each target is matched independently; omitting all `target` blocks applies the policy fleet-wide. */ readonly targets: pulumi.Output; /** * The date and time the execution policy was last updated, as an RFC3339 timestamp. */ readonly updatedAt: pulumi.Output; /** * The ID of the user who last updated the execution policy. */ readonly updatedBy: pulumi.Output; /** * The version of the execution policy. Incremented by Datadog on every update. */ readonly version: pulumi.Output; /** * Create a ActionExecutionPolicy 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: ActionExecutionPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ActionExecutionPolicy resources. */ export interface ActionExecutionPolicyState { /** * The set of actions this policy applies to. Required. */ actionPattern?: pulumi.Input; /** * The date and time the execution policy was created, as an RFC3339 timestamp. */ createdAt?: pulumi.Input; /** * The ID of the user who created the execution policy. */ createdBy?: pulumi.Input; /** * Whether the policy allows or denies the matched actions. Valid values are `allow`, `deny`. */ effect?: pulumi.Input; /** * The name of the execution policy. */ name?: pulumi.Input; /** * Restricts where the policy applies, beyond `actionPattern`. When configured, exactly one of `kubernetes`, `scripts`, `remoteActionRshell` or `slack` must be set, and it must match `action_pattern.integration`. Omitting this block means the policy has no scope restriction. */ scope?: pulumi.Input; /** * A target this policy is scoped to, expressed as a set of tags. Each target is matched independently; omitting all `target` blocks applies the policy fleet-wide. */ targets?: pulumi.Input[] | undefined>; /** * The date and time the execution policy was last updated, as an RFC3339 timestamp. */ updatedAt?: pulumi.Input; /** * The ID of the user who last updated the execution policy. */ updatedBy?: pulumi.Input; /** * The version of the execution policy. Incremented by Datadog on every update. */ version?: pulumi.Input; } /** * The set of arguments for constructing a ActionExecutionPolicy resource. */ export interface ActionExecutionPolicyArgs { /** * The set of actions this policy applies to. Required. */ actionPattern?: pulumi.Input; /** * Whether the policy allows or denies the matched actions. Valid values are `allow`, `deny`. */ effect: pulumi.Input; /** * The name of the execution policy. */ name: pulumi.Input; /** * Restricts where the policy applies, beyond `actionPattern`. When configured, exactly one of `kubernetes`, `scripts`, `remoteActionRshell` or `slack` must be set, and it must match `action_pattern.integration`. Omitting this block means the policy has no scope restriction. */ scope?: pulumi.Input; /** * A target this policy is scoped to, expressed as a set of tags. Each target is matched independently; omitting all `target` blocks applies the policy fleet-wide. */ targets?: pulumi.Input[] | undefined>; } //# sourceMappingURL=actionExecutionPolicy.d.ts.map