

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# S3
<a name="sam-property-function-s3"></a>

`S3` イベントソースタイプを説明するオブジェクトです。

## 構文
<a name="sam-property-function-s3-syntax"></a>

 AWS Serverless Application Model (AWS SAM) テンプレートでこのエンティティを宣言するには、次の構文を使用します。

### YAML
<a name="sam-property-function-s3-syntax.yaml"></a>

```
  [Bucket](#sam-function-s3-bucket): String
  [Events](#sam-function-s3-events): String | List
  [Filter](#sam-function-s3-filter): [NotificationFilter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html)
```

## プロパティ
<a name="sam-property-function-s3-properties"></a>

 `Bucket`   <a name="sam-function-s3-bucket"></a>
S3 バケット名です。このバケットは、同じテンプレートに存在する必要があります。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::S3::Bucket`リソースの `[BucketName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-name)`プロパティに似ています。これは SAM の必須フィールドです。このフィールドは、このテンプレートで作成された S3 バケットへのリファレンスのみを受け入れます。

 `Events`   <a name="sam-function-s3-events"></a>
Lambda 関数を呼び出す Amazon S3 バケットイベントです。有効な値のリストについては、Amazon S3 の「[サポートされるイベントタイプ](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#supported-notification-event-types)」を参照してください。  
*タイプ*: 文字列 \$1 リスト  
*必須:* はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::S3::Bucket` `LambdaConfiguration` データ型の `[Event](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-event)`プロパティに直接渡されます。

 `Filter`   <a name="sam-function-s3-filter"></a>
どの Amazon S3 オブジェクトが Lambda 関数を呼び出すかを決定するフィルタリングルールです。Amazon S3 キー名によるフィルタリングの詳細については、*Amazon Simple Storage Service ユーザーガイド*で [Amazon S3 イベント通知の設定](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html)を参照してください。  
*タイプ*: [NotificationFilter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::S3::Bucket` `LambdaConfiguration` データ型の `[Filter](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html)`プロパティに直接渡されます。

## 例
<a name="sam-property-function-s3--examples"></a>

### S3 イベント
<a name="sam-property-function-s3--examples--s3-event"></a>

S3 イベントの例です。

#### YAML
<a name="sam-property-function-s3--examples--s3-event--yaml"></a>

```
Events:
  S3Event:
    Type: S3
    Properties:
      Bucket:
        Ref: ImagesBucket     # This must be the name of an S3 bucket declared in the same template file
      Events: s3:ObjectCreated:*
      Filter:
        S3Key:
          Rules:
          - Name: prefix      # or "suffix"
            Value: value      # The value to search for in the S3 object key names
```