コード例 #1
0
def _add_profile_config(option_file: configparser, profile: str,
                        region: str) -> None:
    config_name = f'profile {profile}'
    if not option_file.has_section(config_name):
        option_file.add_section(config_name)
    option_file.set(config_name, 'region', region)
    option_file.set(config_name, 'output', 'json')
コード例 #2
0
def _add_profile_credentials(credentials_file: configparser, profile: str,
                             secrets: dict) -> None:
    if not credentials_file.has_section(profile):
        credentials_file.add_section(profile)
    credentials_file.set(profile, 'aws_access_key_id',
                         str(secrets['AccessKeyId']))
    credentials_file.set(profile, 'aws_secret_access_key',
                         str(secrets['SecretAccessKey']))
    credentials_file.set(profile, 'aws_session_token',
                         str(secrets['SessionToken']))