-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimising S3 Parameter usage to reduce calls to S3
- Loading branch information
1 parent
d30e678
commit a6dd61b
Showing
13 changed files
with
109 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sphinx==2.0.0 | ||
recommonmark==0.5.0 | ||
setuptools==65.5.1 | ||
setuptools==70.0.0 | ||
aws-service-catalog-puppet |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import json | ||
from copy import deepcopy | ||
|
||
import jmespath | ||
import luigi | ||
|
||
from servicecatalog_puppet import constants | ||
from servicecatalog_puppet.workflow.dependencies import tasks | ||
|
||
|
||
class GetS3ObjectTask(tasks.TaskWithReference): | ||
account_id = luigi.Parameter() | ||
key = luigi.Parameter() | ||
region = luigi.Parameter() | ||
cachable_level = constants.CACHE_LEVEL_RUN | ||
|
||
def params_for_results_display(self): | ||
return { | ||
"task_reference": self.task_reference, | ||
"account_id": self.account_id, | ||
"region": self.region, | ||
"key": self.key, | ||
} | ||
|
||
def run(self): | ||
with self.spoke_regional_client("s3") as s3: | ||
object = ( | ||
s3.get_object( | ||
Bucket=f"sc-puppet-parameters-{self.account_id}", Key=self.key | ||
) | ||
.get("Body") | ||
.read() | ||
) | ||
self.write_output(object, skip_json_encode=True) |
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