env_var#

Manage environment variables, and provide utility method to consume them.

aws_ops_alpha.env_var.get_environment_aws_account_id_in_ci(env_name: str, suffix: Optional[str] = None) str[source]#

Assuming that this code is running in a CI runtime, get the AWS environment specific account id. We assume that your store them in environment variables like DEVOPS_AWS_ACCOUNT_ID, SBX_AWS_ACCOUNT_ID, etc …

For example, you stored your DevOps aws account id in DEVOPS_AWS_ACCOUNT_ID, then you can use get_environment_aws_account_id_in_ci("DEVOPS") to get the value. If you stored your aws account id in DEVOPS_AWS_ACCOUNT_ID_MY_ORG, then you can use get_environment_aws_account_id_in_ci("DEVOPS", suffix="MY_ORG") to get the value.

aws_ops_alpha.env_var.get_environment_iam_role_arn_in_dev_server(env_name: str, suffix: Optional[str] = None) str[source]#

Assuming that this code is running in a development server runtime, like AWS Cloud9, EC2 instance, get the AWS environment specific IAM role ARN to assume. We assume that your store them in environment variables like DEVOPS_IAM_ROLE_ARN, SBX_IAM_ROLE_ARN.

Usage example is similar to get_environment_aws_account_id_in_ci().