Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . fms ]



Creates an AWS Firewall Manager policy.

Firewall Manager provides two types of policies: A Shield Advanced policy, which applies Shield Advanced protection to specified accounts and resources, or a WAF policy, which contains a rule group and defines which resources are to be protected by that rule group. A policy is specific to either WAF or Shield Advanced. If you want to enforce both WAF rules and Shield Advanced protection across accounts, you can create multiple policies. You can create one or more policies for WAF rules, and one or more policies for Shield Advanced.

You must be subscribed to Shield Advanced to create a Shield Advanced policy. For more information on subscribing to Shield Advanced, see CreateSubscription .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--policy <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--policy (structure)

The details of the AWS Firewall Manager policy to be created.

Shorthand Syntax:


JSON Syntax:

  "PolicyId": "string",
  "PolicyName": "string",
  "PolicyUpdateToken": "string",
  "SecurityServicePolicyData": {
    "Type": "WAF"|"SHIELD_ADVANCED",
    "ManagedServiceData": "string"
  "ResourceType": "string",
  "ResourceTypeList": ["string", ...],
  "ResourceTags": [
      "Key": "string",
      "Value": "string"
  "ExcludeResourceTags": true|false,
  "RemediationEnabled": true|false,
  "IncludeMap": {"ACCOUNT": ["string", ...]
  "ExcludeMap": {"ACCOUNT": ["string", ...]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


Policy -> (structure)

The details of the AWS Firewall Manager policy that was created.

PolicyId -> (string)

The ID of the AWS Firewall Manager policy.

PolicyName -> (string)

The friendly name of the AWS Firewall Manager policy.

PolicyUpdateToken -> (string)

A unique identifier for each update to the policy. When issuing a PutPolicy request, the PolicyUpdateToken in the request must match the PolicyUpdateToken of the current policy version. To get the PolicyUpdateToken of the current policy version, use a GetPolicy request.

SecurityServicePolicyData -> (structure)

Details about the security service that is being used to protect the resources.

Type -> (string)

The service that the policy is using to protect the resources. This specifies the type of policy that is created, either a WAF policy or Shield Advanced policy.

ManagedServiceData -> (string)

Details about the service. This contains WAF data in JSON format, as shown in the following example:

ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\": \"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}}

If this is a Shield Advanced policy, this string will be empty.

ResourceType -> (string)

The type of resource to protect with the policy. This is in the format shown in AWS Resource Types Reference . For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution .

ResourceTypeList -> (list)

An array of ResourceType .


ResourceTags -> (list)

An array of ResourceTag objects.


The resource tags that AWS Firewall Manager uses to determine if a particular resource should be included or excluded from protection by the AWS Firewall Manager policy. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define. Tags are combined with an "OR." That is, if you add more than one tag, if any of the tags matches, the resource is considered a match for the include or exclude. Working with Tag Editor .

Key -> (string)

The resource tag key.

Value -> (string)

The resource tag value.

ExcludeResourceTags -> (boolean)

If set to True , resources with the tags that are specified in the ResourceTag array are not protected by the policy. If set to False , and the ResourceTag array is not null, only resources with the specified tags are associated with the policy.

RemediationEnabled -> (boolean)

Indicates if the policy should be automatically applied to new resources.

IncludeMap -> (map)

Specifies the AWS account IDs to include in the policy. If IncludeMap is null, all accounts in the organization in AWS Organizations are included in the policy. If IncludeMap is not null, only values listed in IncludeMap are included in the policy.

The key to the map is ACCOUNT . For example, a valid IncludeMap would be {“ACCOUNT” : [“accountID1”, “accountID2”]} .

key -> (string)

value -> (list)


ExcludeMap -> (map)

Specifies the AWS account IDs to exclude from the policy. The IncludeMap values are evaluated first, with all the appropriate account IDs added to the policy. Then the accounts listed in ExcludeMap are removed, resulting in the final list of accounts to add to the policy.

The key to the map is ACCOUNT . For example, a valid ExcludeMap would be {“ACCOUNT” : [“accountID1”, “accountID2”]} .

key -> (string)

value -> (list)


PolicyArn -> (string)

The Amazon Resource Name (ARN) of the policy that was created.