Terraform Escape Single Quotes Announcing the arrival of Valued Associate #679: Cesar Manara ...

List *all* the tuples!

What exactly is a "Meth" in Altered Carbon?

Why is "Consequences inflicted." not a sentence?

Why do we bend a book to keep it straight?

How do I stop a creek from eroding my steep embankment?

Can a USB port passively 'listen only'?

How to answer "Have you ever been terminated?"

Can I cast Passwall to drop an enemy into a 20-foot pit?

What is the role of the transistor and diode in a soft start circuit?

Single word antonym of "flightless"

What causes the vertical darker bands in my photo?

Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?

Why was the term "discrete" used in discrete logarithm?

Why are Kinder Surprise Eggs illegal in the USA?

What does the word "veer" mean here?

Should I use a zero-interest credit card for a large one-time purchase?

How to find out what spells would be useless to a blind NPC spellcaster?

What is the meaning of the new sigil in Game of Thrones Season 8 intro?

How to call a function with default parameter through a pointer to function that is the return of another function?

What does this icon in iOS Stardew Valley mean?

How can I make names more distinctive without making them longer?

Generate an RGB colour grid

How to react to hostile behavior from a senior developer?

Selecting the same column from Different rows Based on Different Criteria



Terraform Escape Single Quotes



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!Terraform dependency on templateTerraform parallel VM creationTerraform dynamic variableCreate multiple resources terraformterraform ddns reverse zone creationInformation to redact from Terraform debug logs?Terraform - Adding a new resource instance and resoring terraform stateTerraform multiple environments on awsterraform escape percentual characterterraform could not escape single quote





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I am trying to escape single quotes in my terraform script and inventory file.



Terraform script line:



list_compute= "${join("n",formatlist("%s openshift_node_labels="{'region': 'primary', 'zone': 'east'}"", "${module.compute.ops_compute_names}"))}"


How do I preserve/escape the single quote around region, primary, zone and east?



Also my template file which is used for rendering:



openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]


How do I preserve/escape the single quotes.










share|improve this question














bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    0















    I am trying to escape single quotes in my terraform script and inventory file.



    Terraform script line:



    list_compute= "${join("n",formatlist("%s openshift_node_labels="{'region': 'primary', 'zone': 'east'}"", "${module.compute.ops_compute_names}"))}"


    How do I preserve/escape the single quote around region, primary, zone and east?



    Also my template file which is used for rendering:



    openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]


    How do I preserve/escape the single quotes.










    share|improve this question














    bumped to the homepage by Community 2 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I am trying to escape single quotes in my terraform script and inventory file.



      Terraform script line:



      list_compute= "${join("n",formatlist("%s openshift_node_labels="{'region': 'primary', 'zone': 'east'}"", "${module.compute.ops_compute_names}"))}"


      How do I preserve/escape the single quote around region, primary, zone and east?



      Also my template file which is used for rendering:



      openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]


      How do I preserve/escape the single quotes.










      share|improve this question














      I am trying to escape single quotes in my terraform script and inventory file.



      Terraform script line:



      list_compute= "${join("n",formatlist("%s openshift_node_labels="{'region': 'primary', 'zone': 'east'}"", "${module.compute.ops_compute_names}"))}"


      How do I preserve/escape the single quote around region, primary, zone and east?



      Also my template file which is used for rendering:



      openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]


      How do I preserve/escape the single quotes.







      terraform






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 17 '18 at 8:53









      Adigun GbengaAdigun Gbenga

      1




      1





      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          This should work



          join("n",formatlist("%s openshift_node_labels={'region': 'primary', 'zone': 'east'}", "${module.compute.ops_compute_names}"))


          As long as ops_compute_names is a list






          share|improve this answer


























          • I tried that but terraform still strips off the single quotes

            – Adigun Gbenga
            Apr 18 '18 at 9:33











          • After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

            – Adigun Gbenga
            Apr 18 '18 at 18:13











          • Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

            – Adigun Gbenga
            Apr 20 '18 at 11:51











          • see the edit to the answer

            – Mike
            Apr 22 '18 at 16:24












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f908009%2fterraform-escape-single-quotes%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          This should work



          join("n",formatlist("%s openshift_node_labels={'region': 'primary', 'zone': 'east'}", "${module.compute.ops_compute_names}"))


          As long as ops_compute_names is a list






          share|improve this answer


























          • I tried that but terraform still strips off the single quotes

            – Adigun Gbenga
            Apr 18 '18 at 9:33











          • After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

            – Adigun Gbenga
            Apr 18 '18 at 18:13











          • Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

            – Adigun Gbenga
            Apr 20 '18 at 11:51











          • see the edit to the answer

            – Mike
            Apr 22 '18 at 16:24
















          0














          This should work



          join("n",formatlist("%s openshift_node_labels={'region': 'primary', 'zone': 'east'}", "${module.compute.ops_compute_names}"))


          As long as ops_compute_names is a list






          share|improve this answer


























          • I tried that but terraform still strips off the single quotes

            – Adigun Gbenga
            Apr 18 '18 at 9:33











          • After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

            – Adigun Gbenga
            Apr 18 '18 at 18:13











          • Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

            – Adigun Gbenga
            Apr 20 '18 at 11:51











          • see the edit to the answer

            – Mike
            Apr 22 '18 at 16:24














          0












          0








          0







          This should work



          join("n",formatlist("%s openshift_node_labels={'region': 'primary', 'zone': 'east'}", "${module.compute.ops_compute_names}"))


          As long as ops_compute_names is a list






          share|improve this answer















          This should work



          join("n",formatlist("%s openshift_node_labels={'region': 'primary', 'zone': 'east'}", "${module.compute.ops_compute_names}"))


          As long as ops_compute_names is a list







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 22 '18 at 16:24

























          answered Apr 17 '18 at 20:32









          MikeMike

          18.7k44270




          18.7k44270













          • I tried that but terraform still strips off the single quotes

            – Adigun Gbenga
            Apr 18 '18 at 9:33











          • After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

            – Adigun Gbenga
            Apr 18 '18 at 18:13











          • Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

            – Adigun Gbenga
            Apr 20 '18 at 11:51











          • see the edit to the answer

            – Mike
            Apr 22 '18 at 16:24



















          • I tried that but terraform still strips off the single quotes

            – Adigun Gbenga
            Apr 18 '18 at 9:33











          • After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

            – Adigun Gbenga
            Apr 18 '18 at 18:13











          • Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

            – Adigun Gbenga
            Apr 20 '18 at 11:51











          • see the edit to the answer

            – Mike
            Apr 22 '18 at 16:24

















          I tried that but terraform still strips off the single quotes

          – Adigun Gbenga
          Apr 18 '18 at 9:33





          I tried that but terraform still strips off the single quotes

          – Adigun Gbenga
          Apr 18 '18 at 9:33













          After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

          – Adigun Gbenga
          Apr 18 '18 at 18:13





          After adding , still getting errors: gist.github.com/infinitydon/e5132c9a1707cc5710cb5b1f867ad6e9

          – Adigun Gbenga
          Apr 18 '18 at 18:13













          Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

          – Adigun Gbenga
          Apr 20 '18 at 11:51





          Please any ides why an getting illegal character escape: list_node= "${join("n",formatlist("%s openshift_node_labels="{'region': 'infra', 'zone': 'default'}", "${module.compute.ops_infra_names}"))}" Error running fmt: At 105:144: illegal char escape

          – Adigun Gbenga
          Apr 20 '18 at 11:51













          see the edit to the answer

          – Mike
          Apr 22 '18 at 16:24





          see the edit to the answer

          – Mike
          Apr 22 '18 at 16:24


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f908009%2fterraform-escape-single-quotes%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...