-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Regenerate Terraform versions Including 1.7 * Add 1.7 removed block * Apply suggestions from code review Co-authored-by: Radek Simko <radek.simko@gmail.com> * Fix typos --------- Co-authored-by: Radek Simko <radek.simko@gmail.com>
- Loading branch information
1 parent
6171611
commit 8d880b4
Showing
4 changed files
with
77 additions
and
1 deletion.
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,46 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package schema | ||
|
||
import ( | ||
"github.com/hashicorp/hcl-lang/lang" | ||
"github.com/hashicorp/hcl-lang/schema" | ||
"github.com/hashicorp/terraform-schema/internal/schema/refscope" | ||
"github.com/zclconf/go-cty/cty" | ||
) | ||
|
||
func removedBlock() *schema.BlockSchema { | ||
return &schema.BlockSchema{ | ||
Description: lang.Markdown("Declaration to specify what resource or module to remove from the state"), | ||
Body: &schema.BodySchema{ | ||
HoverURL: "https://developer.hashicorp.com/terraform/language/resources/syntax#removing-resources", | ||
Attributes: map[string]*schema.AttributeSchema{ | ||
"from": { | ||
Constraint: schema.OneOf{ | ||
schema.Reference{OfScopeId: refscope.ModuleScope}, | ||
schema.Reference{OfScopeId: refscope.ResourceScope}, | ||
}, | ||
IsRequired: true, | ||
Description: lang.Markdown("Address of the module or resource to be removed"), | ||
}, | ||
}, | ||
Blocks: map[string]*schema.BlockSchema{ | ||
"lifecycle": { | ||
Description: lang.Markdown("Lifecycle customizations controlling the removal"), | ||
Body: &schema.BodySchema{ | ||
Attributes: map[string]*schema.AttributeSchema{ | ||
"destroy": { | ||
Constraint: schema.LiteralType{Type: cty.Bool}, | ||
IsRequired: true, | ||
Description: lang.Markdown("Whether Terraform will attempt to destroy the objects (`true`) or not, i.e. just remove from state (`false`)."), | ||
}, | ||
}, | ||
}, | ||
MinItems: 1, | ||
MaxItems: 1, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
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,17 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package schema | ||
|
||
import ( | ||
"github.com/hashicorp/go-version" | ||
"github.com/hashicorp/hcl-lang/schema" | ||
|
||
v1_6_mod "github.com/hashicorp/terraform-schema/internal/schema/1.6" | ||
) | ||
|
||
func ModuleSchema(v *version.Version) *schema.BodySchema { | ||
bs := v1_6_mod.ModuleSchema(v) | ||
bs.Blocks["removed"] = removedBlock() | ||
return bs | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.