This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from functools import cache | |
import os | |
import sys | |
from typing import Literal | |
import json | |
import click | |
import boto3 | |
from rich.console import Console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Working example of a Glue Catalog Data Table for CloudTrail logs that can be used with Athena | |
CloudTrailGlueTable: | |
Type: AWS::Glue::Table | |
Properties: | |
CatalogId: !Ref AWS::AccountId | |
DatabaseName: !Ref CloudTrailDatabase | |
TableInput: | |
Name: !Sub "${resourcePrefix}_org_cloudtrail" | |
PartitionKeys: | |
- Name: account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ _ _ _ _ _ _ | |
| _| _||_||_ |_ ||_||_| | |
||_ _| | _||_| ||_| _| | |
_ _ _ _ _ _ _ | |
| | _| _||_| ||_ ||_||_| | |
|_||_ _| | ||_| ||_| _| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bucketAccessPoint: | |
Type: AWS::S3::AccessPoint | |
Properties: | |
Bucket: !Ref bucket | |
Name: ${self:service}-${self:provider.stage}-ap | |
lambdaAccessPoint: | |
Type: AWS::S3ObjectLambda::AccessPoint | |
Properties: | |
Name: ${self:service}-${self:provider.stage}-lambda-ap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Effect: Allow | |
Action: | |
- s3-object-lambda:WriteGetObjectResponse | |
Resource: '*' | |
- Effect: Allow | |
Action: | |
- s3:GetObject | |
- s3:ListBucket | |
Resource: | |
- !GetAtt bucket.Arn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj_get_ctx = event['getObjectContext'] | |
request_route = obj_get_ctx['outputRoute'] | |
request_token = obj_get_ctx['outputToken'] | |
obj_url = obj_get_ctx['inputS3Url'] | |
requested_url = event['userRequest']['url'] | |
path = Path(urlparse(requested_url).path).relative_to('/') | |
# First attempt to read directly using the signed URL provided | |
response = requests.get(obj_url) | |
resp = {'StatusCode': response.status_code} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NotificationFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
CodeUri: handlers/ | |
Handler: notification.handleS3Notification | |
Runtime: nodejs12.x | |
Policies: | |
- Version: '2012-10-17' | |
Statement: | |
- Effect: Allow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiCustomDomain: | |
Type: AWS::ApiGateway::DomainName | |
Properties: | |
CertificateArn: ${self:custom.apiConfig.apiCert} | |
DomainName: api.sliclists.com | |
apiCustomDomainPathMappings: | |
Type: AWS::ApiGateway::BasePathMapping | |
Properties: | |
BasePath: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get: | |
handler: services/checklists/get.main | |
events: | |
- http: | |
path: /{id} | |
method: get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ _ _ _ _ _ _ | |
| _| _||_||_ |_ ||_||_| | |
||_ _| | _||_| ||_| _| | |
_ _ _ _ _ _ _ | |
| | _| _||_| ||_ ||_||_| | |
|_||_ _| | ||_| ||_| _| | |
NewerOlder