azure_ad_login/create_azure_client_secret.py
def store_secrets_manager_secret(*, secret_id, secret_value, role_arn):
    """
    Stores a new client secret in Secrets Manager.
    """
    secrets_client = get_aws_client("secretsmanager", role_arn=role_arn)

    try:
        resp = secrets_client.create_secret(Name=secret_id, SecretString=secret_value,)
    except ClientError as err:
        if err.response["Error"]["Code"] == "ResourceExistsException":
            resp = secrets_client.put_secret_value(
                SecretId=secret_id, SecretString=secret_value
            )

            if resp["ResponseMetadata"]["HTTPStatusCode"] != 200:
                raise RuntimeError(f"Unexpected error from PutSecretValue: {resp}")
        else:
            raise
    else:
        if resp["ResponseMetadata"]["HTTPStatusCode"] != 200:
            raise RuntimeError(f"Unexpected error from CreateSecret: {resp}")

    Stores a new client secret in Secrets Manager.
    
Stores a new client secret in Secrets Manager.
Stores a new client secret in Secrets Manager .
def store_secrets_manager_secret(*, secret_id, secret_value, role_arn):
    secrets_client = get_aws_client("secretsmanager", role_arn=role_arn)
    try:
        resp = secrets_client.create_secret(Name=secret_id, SecretString=secret_value,)
    except ClientError as err:
        if err.response["Error"]["Code"] == "ResourceExistsException":
            resp = secrets_client.put_secret_value(
                SecretId=secret_id, SecretString=secret_value
            )
            if resp["ResponseMetadata"]["HTTPStatusCode"] != 200:
                raise RuntimeError(f"Unexpected error from PutSecretValue: {resp}")
        else:
            raise
    else:
        if resp["ResponseMetadata"]["HTTPStatusCode"] != 200:
            raise RuntimeError(f"Unexpected error from CreateSecret: {resp}")
def store_secrets_manager_secret ( * , secret_id , secret_value , role_arn ) : secrets_client = get_aws_client ( "secretsmanager" , role_arn = role_arn ) try : resp = secrets_client . create_secret ( Name = secret_id , SecretString = secret_value , ) except ClientError as err : if err . response [ "Error" ] [ "Code" ] == "ResourceExistsException" : resp = secrets_client . put_secret_value ( SecretId = secret_id , SecretString = secret_value ) if resp [ "ResponseMetadata" ] [ "HTTPStatusCode" ] != 200 : raise RuntimeError ( f"Unexpected error from PutSecretValue: {resp}" ) else : raise else : if resp [ "ResponseMetadata" ] [ "HTTPStatusCode" ] != 200 : raise RuntimeError ( f"Unexpected error from CreateSecret: {resp}" )
Stores a new client secret in Secrets Manager.
Stores a new client secret in Secrets Manager .
"""
    Stores a new client secret in Secrets Manager.
    """
secret_id
secret_value
role_arn