hcl2 | Former temporary home for experimental new version of HCL | Configuration Management library

 by   hashicorp Go Version: Current License: MPL-2.0

kandi X-RAY | hcl2 Summary

kandi X-RAY | hcl2 Summary

hcl2 is a Go library typically used in Devops, Configuration Management, Terraform applications. hcl2 has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

This repository was used for the initial development of version 2 of HCL, but is now archived because the work from this repository was incorporated back in to the main HCL repository. This repository remains here for the moment for compatibility with existing callers that imported the experimental version. We strongly encourage switching to a stable release of HCL 2 as soon as possible. For more information on installing HCL 1 and/or HCL 2, please see the Version Selection guide. There will be no further development in this temporary experimental HCL 2 repository.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              hcl2 has a low active ecosystem.
              It has 365 star(s) with 63 fork(s). There are 234 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 59 have been closed. On average issues are closed in 69 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of hcl2 is current.

            kandi-Quality Quality

              hcl2 has no bugs reported.

            kandi-Security Security

              hcl2 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              hcl2 is licensed under the MPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              hcl2 releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hcl2
            Get all kandi verified functions for this library.

            hcl2 Key Features

            No Key Features are available at this moment for hcl2.

            hcl2 Examples and Code Snippets

            No Code Snippets are available at this moment for hcl2.

            Community Discussions

            QUESTION

            Unable to read terraform variables.tf files into may go program
            Asked 2021-Mar-15 at 19:47

            I am attempting to write a go program that reads in a terraform variables.tf and populates a struct for later manipulation. However, I am getting errors when attempting to "parse" the file. I Am hoping someone can tell me what I am doing wrong:

            Code:

            ...

            ANSWER

            Answered 2021-Mar-14 at 04:40

            It looks like it's a bug/feature of the library, since as soon as you change string to "string", e.g.,

            Source https://stackoverflow.com/questions/66620096

            QUESTION

            Terraform: Interpolation could be replaced by HCL2 expression
            Asked 2021-Jan-24 at 16:40

            When I try to use interpolation syntax like this:

            ...

            ANSWER

            Answered 2021-Jan-24 at 16:40

            You just have to get the id without using double quotes vpc_id = aws_vpc.prod-vpc.id because you are getting vpc id from the resource. If you use the double quotes, it will be considered as a string and no evaluation will be done, and terraform will consider "aws_vpc.prod-vpc.id" as the id.

            This is the corrected code:

            Source https://stackoverflow.com/questions/65871914

            QUESTION

            Edit Terraform configuration files programmatically with Python
            Asked 2021-Jan-13 at 00:07

            I am trying to edit Terraform configuration files with Python. I am parsing Terraform files (.tf) using python hcl2 library which returns a python dictionary. I want to add new key/value pairs or change some values in the dictionary. Directly writing to the file is not a good practice since the returned python dictionary is not in Hashicorp Configuration Language format. Also there can be multiple configuration files like variables.tf etc. which are linked together. Should I implement my own serializer which converts python dictionary to terraform configuration file or is there an easier way to do it?

            ...

            ANSWER

            Answered 2021-Jan-13 at 00:07

            The python-hcl2 library implements a parser for the HCL syntax, but it doesn't have a serializer, and its API is designed to drop all of the HCL specifics and retain only a basic Python data structure, so it doesn't seem to retain enough information to surgically modify the input without losing details such as comments, ordering of attributes, etc.

            At the time I'm writing this, the only HCL implementation that explicitly supports updating existing configuration files in-place is the Go package hclwrite. It allows callers to load in arbitrary HCL source, surgically modify parts of it, and then re-serialize that updated version with only minor whitespace normalization to the unchanged parts of the input.

            In principle it would be possible to port hclwrite to Python, or to implement a serializer from a dictionary like python-hcl2 returns if you are not concerned with preserving unchanged input, but both of these seem like a significant project.

            If you do decide to do it, one part that warrants careful attention is serialization of strings into HCL syntax, because the required escaping isn't exactly the same as any other language. You might wish to refer to the escapeQuotedStringLit function from hclwrite to see all of the cases to handle, so you can potentially implement compatible logic in Python.

            Source https://stackoverflow.com/questions/65685549

            QUESTION

            Terraform 12 block variable
            Asked 2020-Sep-05 at 23:16

            Now I am in process of migrating to Terraform 12. One of the main feature here is more strict HCL2 and I like it.

            For example if I have list of maps:

            ...

            ANSWER

            Answered 2020-Sep-05 at 13:49

            I get where you are going. But I don't think it is currently possible to "expand" a map inside a resource for example. You could define a map variable with default values, although this is more lines of code.

            Source https://stackoverflow.com/questions/63754362

            QUESTION

            Converting Packer 1.6 vsphere-iso configuration code from JSON to HCL2
            Asked 2020-Aug-10 at 17:10

            With the release of Packer 1.6 came several depreciated fields in the vsphere-iso builder. From the looks of it, seems to be a format/type change because the fields actually still exists but just as properties it seems. An example of the changes are the following:

            Working in Packer 1.5.6:

            JSON

            ...

            ANSWER

            Answered 2020-Aug-10 at 17:10

            The correct syntax is the following:

            Source https://stackoverflow.com/questions/63275300

            QUESTION

            WP OnePress custom font
            Asked 2020-Mar-24 at 18:34

            I am trying to set "not included" font to OnePress template. I tried plugins and etc. but it doesn't work. Same with CSS. For example, I used this:

            ...

            ANSWER

            Answered 2020-Mar-24 at 18:34

            Use @font-face and import the font directly on your style file

            For example

            Source https://stackoverflow.com/questions/60834221

            QUESTION

            Terraform getting private subnets for a security group
            Asked 2019-Sep-05 at 15:38

            I am trying to get the private subnets in my VPC, I'm using an example from the Terraform docs https://www.terraform.io/docs/providers/aws/d/subnet_ids.html but this is giving me errors.

            Here is my code (I commented out the filter, so this should get all subnets - my vpc has 3 public and 3 private subnets)

            ...

            ANSWER

            Answered 2019-Sep-05 at 15:38

            The output of the aws_subnet_ids data is a set and not a list. You would need to convert it to a list. You can achieve this with the tolist function documented here.

            Your code could be updated as follows:

            Source https://stackoverflow.com/questions/57808655

            QUESTION

            Terraform v0.12 Multi-line String EOF shell-style "here doc" syntax not been interpreted as before with v0.11
            Asked 2019-Aug-06 at 16:12

            Within Octopus Deploy I've setup a Terraform Apply Step using their Apply a Terraform template

            In my Terraform main.tf file I want to use a connection to run an remote-exec on a Amazon Linux EC2 instance in AWS

            ...

            ANSWER

            Answered 2019-Aug-06 at 16:12

            The correct syntax for a "flush heredoc" does not include a dash on the final marker:

            Source https://stackoverflow.com/questions/57379491

            QUESTION

            Multi Select .Net MVC to single concatenated field for Entity Framework?
            Asked 2017-Aug-24 at 05:22

            I am combining a multi select form to a single input using JavaScript. But I am getting the input cut off using any delimiters. When the Controller gets the request I'm only getting the first item selected. I've checked to make sure the form variable is getting updated so I think it's the controller. What am I missing?

            View:

            ...

            ANSWER

            Answered 2017-Aug-02 at 18:50

            Most likely, the form is submitting too fast. You should use preventDefault first, and then manually submit after you make the necessary updates to the form data:

            Source https://stackoverflow.com/questions/45467578

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install hcl2

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/hashicorp/hcl2.git

          • CLI

            gh repo clone hashicorp/hcl2

          • sshUrl

            git@github.com:hashicorp/hcl2.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Configuration Management Libraries

            dotfiles

            by mathiasbynens

            consul

            by hashicorp

            viper

            by spf13

            eureka

            by Netflix

            confd

            by kelseyhightower

            Try Top Libraries by hashicorp

            terraform

            by hashicorpGo

            vault

            by hashicorpGo

            consul

            by hashicorpGo

            vagrant

            by hashicorpRuby

            packer

            by hashicorpGo