Sha256: b0012f081047445fe7a3b4dbdd06f1dcde8486e4fcb09adc2de3ceffaa918710
Contents?: true
Size: 996 Bytes
Versions: 2
Compression:
Stored size: 996 Bytes
Contents
# frozen_string_literal: true class Cryptoform::ConfigGenerator def initialize(name:, port:, storage_backend:, encryption_backend:) @name = name @port = port @storage_backend = storage_backend @encryption_backend = encryption_backend end def generate_cryptofile <<~RUBY # frozen_string_literal: true port #{@port} state :#{@name} do storage_backend :#{@storage_backend} encryption_backend :#{@encryption_backend}, key: -> { ENV.fetch("CRYPTOFORM_KEY") } end RUBY end def generate_terraform_backend <<~HCL terraform { backend "http" { address = "http://127.0.0.1:#{@port}/states/#{@name}" } } HCL end def generate_terraform_remote_state_data_source <<~HCL data "terraform_remote_state" "#{@name}_remote_state" { backend = "http" config = { address = "http://127.0.0.1:#{@port}/states/#{@name}" } } HCL end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cryptoform-0.5.1 | lib/cryptoform/config_generator.rb |
cryptoform-0.5.0 | lib/cryptoform/config_generator.rb |