

This is the new *Amazon CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [Amazon CloudFormation User Guide](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::AmplifyGen3::Environment WafS3Config

The Amazon S3 delivery settings for Amazon WAF logs.

## Syntax
<a name="aws-properties-amplifygen3-environment-wafs3config-syntax"></a>

To declare this entity in your Amazon CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-amplifygen3-environment-wafs3config-syntax.json"></a>

```json
{
  "[BucketArn](#cfn-amplifygen3-environment-wafs3config-bucketarn)" : {{String}},
  "[SamplingRate](#cfn-amplifygen3-environment-wafs3config-samplingrate)" : {{Integer}},
  "[Scope](#cfn-amplifygen3-environment-wafs3config-scope)" : {{String}},
  "[Status](#cfn-amplifygen3-environment-wafs3config-status)" : {{String}}
}
```

### YAML
<a name="aws-properties-amplifygen3-environment-wafs3config-syntax.yaml"></a>

```yaml
  [BucketArn](#cfn-amplifygen3-environment-wafs3config-bucketarn): {{String}}
  [SamplingRate](#cfn-amplifygen3-environment-wafs3config-samplingrate): {{Integer}}
  [Scope](#cfn-amplifygen3-environment-wafs3config-scope): {{String}}
  [Status](#cfn-amplifygen3-environment-wafs3config-status): {{String}}
```

## Properties
<a name="aws-properties-amplifygen3-environment-wafs3config-properties"></a>

`BucketArn`  <a name="cfn-amplifygen3-environment-wafs3config-bucketarn"></a>
The Amazon Resource Name (ARN) of the Amazon S3 bucket.  
The bucket must have a bucket policy that allows the `delivery.logs.amazonaws.com` service principal to write to it. Amplify Gen 3 doesn't add this policy. For more information about the policy, see [Logs sent to Amazon S3](https://docs.amazonaws.cn/AmazonCloudWatch/latest/logs/AWS-logs-infrastructure-V2-S3.html) in the *Amazon CloudWatch Logs User Guide*.  
*Required*: No  
*Type*: String  
*Pattern*: `^arn:(aws|aws-cn|aws-us-gov):s3:::[a-z0-9][a-z0-9.-]*$`  
*Minimum*: `1`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SamplingRate`  <a name="cfn-amplifygen3-environment-wafs3config-samplingrate"></a>
The percentage of requests to log.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Scope`  <a name="cfn-amplifygen3-environment-wafs3config-scope"></a>
The requests to log. Valid values:  
+ ALL\_REQUESTS: Logs every request that Amazon WAF evaluates.
+ BLOCKED\_ONLY: Logs only the requests that Amazon WAF blocks.
*Required*: No  
*Type*: String  
*Allowed values*: `ALL_REQUESTS | BLOCKED_ONLY`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Status`  <a name="cfn-amplifygen3-environment-wafs3config-status"></a>
Specifies whether Amazon WAF logs are delivered to Amazon S3.  
*Required*: Yes  
*Type*: String  
*Allowed values*: `ENABLED | DISABLED`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)