-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cloudfront and certificate manager * added list layers * refactored common code * fixed LastEvaluatedKey bug * added api endpoints * added aws-requests-auth * invalidate cache * updated diagram
- Loading branch information
1 parent
0fbd578
commit e9eea66
Showing
54 changed files
with
1,008 additions
and
5,438 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
35 changes: 35 additions & 0 deletions
35
pipeline/Serverless/01_invoke_pipelines/invalidate_cf_cache.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import boto3 | ||
import os | ||
import uuid | ||
|
||
from lambda_cache import ssm | ||
|
||
from aws_lambda_powertools.logging import Logger | ||
|
||
logger = Logger() | ||
|
||
|
||
@logger.inject_lambda_context | ||
@ssm.cache(parameter=os.environ["DISTRIBUTION_NAME"]) | ||
def main(event, context): | ||
distribution_id = getattr(context, "id") | ||
CallerReference = str(uuid.uuid4()) | ||
|
||
client = boto3.client("cloudfront") | ||
response = client.create_invalidation( | ||
DistributionId=distribution_id, | ||
InvalidationBatch={ | ||
"Paths": {"Quantity": 1, "Items": ["/api/v1/*",]}, | ||
"CallerReference": CallerReference, | ||
}, | ||
) | ||
|
||
logger.info( | ||
{ | ||
"CallerReference": CallerReference, | ||
"message": f"Invalidated Cache for {distribution_id}", | ||
"invalidation_location": response["Location"], | ||
} | ||
) | ||
|
||
return response["Location"] |
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
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
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
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
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
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
File renamed without changes.
Oops, something went wrong.