aws / aws/ec2-image-builder-roadmap
Ability to escape instances of double curly braces in file content
- Dominant language
- No language data
- Stars
- 35
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
Many languages and programs use the double curly braces syntax to denote variables, and there is no way to place files for these other languages (e.g., I can't run `docker ps --filter {{ .ID }}`) using AWSTOE and Image Builder right now, because there is no documented way to escape a curly brace.
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
I saw the response by @austoonz in #76 but I think he misinterpreted the request and closed that ticket prematurely.
```
name: ConfigureBashRC
description: Configure .bashrc and some user utilities.
schemaVersion: 1.0
phases:
- name: build
steps:
- name: AppendToProfile
action: AppendFile
inputs:
- path: /etc/profile
content: |
alias ll='ls -lah'
alias dexecjob1='docker exec -it -u ec2-user \`docker ps --filter "name=job1-prod" --format "{{ .ID }}" | head -n 1\` bash';
```
The important part here is that I want the content of the file ***rendered exactly like that*** - I **DO NOT** want AWSTOE to try to render an internal constant or parameter with the name .ID
This would work great if I could escape variables or pass a parameter as an input to not try to render variables in the content. Again, I specifically want `{{ .ID }}` to get appended to the path in the inputs and do not want it to get substituted.
**Are you currently working around this issue?**
Frankly, really stupid things. I'm writing the file to /tmp, and using `sed` on it twice to add two sets of curly braces. Something else that works is creating a constant with a set of curly braces.
Contributor guide
Research direction
The issue does not name repository files, tests, or an implementation entry point. Start by locating the AWSTOE content templating and rendering path, then determine how literal double curly braces should be represented. Done means file content preserves `{{ .ID }}` exactly without substituting it as a parameter or constant.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, bash, docker
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100