import * as pulumi from "@pulumi/pulumi"; /** * Provides a Datadog Org Group Policy resource. This can be used to create and manage policies attached to an org group. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as datadog from "@pulumi/datadog"; * * const prod = new datadog.OrgGroup("prod", {name: "Production Environments"}); * // Disables widget copy-paste for every member org of the prod group. * // enforcement_tier = "OVERRIDE_ALLOWED" means member orgs can still override the value; * // use "GROUP_MANAGED" to make the value immutable for members. * const example = new datadog.OrgGroupPolicy("example", { * orgGroupId: prod.id, * policyName: "is_widget_copy_paste_enabled", * content: JSON.stringify({ * org_config: false, * }), * enforcementTier: "OVERRIDE_ALLOWED", * }); * // Provisions a shared role with the given permissions into every member org. * // role policies only support GROUP_MANAGED/DELEGATE; DELEGATE disables the * // shared role and cannot be reversed. * const roleExample = new datadog.OrgGroupPolicy("role_example", { * orgGroupId: prod.id, * policyName: "finance_read_only", * policyType: "role", * content: JSON.stringify({ * permissions: [""], * }), * enforcementTier: "GROUP_MANAGED", * }); * ``` * * ## Behavior notes * * ### Side effects on member orgs * * Creating or updating a policy with a non-`GROUP_MANAGED` tier (`OVERRIDE_ALLOWED` or `DELEGATE`) triggers propagation across every member org in the group. For each member, the server compares the org's current config value to the policy value: * * - **Match:** No action. * - **Mismatch:** The server auto-creates a `datadog.OrgGroupPolicyOverride` for that org, recording its existing value so the org is exempted from the new policy. * * Auto-created overrides show up in the `datadog.getOrgGroupPolicyOverrides` data source and can be adopted into Terraform via import. See the override resource documentation for the full lifecycle. * * ### Transitioning to GROUP_MANAGED * * Changing `enforcementTier` to `"GROUP_MANAGED"` automatically deletes every override associated with this policy server-side. Any `datadog.OrgGroupPolicyOverride` resources pointing at this policy must be removed from configuration in the same commit. Otherwise, Terraform's next apply will try to recreate the server-deleted overrides and fail with a `FailedPrecondition` error. * * ### `role` policies * * `role` policies only support `GROUP_MANAGED` and `DELEGATE` for `enforcementTier`; `OVERRIDE_ALLOWED` is rejected. Setting `enforcementTier` to `"DELEGATE"` disables the shared role and cannot be reversed — the API rejects transitioning a `DELEGATE` `role` policy back to `GROUP_MANAGED`. * * `policyName` can be changed in place for `role` policies without replacing the resource. Renaming an `orgConfig` policy is not supported by the API and forces a replace. * * `role` policies cannot be deleted. `terraform destroy` (or removing the resource from configuration) only succeeds once the policy is already disabled (`enforcementTier = "DELEGATE"`); otherwise it fails with an error asking you to disable it first. On success the resource is removed from state, but the disabled policy itself is not deleted server-side. * * ## Import * * ```sh * $ pulumi import datadog:index/orgGroupPolicy:OrgGroupPolicy example * ``` */ export declare class OrgGroupPolicy extends pulumi.CustomResource { /** * Get an existing OrgGroupPolicy 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?: OrgGroupPolicyState, opts?: pulumi.CustomResourceOptions): OrgGroupPolicy; /** * Check whether an existing OrgGroupPolicy 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?: OrgGroupPolicyState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of OrgGroupPolicy. 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 OrgGroupPolicy; /** * The policy content as a JSON-encoded string. */ readonly content: pulumi.Output; /** * The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Valid values are `OVERRIDE_ALLOWED`, `GROUP_MANAGED`, `DELEGATE`. */ readonly enforcementTier: pulumi.Output; /** * The UUID of the org group this policy belongs to. Must be a valid UUID. */ readonly orgGroupId: pulumi.Output; /** * The name of the policy. String length must be at least 1. */ readonly policyName: pulumi.Output; /** * The type of the policy. Valid values are `orgConfig`, `role`. */ readonly policyType: pulumi.Output; /** * Create a OrgGroupPolicy 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: OrgGroupPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering OrgGroupPolicy resources. */ export interface OrgGroupPolicyState { /** * The policy content as a JSON-encoded string. */ content?: pulumi.Input; /** * The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Valid values are `OVERRIDE_ALLOWED`, `GROUP_MANAGED`, `DELEGATE`. */ enforcementTier?: pulumi.Input; /** * The UUID of the org group this policy belongs to. Must be a valid UUID. */ orgGroupId?: pulumi.Input; /** * The name of the policy. String length must be at least 1. */ policyName?: pulumi.Input; /** * The type of the policy. Valid values are `orgConfig`, `role`. */ policyType?: pulumi.Input; } /** * The set of arguments for constructing a OrgGroupPolicy resource. */ export interface OrgGroupPolicyArgs { /** * The policy content as a JSON-encoded string. */ content: pulumi.Input; /** * The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. Valid values are `OVERRIDE_ALLOWED`, `GROUP_MANAGED`, `DELEGATE`. */ enforcementTier?: pulumi.Input; /** * The UUID of the org group this policy belongs to. Must be a valid UUID. */ orgGroupId: pulumi.Input; /** * The name of the policy. String length must be at least 1. */ policyName: pulumi.Input; /** * The type of the policy. Valid values are `orgConfig`, `role`. */ policyType?: pulumi.Input; } //# sourceMappingURL=orgGroupPolicy.d.ts.map