Skip to content

Commit

Permalink
[ETL-628] Rework S3 event config lambda (#108)
Browse files Browse the repository at this point in the history
* Delete preexisting S3 event notification before creation

* Rework s3_event_config lambda to index configs from s3 prefix/suffix

* Changes related to Prefix/prefix FilterRule discrepancy

There is a bug in moto/AWS where moto only allows filter rules with lowercase
`Name` values in put_bucket_notification_configuration calls. So to normalize
our notification configurations when comparing configurations obtained via a
GET with configurations to be utilized in a PUT (as we do in the function
`notification_configuration_matches`), we make the `Name` values lower case in
when comparing notification configurations.

When calling get_bucket_notification_configuration, the `Name` value is
always capitalized, whereas moto requires us to use lowercase `Name`
values when calling put_bucket_notification_configuration.

* Remove event notification for namespace upon branch deletion
  • Loading branch information
philerooski authored Mar 5, 2024
1 parent 058b077 commit 127c175
Show file tree
Hide file tree
Showing 3 changed files with 780 additions and 657 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
role_session_name: GitHubActions-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }}
python_version: 3.9

- name: Delete S3 event notification for this namespace
uses: gagoar/invoke-aws-lambda@v3
with:
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
REGION: ${{ env.AWS_REGION }}
FunctionName: ${{ github.event.ref }}-S3EventConfig
Payload: '{"RequestType": "Delete"}'
LogType: Tail

- name: Remove sceptre stacks
run: pipenv run sceptre --debug --var namespace=${{ github.event.ref }} delete develop/namespaced --yes

Expand Down
Loading

0 comments on commit 127c175

Please sign in to comment.