UNPKG

@pulumi/aws-native

Version:

The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)

114 lines (113 loc) 7.63 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents a policy store that you can place schema, policies, and policy templates in to validate authorization requests * * ## Example Usage * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const myPolicyStore = new aws_native.verifiedpermissions.PolicyStore("myPolicyStore", { * schema: { * cedarJson: "{\"PhotoApp\":{\"commonTypes\":{\"PersonType\":{\"type\":\"Record\",\"attributes\":{\"age\":{\"type\":\"Long\"},\"name\":{\"type\":\"String\"}}},\"ContextType\":{\"type\":\"Record\",\"attributes\":{\"ip\":{\"type\":\"Extension\",\"name\":\"ipaddr\",\"required\":false},\"authenticated\":{\"type\":\"Boolean\",\"required\":true}}}},\"entityTypes\":{\"User\":{\"shape\":{\"type\":\"Record\",\"attributes\":{\"userId\":{\"type\":\"String\"},\"personInformation\":{\"type\":\"PersonType\"}}},\"memberOfTypes\":[\"UserGroup\"]},\"UserGroup\":{\"shape\":{\"type\":\"Record\",\"attributes\":{}}},\"Photo\":{\"shape\":{\"type\":\"Record\",\"attributes\":{\"account\":{\"type\":\"Entity\",\"name\":\"Account\",\"required\":true},\"private\":{\"type\":\"Boolean\",\"required\":true}}},\"memberOfTypes\":[\"Album\",\"Account\"]},\"Album\":{\"shape\":{\"type\":\"Record\",\"attributes\":{}}},\"Account\":{\"shape\":{\"type\":\"Record\",\"attributes\":{}}}},\"actions\":{\"viewPhoto\":{\"appliesTo\":{\"principalTypes\":[\"User\",\"UserGroup\"],\"resourceTypes\":[\"Photo\"],\"context\":{\"type\":\"ContextType\"}}},\"createPhoto\":{\"appliesTo\":{\"principalTypes\":[\"User\",\"UserGroup\"],\"resourceTypes\":[\"Photo\"],\"context\":{\"type\":\"ContextType\"}}},\"listPhotos\":{\"appliesTo\":{\"principalTypes\":[\"User\",\"UserGroup\"],\"resourceTypes\":[\"Photo\"],\"context\":{\"type\":\"ContextType\"}}}}}}", * }, * validationSettings: { * mode: aws_native.verifiedpermissions.PolicyStoreValidationMode.Strict, * }, * }); * * ``` */ export declare class PolicyStore extends pulumi.CustomResource { /** * Get an existing PolicyStore 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 opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): PolicyStore; /** * Returns true if the given object is an instance of PolicyStore. 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 PolicyStore; /** * The [Amazon Resource Name (ARN)](https://docs.aws.amazon.com//general/latest/gr/aws-arns-and-namespaces.html) of the new or updated policy store. */ readonly arn: pulumi.Output<string>; /** * Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. * * The default state is `DISABLED` . */ readonly deletionProtection: pulumi.Output<outputs.verifiedpermissions.PolicyStoreDeletionProtection | undefined>; /** * Descriptive text that you can provide to help with identification of the current policy store. */ readonly description: pulumi.Output<string | undefined>; /** * The unique ID of the new or updated policy store. */ readonly policyStoreId: pulumi.Output<string>; /** * Creates or updates the policy schema in a policy store. Cedar can use the schema to validate any Cedar policies and policy templates submitted to the policy store. Any changes to the schema validate only policies and templates submitted after the schema change. Existing policies and templates are not re-evaluated against the changed schema. If you later update a policy, then it is evaluated against the new schema at that time. */ readonly schema: pulumi.Output<outputs.verifiedpermissions.PolicyStoreSchemaDefinition | undefined>; /** * The tags to add to the policy store */ readonly tags: pulumi.Output<outputs.Tag[] | undefined>; /** * Specifies the validation setting for this policy store. * * Currently, the only valid and required value is `Mode` . * * > We recommend that you turn on `STRICT` mode only after you define a schema. If a schema doesn't exist, then `STRICT` mode causes any policy to fail validation, and Verified Permissions rejects the policy. You can turn off validation by using the [UpdatePolicyStore](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) . Then, when you have a schema defined, use [UpdatePolicyStore](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) again to turn validation back on. */ readonly validationSettings: pulumi.Output<outputs.verifiedpermissions.PolicyStoreValidationSettings>; /** * Create a PolicyStore 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: PolicyStoreArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a PolicyStore resource. */ export interface PolicyStoreArgs { /** * Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted. * * The default state is `DISABLED` . */ deletionProtection?: pulumi.Input<inputs.verifiedpermissions.PolicyStoreDeletionProtectionArgs>; /** * Descriptive text that you can provide to help with identification of the current policy store. */ description?: pulumi.Input<string>; /** * Creates or updates the policy schema in a policy store. Cedar can use the schema to validate any Cedar policies and policy templates submitted to the policy store. Any changes to the schema validate only policies and templates submitted after the schema change. Existing policies and templates are not re-evaluated against the changed schema. If you later update a policy, then it is evaluated against the new schema at that time. */ schema?: pulumi.Input<inputs.verifiedpermissions.PolicyStoreSchemaDefinitionArgs>; /** * The tags to add to the policy store */ tags?: pulumi.Input<pulumi.Input<inputs.TagArgs>[]>; /** * Specifies the validation setting for this policy store. * * Currently, the only valid and required value is `Mode` . * * > We recommend that you turn on `STRICT` mode only after you define a schema. If a schema doesn't exist, then `STRICT` mode causes any policy to fail validation, and Verified Permissions rejects the policy. You can turn off validation by using the [UpdatePolicyStore](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) . Then, when you have a schema defined, use [UpdatePolicyStore](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) again to turn validation back on. */ validationSettings: pulumi.Input<inputs.verifiedpermissions.PolicyStoreValidationSettingsArgs>; }