Skip to content

Releases: xchapter7x/clarity

v0.7.1-rc.2

13 Aug 20:19
f2081eb
Compare
Choose a tag to compare
v0.7.1-rc.2 Pre-release
Pre-release

v0.7.1-rc.2

v0.7.1-rc.1

13 Aug 20:19
f2081eb
Compare
Choose a tag to compare
v0.7.1-rc.1 Pre-release
Pre-release

v0.7.1-rc.1

v0.7.1-rc.0

22 Apr 20:06
f2081eb
Compare
Choose a tag to compare
v0.7.1-rc.0 Pre-release
Pre-release

v0.7.1-rc.0

v0.7.0

22 Apr 16:27
Compare
Choose a tag to compare

Adds support for hcl2

  • to leverage hcl2 one needs to swap the Terraform in the given clause to HCL2

HCL2 parse test:

-> % ../clarity parsetest.feature

Feature: We should have a LB for our control plane and its components and as
  such we should configure the proper security groups and listeners

  Scenario: we are using a terraform .11 # parsetest.feature:4
    Given Terraform                      # terraform.go:92 -> *Match
    hcl Unmarshal failed: At 13:12: unexpected token while parsing list: IDENT

  Scenario: we are using a terraform .12 # parsetest.feature:7
    Given HCL2                           # terraform.go:102 -> *Match

--- Failed steps:

  Scenario: we are using a terraform .11 # parsetest.feature:4
    Given Terraform # parsetest.feature:5
      Error: hcl Unmarshal failed: At 13:12: unexpected token while parsing list: IDENT


2 scenarios (1 passed, 1 failed)
2 steps (1 passed, 1 failed)
3.094086ms

Sample New Feature HCL2:

terraform {
  required_version = ">= 0.12.0"
}

# List of letters
variable "letters" {
  description = "a list of letters"
  default = ["a", "b", "c"]
}

# Convert letters to upper-case as list
output "upper-case-list" {
  value = [for l in var.letters: upper(l)]
}

# Convert letters to upper-case as map
output "upper-case-map" {
  value = {for l in var.letters: l => upper(l)}
}
terraform {
  required_version = ">= 0.12.0"
}

provider "aws" {
  region = "us-east-1"
}

resource "aws_vpc" "my_vpc" {
  cidr_block = "172.16.0.0/16"
  tags = {
    Name = "tf-0.12-for-example"
  }
}

resource "aws_subnet" "my_subnet" {
  vpc_id = aws_vpc.my_vpc.id
  cidr_block = "172.16.10.0/24"
  availability_zone = "us-east-1a"
  tags = {
    Name = "tf-0.12-for-example"
  }
}

resource "aws_instance" "ubuntu" {
  count = 3
  ami           = "ami-2e1ef954"
  instance_type = "t2.micro"
  associate_public_ip_address = ( count.index == 1 ? true : false)
  subnet_id = aws_subnet.my_subnet.id
  tags = {
    Name  = format("terraform-0.12-for-demo-%d", count.index)
  }
}

# This uses the old splat expression
output "private_addresses_old" {
  value = aws_instance.ubuntu.*.private_dns
}

# This uses the new full splat operator (*)
# But this does not work in 0.12 alpha-1 or alpha-2
/*output "private_addresses_full_splat" {
  value = [ aws_instance.ubuntu[*].private_dns ]
}*/

# This uses the new for expression
output "private_addresses_new" {
  value = [
    for instance in aws_instance.ubuntu:
    instance.private_dns
  ]
}

# This uses the new conditional operator
# that can work with lists
# It should work with lists in [x, y, z] form, but does not yet do that
output "ips" {
  value = [
    for instance in aws_instance.ubuntu:
    (instance.public_ip != "" ? list(instance.private_ip, instance.public_ip) : list(instance.private_ip))
  ]
}

v0.6.2-rc.12

22 Apr 13:35
Compare
Choose a tag to compare
v0.6.2-rc.12 Pre-release
Pre-release

v0.6.2-rc.12

v0.6.2-rc.11

21 Apr 00:51
Compare
Choose a tag to compare
v0.6.2-rc.11 Pre-release
Pre-release

v0.6.2-rc.11

Adds support for hcl2

  • to leverage hcl2 one needs to swap the Terraform in the given clause to HCL2

v0.6.2-rc.9

20 Apr 15:44
Compare
Choose a tag to compare
v0.6.2-rc.9 Pre-release
Pre-release

v0.6.2-rc.9

v0.6.2-rc.10

20 Apr 16:40
Compare
Choose a tag to compare
v0.6.2-rc.10 Pre-release
Pre-release

v0.6.2-rc.10

v0.6.2-rc.8

16 Apr 18:27
Compare
Choose a tag to compare
v0.6.2-rc.8 Pre-release
Pre-release

v0.6.2-rc.8

v0.6.2-rc.7

16 Apr 18:26
652fdba
Compare
Choose a tag to compare
v0.6.2-rc.7 Pre-release
Pre-release

v0.6.2-rc.7