Table Of Contents

Feedback

User Guide

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

[ aws . fms ]

put-policy

Description

Creates an AWS Firewall Manager policy.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

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

Options

--policy (structure)

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

Shorthand Syntax:

PolicyId=string,PolicyName=string,PolicyUpdateToken=string,SecurityServicePolicyData={Type=string,ManagedServiceData=string},ResourceType=string,ResourceTags=[{Key=string,Value=string},{Key=string,Value=string}],ExcludeResourceTags=boolean,RemediationEnabled=boolean

JSON Syntax:

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

--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.

--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.

Output

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 put-policy 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 get-policy 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 value is WAF .

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\"}}

ResourceType -> (string)

The type of resource to protect with the policy, either an Application Load Balancer or a CloudFront distribution. This is in the format shown in AWS Resource Types Reference . Valid values are AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution .

ResourceTags -> (list)

An array of ResourceTag objects.

(structure)

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.

PolicyArn -> (string)

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