Skip to content

Referencing variable from a file in a template #169

Answered by hmeltaus
alexlykasov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, you don't have Resources block in your template. Did you intentionally leave it out from the snippet?

I was able to make it work using this template file:

Resources:
  {{#each var.buckets}}
  Bucket{{bucketName}}:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: {{bucketName}}
      LifecycleConfiguration:
        Rules:
          - ExpirationInDays: {{expirationDays}}
            Status: Enabled
  {{/each}}

You can also adjust the logging level with --log debug or --log trace options to get more information on what actually happens. When using the trace logging level you can see the rendered template files which might help to spot the error.

What Takomo version you are us…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@alexlykasov
Comment options

@hmeltaus
Comment options

Answer selected by hmeltaus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants