Skip to content

Instantly share code, notes, and snippets.

View yadachi's full-sized avatar

Yosuke Adachi yadachi

View GitHub Profile

Keybase proof

I hereby claim:

  • I am yadachi on github.
  • I am yadachi (https://keybase.io/yadachi) on keybase.
  • I have a public key ASD-UMHE472r8SL5UYqV_CPiQbhDCMW2WIBQpsocwlgHJQo

To claim this, I am signing this object:

@yadachi
yadachi / hiera.yaml
Created January 25, 2019 22:37
hiera.yaml settings for cloudformation_lookup_key
- name: "cloudformaiton backend per project stack"
lookup_key: cloudformation_lookup_key # custom cloudformation backend
uris:
- "cfstack/%{facts.project}%{facts.environment}%{facts.network}/outputs"
# eg. ProjectnameProductionNetwork in cloudformation stack name
- "cfstack/%{facts.project}%{facts.environment}/outputs"
# eg. someprojectuat cloudforamtion stack name
options:
region: "%{facts.region}" #set aws region here
@yadachi
yadachi / cloudformation_lookup_key.rb
Created January 24, 2019 23:59
puppet hiera custom backend for cloudformation
Puppet::Functions.create_function(:cloudformation_lookup_key) do
require 'aws-sdk-cloudformation'
require 'aws-sdk-core'
dispatch :cloudformation_lookup_key do
param 'String[1]', :key
param 'Hash', :options
param 'Puppet::LookupContext', :context
end