hinnerk / cftpl

Templates and Management for AWS CloudFormation
12 stars 6 forks source link

Reference CF generated resource names from FILES? #8

Open bedge opened 9 years ago

bedge commented 9 years ago

I'd like to use an awslogs.conf file in the FILES section to avoid the dreaded

    Fn::Join:
                  - ""
                  -

However, this file needs a reference to a CF instantiated element. The final file looks like:

file = /var/log/cfn-hup.log
log_group_name = bedge-qc-04-cb-controller-Logs-10LPTL6WFV1NE
log_stream_name = {instance_id}/cfn-hup.log
datetime_format =

where bedge-qc-04-cb-controller-Logs-10LPTL6WFV1NE is a CF generated reference from the string "Logs" in the actual yaml.

I'm currently using this in the yaml:

                    - "log_group_name = "
                    -
                      Ref: "Logs"
                    - "\n"

Is there a syntax that expands to a CF generated reference that one can use in the config.py FILES={} files?

IOW, if I provide the file:

file = /var/log/cfn-hup.log
log_group_name = <what do I stick here to designate a CF Ref>
log_stream_name = {instance_id}/cfn-hup.log
datetime_format =

What do I use for the Ref bit so that it's expanded correctly?

Do I have to use

file = /var/log/cfn-hup.log
log_group_name = 
                      Ref: "Logs"
                    - "\n"
log_stream_name = {instance_id}/cfn-hup.log
datetime_format =

or some other variation?