Skip to content

Commit d805f30

Browse files
cam72camDmitrySharabin
authored andcommitted
Add support for ephemeral block in OpenTofu and Terraform (#4007)
1 parent ea428b3 commit d805f30

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/languages/hcl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export default {
1010
},
1111
'keyword': [
1212
{
13-
pattern: /(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,
13+
pattern: /(?:data|ephemeral|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,
1414
inside: {
1515
'type': {
16-
pattern: /(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,
16+
pattern: /(data|ephemeral|resource|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,
1717
lookbehind: true,
1818
alias: 'variable',
1919
},

tests/languages/hcl/keyword_feature.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resource "aws_db_instance" "main" {
22
data "terraform_remote_state" "main" {
3+
ephemeral "provider_type" "main" {
34
output "dev_vpc_id" {
45
config {
56
terraform {
@@ -16,6 +17,11 @@ terraform {
1617
["data ",
1718
["type", "\"terraform_remote_state\""]]],
1819
["string", ["\"main\""]],
20+
["punctuation", "{"],
21+
["keyword",
22+
["ephemeral ",
23+
["type", "\"provider_type\""]]],
24+
["string", ["\"main\""]],
1925
["punctuation", "{"],
2026
["keyword",
2127
["output",

0 commit comments

Comments
 (0)