-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the
contentstack_global_field
resource.
- Loading branch information
1 parent
d4a76d5
commit df55e05
Showing
11 changed files
with
421 additions
and
10 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.terraform/ | ||
.terraform.lock.hcl | ||
*.tfstate | ||
*.backup | ||
|
||
/main.tf | ||
terraform-provider-contentstack_* | ||
/terraform-provider-contentstack_* | ||
/terraform-provider-contentstack |
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
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,91 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "contentstack_global_field Resource - terraform-provider-contentstack" | ||
subcategory: "" | ||
description: |- | ||
A Global field is a reusable field (or group of fields) that you can | ||
define once and reuse in any content type within your stack. This | ||
eliminates the need (and thereby time and efforts) to create the same | ||
set of fields repeatedly in multiple content types. | ||
--- | ||
|
||
# contentstack_global_field (Resource) | ||
|
||
A Global field is a reusable field (or group of fields) that you can | ||
define once and reuse in any content type within your stack. This | ||
eliminates the need (and thereby time and efforts) to create the same | ||
set of fields repeatedly in multiple content types. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
contentstack = { | ||
source = "labd/contentstack" | ||
} | ||
} | ||
} | ||
provider "contentstack" { | ||
base_url = "https://eu-api.contentstack.com/" | ||
api_key = "<api_key>" | ||
management_token = "<token>" | ||
} | ||
resource "contentstack_global_field" "my_field" { | ||
title = "test something" | ||
uid = "foobar" | ||
description = "someting" | ||
maintain_revisions = true | ||
schema = jsonencode(jsondecode(<<JSON | ||
[ | ||
{ | ||
"display_name": "Name", | ||
"uid": "name", | ||
"multiple": false, | ||
"non_localizable": false, | ||
"unique": false, | ||
"mandatory": false, | ||
"data_type": "text" | ||
}, | ||
{ | ||
"data_type": "text", | ||
"display_name": "Rich text editor", | ||
"uid": "description", | ||
"field_metadata": { | ||
"allow_rich_text": true, | ||
"description": "foobar", | ||
"multiline": false, | ||
"rich_text_type": "advanced", | ||
"options": [], | ||
"version": 3 | ||
}, | ||
"multiple": false, | ||
"non_localizable": false, | ||
"mandatory": false, | ||
"unique": false | ||
} | ||
] | ||
JSON | ||
)) | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `title` (String) | ||
- `uid` (String) | ||
|
||
### Optional | ||
|
||
- `description` (String) | ||
- `maintain_revisions` (Boolean) | ||
- `schema` (String) The schema as JSON. Use jsonencode(jsonecode(<schema>)) to work around wrong changes. | ||
|
||
|
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
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,54 @@ | ||
|
||
terraform { | ||
required_providers { | ||
contentstack = { | ||
source = "labd/contentstack" | ||
} | ||
} | ||
} | ||
|
||
provider "contentstack" { | ||
base_url = "https://eu-api.contentstack.com/" | ||
api_key = "<api_key>" | ||
management_token = "<token>" | ||
} | ||
|
||
|
||
resource "contentstack_global_field" "my_field" { | ||
title = "test something" | ||
uid = "foobar" | ||
description = "someting" | ||
maintain_revisions = true | ||
|
||
schema = jsonencode(jsondecode(<<JSON | ||
[ | ||
{ | ||
"display_name": "Name", | ||
"uid": "name", | ||
"multiple": false, | ||
"non_localizable": false, | ||
"unique": false, | ||
"mandatory": false, | ||
"data_type": "text" | ||
}, | ||
{ | ||
"data_type": "text", | ||
"display_name": "Rich text editor", | ||
"uid": "description", | ||
"field_metadata": { | ||
"allow_rich_text": true, | ||
"description": "foobar", | ||
"multiline": false, | ||
"rich_text_type": "advanced", | ||
"options": [], | ||
"version": 3 | ||
}, | ||
"multiple": false, | ||
"non_localizable": false, | ||
"mandatory": false, | ||
"unique": false | ||
} | ||
] | ||
JSON | ||
)) | ||
} |
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
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
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
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
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
Oops, something went wrong.