Skip to content

hixi-hyi/aws-cloudformation-lambda-s3-bucket-notification-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cfn-lambda-s3-bucket-notification-configuration

Description

The cfn-lambda-s3-bucket-notification-configuration function is CloudFormation Custom Lambda that support of create s3 bucket notification configuration

See also official documentation.

When do you use it

  • Declare notifications independently of AWS::S3::Bucket

Caution

The function replace all notifications if you created it. You must be created notifications with this resource(function) only.

Deploy

See here

Usage

  S3Bucket:
    Type: AWS::S3::Bucket
  S3BucketPolicy:
    Type: AWS::S3::BucketPolicy
    Properties:
      Bucket: !Ref S3Bucket
      PolicyDocument:
        Statement:
          - Action:
              - "s3:PutBucketNotification"
            Effect: "Allow"
            Resource: !GetAtt S3Bucket.Arn
            Principal:
              AWS: !ImportValue cfn-lambda-s3-bucket-notification-configuration:LambdaRoleArn
  S3BucketNofiticationConfiguration:
    Type: Custom::Lambda
    DependsOn: S3BucketPolicy
    Properties:
      ServiceToken: !ImportValue cfn-lambda-s3-bucket-notification-configuration:LambdaArn
      Bucket: !Ref S3Bucket
      NotificationConfiguration:
        LambdaFunctionConfigurations:
          - Events:
              - s3:ObjectCreated:*
            LambdaFunctionArn: !GetAtt LambdaFunction.Arn
      DeployAlways: !Ref Date
      Policies:
        Deletion:
          - IgnoreError

Parameters

The function implements s3api put-bucket-notification-configuration

Bucket

  • BucketName
  • Required: Yes
  • Update requires: Replacement

NotificationConfiguration

  • Docs
  • Required: Yes
  • Update requires: No interruption

Policies.Deletion (optional)

  • Support values are IgnoreError and Retain.
    • IgnoreError
  • Required: No
  • Update requires: No interruption

Contributing

See here

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages