import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * Provides a Cloudflare Access Policy resource. Access Policies are used * in conjunction with Access Applications to restrict access to a * particular resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi_cloudflare from "@mapped/pulumi-cloudflare"; * * // Allowing access to `test@example.com` email address only * const testPolicyAccessPolicy = new cloudflare.AccessPolicy("testPolicyAccessPolicy", { * applicationId: "cb029e245cfdd66dc8d2e570d5dd3322", * zoneId: "d41d8cd98f00b204e9800998ecf8427e", * name: "staging policy", * precedence: 1, * decision: "allow", * includes: [{ * emails: ["test@example.com"], * }], * requires: [{ * emails: ["test@example.com"], * }], * }); * // Allowing `test@example.com` to access but only when coming from a * // specific IP. * const testPolicyIndex_accessPolicyAccessPolicy = new cloudflare.AccessPolicy("testPolicyIndex/accessPolicyAccessPolicy", { * applicationId: "cb029e245cfdd66dc8d2e570d5dd3322", * zoneId: "d41d8cd98f00b204e9800998ecf8427e", * name: "staging policy", * precedence: 1, * decision: "allow", * includes: [{ * emails: ["test@example.com"], * }], * requires: [{ * ips: [_var.office_ip], * }], * }); * ``` * * ## Import * * Access Policies can be imported using a composite ID formed of identifier type (`zone` or `account`), identifier ID (`zone_id` or `account_id`), application ID and policy ID. # import a zone level Access policy * * ```sh * $ pulumi import cloudflare:index/accessPolicy:AccessPolicy staging zone/cb029e245cfdd66dc8d2e570d5dd3322/d41d8cd98f00b204e9800998ecf8427e/67ea780ce4982c1cfbe6b7293afc765d * ``` * * # import an account level Access policy * * ```sh * $ pulumi import cloudflare:index/accessPolicy:AccessPolicy production account/0d599f0ec05c3bda8c3b8a68c32a1b47/d41d8cd98f00b204e9800998ecf8427e/67ea780ce4982c1cfbe6b7293afc765d * ``` */ export declare class AccessPolicy extends pulumi.CustomResource { /** * Get an existing AccessPolicy 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?: AccessPolicyState, opts?: pulumi.CustomResourceOptions): AccessPolicy; /** * Returns true if the given object is an instance of AccessPolicy. 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 AccessPolicy; /** * The account to which the access rule should be added. Conflicts with `zoneId`. */ readonly accountId: pulumi.Output; /** * The ID of the application the policy is associated with. */ readonly applicationId: pulumi.Output; /** * List of approval group blocks for configuring additional approvals (refer to the nested schema). */ readonly approvalGroups: pulumi.Output; readonly approvalRequired: pulumi.Output; /** * Defines the action Access will take if the policy matches the user. * Allowed values: `allow`, `deny`, `nonIdentity`, `bypass` */ readonly decision: pulumi.Output; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ readonly excludes: pulumi.Output; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ readonly includes: pulumi.Output; /** * Friendly name of the Access Application. */ readonly name: pulumi.Output; /** * The unique precedence for policies on a single application. Integer. */ readonly precedence: pulumi.Output; /** * String to present to the user when purpose justification is enabled. */ readonly purposeJustificationPrompt: pulumi.Output; /** * Boolean of whether to prompt the user for a justification for accessing the resource. */ readonly purposeJustificationRequired: pulumi.Output; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ readonly requires: pulumi.Output; /** * The DNS zone to which the access rule should be added. Conflicts with `accountId`. */ readonly zoneId: pulumi.Output; /** * Create a AccessPolicy 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: AccessPolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AccessPolicy resources. */ export interface AccessPolicyState { /** * The account to which the access rule should be added. Conflicts with `zoneId`. */ accountId?: pulumi.Input; /** * The ID of the application the policy is associated with. */ applicationId?: pulumi.Input; /** * List of approval group blocks for configuring additional approvals (refer to the nested schema). */ approvalGroups?: pulumi.Input[]>; approvalRequired?: pulumi.Input; /** * Defines the action Access will take if the policy matches the user. * Allowed values: `allow`, `deny`, `nonIdentity`, `bypass` */ decision?: pulumi.Input; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ excludes?: pulumi.Input[]>; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ includes?: pulumi.Input[]>; /** * Friendly name of the Access Application. */ name?: pulumi.Input; /** * The unique precedence for policies on a single application. Integer. */ precedence?: pulumi.Input; /** * String to present to the user when purpose justification is enabled. */ purposeJustificationPrompt?: pulumi.Input; /** * Boolean of whether to prompt the user for a justification for accessing the resource. */ purposeJustificationRequired?: pulumi.Input; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ requires?: pulumi.Input[]>; /** * The DNS zone to which the access rule should be added. Conflicts with `accountId`. */ zoneId?: pulumi.Input; } /** * The set of arguments for constructing a AccessPolicy resource. */ export interface AccessPolicyArgs { /** * The account to which the access rule should be added. Conflicts with `zoneId`. */ accountId?: pulumi.Input; /** * The ID of the application the policy is associated with. */ applicationId: pulumi.Input; /** * List of approval group blocks for configuring additional approvals (refer to the nested schema). */ approvalGroups?: pulumi.Input[]>; approvalRequired?: pulumi.Input; /** * Defines the action Access will take if the policy matches the user. * Allowed values: `allow`, `deny`, `nonIdentity`, `bypass` */ decision: pulumi.Input; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ excludes?: pulumi.Input[]>; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ includes: pulumi.Input[]>; /** * Friendly name of the Access Application. */ name: pulumi.Input; /** * The unique precedence for policies on a single application. Integer. */ precedence: pulumi.Input; /** * String to present to the user when purpose justification is enabled. */ purposeJustificationPrompt?: pulumi.Input; /** * Boolean of whether to prompt the user for a justification for accessing the resource. */ purposeJustificationRequired?: pulumi.Input; /** * A series of access conditions, see [Access Groups](https://www.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). */ requires?: pulumi.Input[]>; /** * The DNS zone to which the access rule should be added. Conflicts with `accountId`. */ zoneId?: pulumi.Input; }