@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
141 lines • 6.5 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.Policy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to create an AWS Firewall Manager policy. You need to be using AWS organizations and have enabled the Firewall Manager administrator account.
*
* > **NOTE:** Due to limitations with testing, we provide it as best effort. If you find it useful, and have the ability to help test or notice issues, consider reaching out to us on GitHub.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleRuleGroup = new aws.wafregional.RuleGroup("example", {
* metricName: "WAFRuleGroupExample",
* name: "WAF-Rule-Group-Example",
* });
* const example = new aws.fms.Policy("example", {
* name: "FMS-Policy-Example",
* excludeResourceTags: false,
* remediationEnabled: false,
* resourceType: "AWS::ElasticLoadBalancingV2::LoadBalancer",
* securityServicePolicyData: {
* type: "WAF",
* managedServiceData: pulumi.jsonStringify({
* type: "WAF",
* ruleGroups: [{
* id: exampleRuleGroup.id,
* overrideAction: {
* type: "COUNT",
* },
* }],
* defaultAction: {
* type: "BLOCK",
* },
* overrideCustomerWebACLAssociation: false,
* }),
* },
* tags: {
* Name: "example-fms-policy",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Firewall Manager policies using the policy ID. For example:
*
* ```sh
* $ pulumi import aws:fms/policy:Policy example 5be49585-a7e3-4c49-dde1-a179fe4a619a
* ```
*/
class Policy extends pulumi.CustomResource {
/**
* Get an existing Policy 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 Policy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Policy. 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'] === Policy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["deleteAllPolicyResources"] = state?.deleteAllPolicyResources;
resourceInputs["deleteUnusedFmManagedResources"] = state?.deleteUnusedFmManagedResources;
resourceInputs["description"] = state?.description;
resourceInputs["excludeMap"] = state?.excludeMap;
resourceInputs["excludeResourceTags"] = state?.excludeResourceTags;
resourceInputs["includeMap"] = state?.includeMap;
resourceInputs["name"] = state?.name;
resourceInputs["policyUpdateToken"] = state?.policyUpdateToken;
resourceInputs["region"] = state?.region;
resourceInputs["remediationEnabled"] = state?.remediationEnabled;
resourceInputs["resourceSetIds"] = state?.resourceSetIds;
resourceInputs["resourceTagLogicalOperator"] = state?.resourceTagLogicalOperator;
resourceInputs["resourceTags"] = state?.resourceTags;
resourceInputs["resourceType"] = state?.resourceType;
resourceInputs["resourceTypeLists"] = state?.resourceTypeLists;
resourceInputs["securityServicePolicyData"] = state?.securityServicePolicyData;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.excludeResourceTags === undefined && !opts.urn) {
throw new Error("Missing required property 'excludeResourceTags'");
}
if (args?.securityServicePolicyData === undefined && !opts.urn) {
throw new Error("Missing required property 'securityServicePolicyData'");
}
resourceInputs["deleteAllPolicyResources"] = args?.deleteAllPolicyResources;
resourceInputs["deleteUnusedFmManagedResources"] = args?.deleteUnusedFmManagedResources;
resourceInputs["description"] = args?.description;
resourceInputs["excludeMap"] = args?.excludeMap;
resourceInputs["excludeResourceTags"] = args?.excludeResourceTags;
resourceInputs["includeMap"] = args?.includeMap;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["remediationEnabled"] = args?.remediationEnabled;
resourceInputs["resourceSetIds"] = args?.resourceSetIds;
resourceInputs["resourceTagLogicalOperator"] = args?.resourceTagLogicalOperator;
resourceInputs["resourceTags"] = args?.resourceTags;
resourceInputs["resourceType"] = args?.resourceType;
resourceInputs["resourceTypeLists"] = args?.resourceTypeLists;
resourceInputs["securityServicePolicyData"] = args?.securityServicePolicyData;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["policyUpdateToken"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Policy.__pulumiType, name, resourceInputs, opts);
}
}
exports.Policy = Policy;
/** @internal */
Policy.__pulumiType = 'aws:fms/policy:Policy';
//# sourceMappingURL=policy.js.map