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.
Idawscc.fms.policies

Fields

NameDatatypeDescription
exclude_mapobjectAn FMS includeMap or excludeMap.
exclude_resource_tagsboolean
idstring
policy_namestring
policy_descriptionstring
remediation_enabledboolean
resource_tagsarray
resource_tag_logical_operatorstring
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.

For more information, see AWS::FMS::Policy.

Methods

NameResourceAccessible byRequired Params
create_resourcepoliciesINSERTExcludeResourceTags, PolicyName, RemediationEnabled, SecurityServicePolicyData, region
delete_resourcepoliciesDELETEIdentifier, region
update_resourcepoliciesUPDATEIdentifier, PatchDocument, region
list_resourcespolicies_list_onlySELECTregion
get_resourcepoliciesSELECTIdentifier, region

SELECT examples

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_tag_logical_operator,
resource_type,
resource_type_list,
resource_set_ids,
security_service_policy_data,
arn,
delete_all_policy_resources,
resources_clean_up,
tags
FROM awscc.fms.policies
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.fms.policies (
ExcludeResourceTags,
PolicyName,
RemediationEnabled,
SecurityServicePolicyData,
region
)
SELECT
'{{ exclude_resource_tags }}',
'{{ policy_name }}',
'{{ remediation_enabled }}',
'{{ security_service_policy_data }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.fms.policies
SET PatchDocument = string('{{ {
"ExcludeMap": exclude_map,
"ExcludeResourceTags": exclude_resource_tags,
"IncludeMap": include_map,
"PolicyName": policy_name,
"PolicyDescription": policy_description,
"RemediationEnabled": remediation_enabled,
"ResourceTags": resource_tags,
"ResourceTagLogicalOperator": resource_tag_logical_operator,
"ResourceType": resource_type,
"ResourceTypeList": resource_type_list,
"ResourceSetIds": resource_set_ids,
"SecurityServicePolicyData": security_service_policy_data,
"DeleteAllPolicyResources": delete_all_policy_resources,
"ResourcesCleanUp": resources_clean_up,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.fms.policies
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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