File tree 2 files changed +18
-1
lines changed
scanners/terraform/parser
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2393,7 +2393,6 @@ resource "aws_s3_bucket" "example" {
2393
2393
}
2394
2394
2395
2395
parser := New (fsys , "" , OptionStopOnHCLError (true ))
2396
-
2397
2396
require .NoError (t , parser .ParseFS (t .Context (), "." ))
2398
2397
2399
2398
_ , err := parser .Load (t .Context ())
@@ -2405,3 +2404,17 @@ resource "aws_s3_bucket" "example" {
2405
2404
val := modules .GetResourcesByType ("aws_s3_bucket" )[0 ].GetAttribute ("bucket" ).GetRawValue ()
2406
2405
assert .Nil (t , val )
2407
2406
}
2407
+
2408
+ func TestConfigWithEphemeralBlock (t * testing.T ) {
2409
+ fsys := fstest.MapFS {
2410
+ "main.tf" : & fstest.MapFile {Data : []byte (`ephemeral "random_password" "password" {
2411
+ length = 16
2412
+ }` )},
2413
+ }
2414
+
2415
+ parser := New (fsys , "" , OptionStopOnHCLError (true ))
2416
+ require .NoError (t , parser .ParseFS (t .Context (), "." ))
2417
+
2418
+ _ , err := parser .Load (t .Context ())
2419
+ require .NoError (t , err )
2420
+ }
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ var Schema = &hcl.BodySchema{
42
42
Type : "data" ,
43
43
LabelNames : []string {"type" , "name" },
44
44
},
45
+ {
46
+ Type : "ephemeral" ,
47
+ LabelNames : []string {"type" , "name" },
48
+ },
45
49
{
46
50
Type : "moved" ,
47
51
},
You can’t perform that action at this time.
0 commit comments