Sha256: 9ae43d187cfe85dba38862e8639b3125ec983f564e06b4a55a1a6fdc4fb3df1f

Contents?: true

Size: 1.05 KB

Versions: 104

Compression:

Stored size: 1.05 KB

Contents

describe Terraspace::Compiler::Dsl::Mod do
  let(:builder) { described_class.new(mod, path) }
  let(:mod)     { Terraspace::Mod.new("vpc") }

  context "security_group with hash ingress" do
    let(:path) { fixture("orphans/resource/security_group/hash_example.rb") }
    it "adds null for required props" do
      result = builder.build
      json =<<~EOL.strip
{
  "resource": {
    "aws_security_group": {
      "demo-sg": {
        "name": "${var.name}",
        "description": "Demo Security Group",
        "vpc_id": "${var.vpc_id}",
        "ingress": [
          {
            "description": "TLS from VPC",
            "from_port": 443,
            "to_port": 443,
            "protocol": "tcp",
            "cidr_blocks": [
              "0.0.0.0/0"
            ],
            "ipv6_cidr_blocks": null,
            "prefix_list_ids": null,
            "security_groups": null,
            "self": null
          }
        ],
        "tags": {
          "Name": "${var.name}"
        }
      }
    }
  }
}
      EOL
      expect(result).to eq(json)
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
terraspace-2.2.17 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.16 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.15 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.14 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.13 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.12 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.11 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.10 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.9 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.8 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.7 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.6 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.5 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.4 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.3 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.2 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.1 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.2.0 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.1.7 spec/terraspace/compiler/dsl/resource/security_group_spec.rb
terraspace-2.1.6 spec/terraspace/compiler/dsl/resource/security_group_spec.rb