@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
90 lines • 3.83 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.PolicyTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS Verified Permissions Policy Template.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.verifiedpermissions.PolicyTemplate("example", {
* policyStoreId: exampleAwsVerifiedpermissionsPolicyStore.id,
* statement: "permit (principal in ?principal, action in PhotoFlash::Action::\"FullPhotoAccess\", resource == ?resource) unless { resource.IsPrivate };",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Verified Permissions Policy Store using the `policy_store_id:policy_template_id`. For example:
*
* ```sh
* $ pulumi import aws:verifiedpermissions/policyTemplate:PolicyTemplate example policyStoreId:policyTemplateId
* ```
*/
class PolicyTemplate extends pulumi.CustomResource {
/**
* Get an existing PolicyTemplate 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, id, state, opts) {
return new PolicyTemplate(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of PolicyTemplate. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === PolicyTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdDate"] = state?.createdDate;
resourceInputs["description"] = state?.description;
resourceInputs["policyStoreId"] = state?.policyStoreId;
resourceInputs["policyTemplateId"] = state?.policyTemplateId;
resourceInputs["region"] = state?.region;
resourceInputs["statement"] = state?.statement;
}
else {
const args = argsOrState;
if (args?.policyStoreId === undefined && !opts.urn) {
throw new Error("Missing required property 'policyStoreId'");
}
if (args?.statement === undefined && !opts.urn) {
throw new Error("Missing required property 'statement'");
}
resourceInputs["description"] = args?.description;
resourceInputs["policyStoreId"] = args?.policyStoreId;
resourceInputs["region"] = args?.region;
resourceInputs["statement"] = args?.statement;
resourceInputs["createdDate"] = undefined /*out*/;
resourceInputs["policyTemplateId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PolicyTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.PolicyTemplate = PolicyTemplate;
/** @internal */
PolicyTemplate.__pulumiType = 'aws:verifiedpermissions/policyTemplate:PolicyTemplate';
//# sourceMappingURL=policyTemplate.js.map
;