Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix store ADF config before it needs to be read the first time #548

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ def main(): # pylint: disable=R0915

policies = OrganizationPolicy()
config = Config()
config.store_config()

try:
parameter_store = ParameterStore(REGION_DEFAULT, boto3)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0

"""
Store config entry point for storing the adfconfig.yml configuration
into the Parameter Store such that the bootstrapping and account management
steps can execute correctly when triggered.

This gets executed from within AWS CodeBuild in the management account.
"""
import os
from config import Config
from logger import configure_logger

ADF_VERSION = os.environ["ADF_VERSION"]
ADF_LOG_LEVEL = os.environ["ADF_LOG_LEVEL"]
LOGGER = configure_logger(__name__)


def main():
"""
Main entry point to store the configuration into AWS Systems
Manager Parameter Store
"""
LOGGER.info("ADF Version %s", ADF_VERSION)
LOGGER.info("ADF Log Level is %s", ADF_LOG_LEVEL)

LOGGER.info(
"Storing configuration values in AWS Systems Manager Parameter Store."
)
config = Config()
config.store_config()
LOGGER.info("Configuration values stored successfully.")


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions src/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,7 @@ Resources:
- >-
sam package --output-template-file adf-bootstrap/deployment/global.yml
--s3-prefix adf-bootstrap/deployment --s3-bucket $DEPLOYMENT_ACCOUNT_BUCKET
- python adf-build/store_config.py
# Shared Modules to be used with AWS CodeBuild:
- aws s3 sync ./adf-build/shared s3://$DEPLOYMENT_ACCOUNT_BUCKET/adf-build --quiet
# Base templates:
Expand Down