-
-
Save KyMidd/9b467a9a989421ce2ea68816792410f6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Create secrets directory | |
| directory="/tmp/init-secrets" | |
| try: | |
| print("Creating location for secrets") | |
| os.mkdir(directory) | |
| except OSError as error: | |
| #print(error) | |
| pass | |
| # Find secret values | |
| for secret_name in found_secrets: | |
| secretValue=get_secret_value(secret_name, SecretRegion) | |
| try: | |
| # Create a file if not exist and write to it | |
| fileName="/tmp/init-secrets/{}".format(secret_name) | |
| #print("Attempting to stage secret", secret_name, "at", fileName) | |
| file = open(fileName, "w") | |
| file.write(secretValue) | |
| print("Staged", secret_name, "at", fileName) | |
| except Exception as error: | |
| print(error) | |
| print("Error staging secrets, please investigate") | |
| print(os.listdir("/tmp/init-secrets")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment