Module erlcloud_sm

Data Types

create_secret_option()

create_secret_option() = {add_replica_regions, replica_regions()} | {client_request_token, binary()} | {description, binary()} | {force_overwrite_replica_secret, boolean()} | {kms_key_id, binary()} | {secret_binary, binary()} | {secret_string, binary()} | {tags, proplist()}

create_secret_options()

create_secret_options() = [create_secret_option()]

delete_secret_option()

delete_secret_option() = {force_delete_without_recovery, boolean()} | {recovery_window_in_days, pos_integer()}

If none of these two options are specified then SM defaults to 30 day recovery window

delete_secret_options()

delete_secret_options() = [delete_secret_option()]

get_secret_value_option()

get_secret_value_option() = {version_id | version_stage, binary()}

get_secret_value_options()

get_secret_value_options() = [get_secret_value_option()]

put_resource_policy_option()

put_resource_policy_option() = {block_public_policy, boolean()}

put_resource_policy_options()

put_resource_policy_options() = [put_resource_policy_option()]

put_secret_value_option()

put_secret_value_option() = {client_request_token, binary()} | {secret_binary, binary()} | {secret_string, binary()} | {version_stages, [binary()]}

put_secret_value_options()

put_secret_value_options() = [put_secret_value_option()]

replica_region()

replica_region() = [proplist()]

replica_regions()

replica_regions() = [replica_region()]

sm_response()

sm_response() = {ok, proplists:proplist()} | {error, term()}

Function Index

create_secret_binary/3 Creates a new secret binary.
create_secret_binary/4
create_secret_binary/5
create_secret_string/3 Creates a new secret string.
create_secret_string/4
create_secret_string/5
delete_resource_policy/1 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteResourcePolicy.html
delete_resource_policy/2
delete_secret/1 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html
delete_secret/2
delete_secret/3
describe_secret/1 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DescibeSecret.html
describe_secret/2
get_resource_policy/1 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetResourcePolicy.html
get_resource_policy/2
get_secret_value/2 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html
get_secret_value/3
new/2
new/3
new/4
put_resource_policy/2 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_PutResourcePolicy.html
put_resource_policy/3
put_resource_policy/4
put_secret_binary/3
put_secret_binary/4
put_secret_binary/5
put_secret_string/3 SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_PutSecretValue.html
put_secret_string/4
put_secret_string/5

Function Details

create_secret_binary/3

create_secret_binary(Name::binary(), ClientRequestToken::binary(), SecretBinary::binary()) -> sm_response()

Creates a new secret binary. The function internally base64-encodes the binary as it is expected by the AWS SecretManager API, so raw blob is expected to be passed as an attribute.

ClientRequestToken is used by AWS for secret versioning purposes. It is recommended to be a UUID type value, and is requred to be between 32 and 64 characters.

To store a text secret use CreateSecret - SecretString version of the function instead.

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_CreateSecret.html

