Secrets
Managing secrets is critical for application security.
The following functions are secure and allow you to re-use secrets across different Makes components.
secretsForAwsFromEnv
Load AWS secrets from environment variables.
Types:
- secretsForAwsFromEnv (
attrsOf awsFromEnvType
): Optional. Defaults to{ }
. - awsFromEnvType (
submodule
):- accessKeyId (
str
): Optional. Name of the environment variable that stores the value of the AWS Access Key Id. Defaults to"AWS_ACCESS_KEY_ID"
. - defaultRegion (
str
): Optional. Name of the environment variable that stores the value of the AWS Default Region. Defaults to"AWS_DEFAULT_REGION"
(Which defaults to"us-east-1"
). - secretAccessKey (
str
): Optional. Name of the environment variable that stores the value of the AWS Secret Access Key. Defaults to"AWS_SECRET_ACCESS_KEY"
. - sessionToken (
str
): Optional. Name of the environment variable that stores the value of the AWS Session Token. Defaults to"AWS_SESSION_TOKEN"
(Which defaults to""
).
- accessKeyId (
Always available outputs:
/secretsForAwsFromEnv/__default__
:- accessKeyId: "AWS_ACCESS_KEY_ID";
- defaultRegion: "AWS_DEFAULT_REGION";
- secretAccessKey: "AWS_SECRET_ACCESS_KEY";
- sessionToken: "AWS_SESSION_TOKEN";
Example:
secretsForAwsFromGitlab
Aquire an AWS session using GitLab CI OIDC.
Types:
- secretsForAwsFromGitlab (
attrsOf awsFromGitlabType
): Optional. Defaults to{ }
. - awsFromGitlabType (
submodule
):- roleArn (
str
): ARN of AWS role to be assumed. - duration (
ints.positive
): Optional. Duration in seconds of the session. Defaults to3600
. - retries (
ints.positive
): Optional. Number of login retries before failing. One retry per second. Defaults to15
.
- roleArn (
Example:
secretsForEnvFromSops
Export secrets from a Sops encrypted manifest to environment variables.
Types:
- secretsForEnvFromSops (
attrsOf secretForEnvFromSopsType
): Optional. Defaults to{ }
. - secretForEnvFromSopsType (
submodule
):- manifest (
str
): Relative path to the encrypted Sops file. - vars (
listOf str
): Names of the values to export out of the manifest.
- manifest (
Example:
secretsForGpgFromEnv
Load GPG public or private keys from environment variables into an ephemeral key-ring.
Each key content must be stored in a environment variable in ASCII Armor format.
Types:
- secretsForGpgFromEnv (
attrsOf (listOf str)
): Optional. Mapping of name to a list of environment variable names where the GPG key contents are stored. Defaults to{ }
.
Example:
secretsForKubernetesConfigFromAws
Create a Kubernetes config file out of an AWS EKS cluster and set it up in the KUBECONFIG Environment Variable.
Types:
- secretsForKubernetesConfigFromAws
(
attrsOf secretForKubernetesConfigFromAwsType
): Optional. Defaults to{ }
. - secretForKubernetesConfigFromAwsType (
submodule
):- cluster (
str
): AWS EKS Cluster name. - region (
str
): AWS Region the EKS cluster is located in.
- cluster (
Example:
secretsForTerraformFromEnv
Export secrets in a format suitable for Terraform from the given environment variables.
Types:
- secretsForTerraformFromEnv (
attrsOf (attrsOf str)
): Optional. Mapping of secrets group name to a mapping of Terraform variable names to environment variable names. Defaults to{ }
.
Example: