Skip to content

Instantly share code, notes, and snippets.

@gswallow
Last active August 29, 2015 14:14
Show Gist options
  • Save gswallow/cdcaaf6f240dd0fd4361 to your computer and use it in GitHub Desktop.
Save gswallow/cdcaaf6f240dd0fd4361 to your computer and use it in GitHub Desktop.
# TODO: figure out how to refer to the nat instance when creating
# the elastic ip
dynamic!(:nat_instance, 'indigo', :nat_instance_type => ref!(:nat_instance_type), :ssh_key_name => ref!(:ssh_key_name))
dynamic!(:elastic_ip, 'indigo_nat', :instance => ref!(:indigo_nat_instance))
mappings.nat_ami_64 do
set!('us-east-1', :ami => 'ami-184dc970') # amzn-ami-vpc-nat-hvm-2014.09.1.x86_64-gp2
set!('us-west-1', :ami => 'ami-a98396ec')
set!('us-west-2', :ami => 'ami-290f4119')
end
resources("#{_name}_elastic_ip_association".to_sym) do
type 'AWS::EC2::EIPAssociation'
properties do
#allocation_id attr!("#{_name}_nat_instance_elastic_ip".to_sym, :allocation_id)
e_i_p ref!("#{_name}_elastic_ip".to_sym) # lol
instance_id _config[:instance]
end
end
becomes...
"IndigoNatElasticIpAssociation": {
"Type": "AWS::EC2::EIPAssociation",
"Properties": {
"EIP": {
"Ref": "IndigoNatElasticIp"
},
"InstanceId": {
"Ref": "IndigoNatInstance"
}
}
}
Note that "e_i_p" becomes "EIP." Otherwise, the "Eip" property is unknown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment