Class: RrxConfig::Sources::AwsSecretSource
- Defined in:
- lib/rrx_config/sources/aws_secret_source.rb
Defined Under Namespace
Classes: GetAwsSecretError
Constant Summary collapse
- SECRET_VARIABLE =
'RRX_AWS_CONFIG_SECRET_NAME'
Instance Method Summary collapse
-
#delete ⇒ Object
Test helper.
- #read ⇒ Object
-
#write(value) ⇒ Object
Test helper.
Instance Method Details
#delete ⇒ Object
Test helper
35 36 37 38 39 40 |
# File 'lib/rrx_config/sources/aws_secret_source.rb', line 35 def delete raise NotImplementedError unless Rails.env.test? RrxConfig.info "Deleting secret #{secret_id}" client.delete_secret({ secret_id:, force_delete_without_recovery: true }) rescue nil end |
#read ⇒ Object
14 15 16 |
# File 'lib/rrx_config/sources/aws_secret_source.rb', line 14 def read read_secret if secret_id end |
#write(value) ⇒ Object
Test helper
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rrx_config/sources/aws_secret_source.rb', line 20 def write(value) raise NotImplementedError unless Rails.env.test? RrxConfig.info "Writing secret #{secret_id}" result = client.create_secret({ name: secret_id, secret_string: value, force_overwrite_replica_secret: true, description: 'Integration test' }) RrxConfig.info "Secret created: #{result.arn}" end |