-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* schema: add 1.1 moved block * remove data source ref constraints
- Loading branch information
1 parent
1a218af
commit 408b2ae
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package schema | ||
|
||
import ( | ||
"github.com/hashicorp/hcl-lang/lang" | ||
"github.com/hashicorp/hcl-lang/schema" | ||
"github.com/hashicorp/terraform-schema/internal/schema/refscope" | ||
) | ||
|
||
var movedBlockSchema = &schema.BlockSchema{ | ||
Description: lang.Markdown("Refactoring declaration to specify what address to move where"), | ||
Body: &schema.BodySchema{ | ||
HoverURL: "https://www.terraform.io/language/modules/develop/refactoring#moved-block-syntax", | ||
Attributes: map[string]*schema.AttributeSchema{ | ||
"from": { | ||
Expr: schema.ExprConstraints{ | ||
schema.TraversalExpr{OfScopeId: refscope.ModuleScope}, | ||
schema.TraversalExpr{OfScopeId: refscope.ResourceScope}, | ||
}, | ||
IsRequired: true, | ||
Description: lang.Markdown("Source address to move away from"), | ||
}, | ||
"to": { | ||
Expr: schema.ExprConstraints{ | ||
schema.TraversalExpr{OfScopeId: refscope.ModuleScope}, | ||
schema.TraversalExpr{OfScopeId: refscope.ResourceScope}, | ||
}, | ||
IsRequired: true, | ||
Description: lang.Markdown("Destination address to move to"), | ||
}, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters