1import type * as fms from "@distilled.cloud/aws/fms";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4
5/**
6 * Request for {@link PutPolicy}.
7 */
8export interface PutPolicyRequest extends fms.PutPolicyRequest {}
9
10/**
11 * Runtime binding for `fms:PutPolicy`.
12 *
13 * Creates or updates a Firewall Manager policy — a WAF, Shield Advanced, security group, Network Firewall, DNS Firewall, or network ACL policy applied across the organization's accounts. Provide the
14 * implementation with `Effect.provide(AWS.FMS.PutPolicyHttp)`.
15 * ### Managing Policies
16 * **Example:** Create a Policy
17 * ```typescript
18 * // init — account-level binding takes no resource
19 * const putPolicy = yield* AWS.FMS.PutPolicy();
20 *
21 * // runtime
22 * const result = yield* putPolicy({
23 * Policy: {
24 * PolicyName: "org-waf-baseline",
25 * SecurityServicePolicyData: { Type: "WAFV2", ManagedServiceData: "..." },
26 * ResourceType: "AWS::ElasticLoadBalancingV2::LoadBalancer",
27 * ExcludeResourceTags: false,
28 * RemediationEnabled: true,
29 * },
30 * });
31 * console.log(result.Policy?.PolicyId);
32 * ```
33 *
34 * @binding
35 */
36export interface PutPolicy extends Binding.Service<
37 PutPolicy,
38 "AWS.FMS.PutPolicy",
39 () => Effect.Effect<
40 (
41 request: PutPolicyRequest,
42 ) => Effect.Effect<fms.PutPolicyResponse, fms.PutPolicyError>
43 >
44> {}
45
46export const PutPolicy = Binding.Service<PutPolicy>("AWS.FMS.PutPolicy");