Skip to main content

policies

Creates, updates, deletes or gets a policy resource or lists policies in a region

Overview

Namepolicies
TypeResource
DescriptionCreates an AWS Firewall Manager policy.
Idaws.fms.policies

Fields

NameDatatypeDescription
exclude_mapobjectAn FMS includeMap or excludeMap.
exclude_resource_tagsboolean
include_mapobjectAn FMS includeMap or excludeMap.
idstring
policy_namestring
policy_descriptionstring
remediation_enabledboolean
resource_tagsarray
resource_typestringAn AWS resource type
resource_type_listarray
resource_set_idsarray
security_service_policy_dataobjectFirewall security service policy data.
arnstringA resource ARN.
delete_all_policy_resourcesboolean
resources_clean_upboolean
tagsarray
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTExcludeResourceTags, PolicyName, RemediationEnabled, SecurityServicePolicyData, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all policies in a region.

SELECT
region,
exclude_map,
exclude_resource_tags,
include_map,
id,
policy_name,
policy_description,
remediation_enabled,
resource_tags,
resource_type,
resource_type_list,
resource_set_ids,
security_service_policy_data,
arn,
delete_all_policy_resources,
resources_clean_up,
tags
FROM aws.fms.policies
WHERE region = 'us-east-1';

Gets all properties from an individual policy.

SELECT
region,
exclude_map,
exclude_resource_tags,
include_map,
id,
policy_name,
policy_description,
remediation_enabled,
resource_tags,
resource_type,
resource_type_list,
resource_set_ids,
security_service_policy_data,
arn,
delete_all_policy_resources,
resources_clean_up,
tags
FROM aws.fms.policies
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new policy resource, using stack-deploy.

/*+ create */
INSERT INTO aws.fms.policies (
ExcludeResourceTags,
PolicyName,
RemediationEnabled,
SecurityServicePolicyData,
region
)
SELECT
'{{ ExcludeResourceTags }}',
'{{ PolicyName }}',
'{{ RemediationEnabled }}',
'{{ SecurityServicePolicyData }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.fms.policies
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

To operate on the policies resource, the following permissions are required:

Create

fms:PutPolicy,
fms:TagResource,
waf-regional:ListRuleGroups,
wafv2:CheckCapacity,
wafv2:ListRuleGroups,
wafv2:ListAvailableManagedRuleGroups,
wafv2:ListAvailableManagedRuleGroupVersions,
network-firewall:DescribeRuleGroup,
network-firewall:DescribeRuleGroupMetadata,
route53resolver:ListFirewallRuleGroups,
ec2:DescribeAvailabilityZones,
s3:PutBucketPolicy,
s3:GetBucketPolicy

Update

fms:PutPolicy,
fms:GetPolicy,
fms:TagResource,
fms:UntagResource,
fms:ListTagsForResource,
waf-regional:ListRuleGroups,
wafv2:CheckCapacity,
wafv2:ListRuleGroups,
wafv2:ListAvailableManagedRuleGroups,
wafv2:ListAvailableManagedRuleGroupVersions,
network-firewall:DescribeRuleGroup,
network-firewall:DescribeRuleGroupMetadata,
route53resolver:ListFirewallRuleGroups,
ec2:DescribeAvailabilityZones,
s3:PutBucketPolicy,
s3:GetBucketPolicy

Read

fms:GetPolicy,
fms:ListTagsForResource

Delete

fms:DeletePolicy

List

fms:ListPolicies,
fms:ListTagsForResource