Example: Name = <<"my-secret-binary">>, ClientRequestToken = <<"7537a353-0de0-4b98-bf55-f8365821ed36">>, %% some binary to store (say, an RSA private key's exponent) {[_E, _Pub], [_E, _N, Priv, _P1, _P2, _E1, _E2, _C]} = crypto:generate_key(rsa, {2048,65537}), erlcloud_sm:create_secret_binary(Name, ClientRequestToken, Priv).

create_secret_binary/4

create_secret_binary(Name::binary(), ClientRequestToken::binary(), SecretBinary::binary(), Opts::create_secret_options()) -> sm_response()

create_secret_binary/5

create_secret_binary(Name::binary(), ClientRequestToken::binary(), SecretBinary::binary(), Opts::create_secret_options(), Config::aws_config()) -> sm_response()

create_secret_string/3

create_secret_string(Name::binary(), ClientRequestToken::binary(), SecretString::binary()) -> sm_response()

Creates a new secret string. The API expects SecretString is a text data to encrypt and store in the SecretManager. It is recommended a JSON structure of key/value pairs is used for the secret value.

ClientRequestToken is used by AWS for secret versioning purposes. It is recommended to be a UUID type value, and is requred to be between 32 and 64 characters.

To store a binary (which will be base64 encoded by the library, as it is expected by AWS SecretManager API), use CreateSecret - SecretBinary version of the function.

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_CreateSecret.html

Example: Name = <<"my-secret-string">>, ClientRequestToken = <<"7537a353-0de0-4b98-bf55-f8365821ed37">>, %% some user/password json to store Secret = jsx:encode(#{<<"user">> => <<"my-user">>, <<"password">> => <<"superSecretPassword">>}), erlcloud_sm:create_secret_string(Name, ClientRequestToken, Secret).

create_secret_string/4

create_secret_string(Name::binary(), ClientRequestToken::binary(), SecretString::binary(), Opts::create_secret_options()) -> sm_response()

create_secret_string/5

create_secret_string(Name::binary(), ClientRequestToken::binary(), SecretString::binary(), Opts::create_secret_options(), Config::aws_config()) -> sm_response()

delete_resource_policy/1

delete_resource_policy(SecretId::binary()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteResourcePolicy.html

delete_resource_policy/2

delete_resource_policy(SecretId::binary(), Config::aws_config()) -> sm_response()

delete_secret/1

delete_secret(SecretId::binary()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html

delete_secret/2

delete_secret(SecretId::binary(), Opts::delete_secret_options()) -> sm_response()

delete_secret/3

delete_secret(SecretId::binary(), Opts::delete_secret_options(), Config::aws_config()) -> sm_response()

describe_secret/1

describe_secret(SecretId::binary()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DescibeSecret.html

describe_secret/2

describe_secret(SecretId::binary(), Config::aws_config()) -> sm_response()

get_resource_policy/1

get_resource_policy(SecretId::binary()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetResourcePolicy.html

get_resource_policy/2

get_resource_policy(SecretId::binary(), Config::aws_config()) -> sm_response()

get_secret_value/2

get_secret_value(SecretId::binary(), Opts::get_secret_value_options()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html

get_secret_value/3

get_secret_value(SecretId::binary(), Opts::get_secret_value_options(), Config::aws_config()) -> sm_response()

new/2

new(AccessKeyID::string(), SecretAccessKey::string()) -> aws_config()

new/3

new(AccessKeyID::string(), SecretAccessKey::string(), Host::string()) -> aws_config()

new/4

new(AccessKeyID::string(), SecretAccessKey::string(), Host::string(), Port::non_neg_integer()) -> aws_config()

put_resource_policy/2

put_resource_policy(SecretId::binary(), ResourcePolicy::binary()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_PutResourcePolicy.html

put_resource_policy/3

put_resource_policy(SecretId::binary(), ResourcePolicy::binary(), Opts::put_resource_policy_options()) -> sm_response()

put_resource_policy/4

put_resource_policy(SecretId::binary(), ResourcePolicy::binary(), Opts::put_resource_policy_options(), Config::aws_config()) -> sm_response()

put_secret_binary/3

put_secret_binary(SecretId::binary(), ClientRequestToken::binary(), SecretBinary::binary()) -> sm_response()

put_secret_binary/4

put_secret_binary(SecretId::binary(), ClientRequestToken::binary(), SecretBinary::binary(), Opts::put_secret_value_options()) -> sm_response()

put_secret_binary/5

put_secret_binary(SecretId::binary(), ClientRequestToken::binary(), SecretBinary::binary(), Opts::put_secret_value_options(), Config::aws_config()) -> sm_response()

put_secret_string/3

put_secret_string(SecretId::binary(), ClientRequestToken::binary(), SecretString::binary()) -> sm_response()

SM API: https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_PutSecretValue.html

put_secret_string/4

put_secret_string(SecretId::binary(), ClientRequestToken::binary(), SecretString::binary(), Opts::put_secret_value_options()) -> sm_response()

put_secret_string/5

put_secret_string(SecretId::binary(), ClientRequestToken::binary(), SecretString::binary(), Opts::put_secret_value_options(), Config::aws_config()) -> sm_response()


Generated by EDoc