Class: TerraspacePluginAws::Interfaces::Helper::SSM
- Inherits:
-
SecretBase
- Object
- SecretBase
- TerraspacePluginAws::Interfaces::Helper::SSM
- Extended by:
- Memoist
- Includes:
- Terraspace::Compiler::Dsl::Syntax::Mod::Backend
- Defined in:
- lib/terraspace_plugin_aws/interfaces/helper/ssm.rb
Instance Method Summary collapse
Methods inherited from SecretBase
Methods included from Logging
Methods included from Clients
#dynamodb, #s3, #secretsmanager, #ssm, #sts
Constructor Details
This class inherits a constructor from TerraspacePluginAws::Interfaces::Helper::SecretBase
Instance Method Details
#fetch(name) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/terraspace_plugin_aws/interfaces/helper/ssm.rb', line 6 def fetch(name) name = expansion(name) if value = fetch_value(name) value = Base64.strict_encode64(value).strip if @base64 value end |
#fetch_value(name) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/terraspace_plugin_aws/interfaces/helper/ssm.rb', line 13 def fetch_value(name) resp = ssm.get_parameter(name: name, with_decryption: true) resp.parameter.value rescue Aws::SSM::Errors::ParameterNotFound => e logger.info "WARN: name #{name} not found".color(:yellow) logger.info e. "NOT FOUND #{name}" # simple string so tfvars valid rescue Aws::SSM::Errors::ValidationException => e logger.info "WARN: name #{name} not found".color(:yellow) logger.info e. "INVALID NAME #{name}" # simple string so tfvars valid end |