-
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.
Merge pull request #38 from nullplatform/fixes/docs-dimensions-and-ac…
…cuonts fixes: we now have documentation for the new resources we added, dime…
- Loading branch information
Showing
14 changed files
with
403 additions
and
13 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 |
---|---|---|
|
@@ -25,7 +25,6 @@ provider "nullplatform" {} | |
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
||
## Schema | ||
|
||
### Required | ||
|
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,64 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "nullplatform_account Resource - terraform-provider-nullplatform" | ||
subcategory: "" | ||
description: |- | ||
The account resource allows you to configure a nullplatform account | ||
--- | ||
|
||
# nullplatform_account (Resource) | ||
|
||
The account resource allows you to configure a nullplatform account | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
terraform { | ||
required_providers { | ||
nullplatform = { | ||
source = "nullplatform/nullplatform" | ||
} | ||
} | ||
} | ||
provider "nullplatform" {} | ||
resource "nullplatform_account" "github_account" { | ||
name = "My GitHub Account" | ||
repository_prefix = "my-org" | ||
repository_provider = "github" | ||
slug = "github-account" | ||
} | ||
resource "nullplatform_account" "gitlab_account" { | ||
name = "My GitLab Account" | ||
repository_prefix = "my-company" | ||
repository_provider = "gitlab" | ||
slug = "gitlab-account" | ||
} | ||
output "github_account_id" { | ||
description = "The ID of the GitHub account" | ||
value = nullplatform_account.github_account.id | ||
} | ||
output "github_account_org_id" { | ||
description = "The organization ID the account belongs to" | ||
value = nullplatform_account.github_account.organization_id | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name of the account | ||
- `repository_prefix` (String) The prefix used for repositories in this account | ||
- `repository_provider` (String) The repository provider for this account | ||
- `slug` (String) The unique slug identifier for the account | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `organization_id` (Number) The ID of the organization this account belongs to (computed from authentication token) |
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,35 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "nullplatform_dimension Resource - terraform-provider-nullplatform" | ||
subcategory: "" | ||
description: |- | ||
The dimension resource allows you to configure a Nullplatform Dimension | ||
--- | ||
|
||
# nullplatform_dimension (Resource) | ||
|
||
The dimension resource allows you to configure a Nullplatform Dimension | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name of the dimension. | ||
|
||
### Optional | ||
|
||
- `account` (String) The slug of the account NRN component. | ||
- `application` (String) The slug of the application NRN component. | ||
- `namespace` (String) The slug of the namespace NRN component. | ||
- `nrn` (String) A system-wide unique ID representing the resource. | ||
- `order` (Number) The order of the dimension. | ||
- `scope` (String) The slug of the scope NRN component. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `slug` (String) The slug of the dimension. | ||
- `status` (String) The status of the dimension. |
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,35 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "nullplatform_dimension_value Resource - terraform-provider-nullplatform" | ||
subcategory: "" | ||
description: |- | ||
The dimension_value resource allows you to configure a Nullplatform Dimension Value | ||
--- | ||
|
||
# nullplatform_dimension_value (Resource) | ||
|
||
The dimension_value resource allows you to configure a Nullplatform Dimension Value | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `dimension_id` (Number) The ID of the parent dimension. | ||
- `name` (String) The name of the dimension value. | ||
|
||
### Optional | ||
|
||
- `account` (String) The slug of the account NRN component. | ||
- `application` (String) The slug of the application NRN component. | ||
- `namespace` (String) The slug of the namespace NRN component. | ||
- `nrn` (String) A system-wide unique ID representing the resource. | ||
- `scope` (String) The slug of the scope NRN component. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `slug` (String) The slug of the dimension value. | ||
- `status` (String) The status of the dimension value. |
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,61 @@ | ||
terraform { | ||
required_providers { | ||
nullplatform = { | ||
source = "nullplatform/nullplatform" | ||
} | ||
} | ||
} | ||
|
||
data "nullplatform_account" "existing_account" { | ||
id = "123456" | ||
} | ||
|
||
data "nullplatform_account" "by_slug" { | ||
slug = "github-account" | ||
} | ||
|
||
resource "nullplatform_namespace" "example" { | ||
name = "Production Environment" | ||
account_id = data.nullplatform_account.existing_account.id | ||
|
||
depends_on = [ | ||
data.nullplatform_account.existing_account | ||
] | ||
} | ||
|
||
output "account_name" { | ||
description = "The name of the account" | ||
value = data.nullplatform_account.existing_account.name | ||
} | ||
|
||
output "account_repo_prefix" { | ||
description = "The repository prefix of the account" | ||
value = data.nullplatform_account.existing_account.repository_prefix | ||
} | ||
|
||
output "account_repo_provider" { | ||
description = "The repository provider of the account" | ||
value = data.nullplatform_account.existing_account.repository_provider | ||
} | ||
|
||
resource "nullplatform_account" "multi_provider" { | ||
for_each = { | ||
github = { | ||
name = "GitHub Projects" | ||
prefix = "github-org" | ||
provider = "github" | ||
slug = "github-projects" | ||
} | ||
gitlab = { | ||
name = "GitLab Projects" | ||
prefix = "gitlab-org" | ||
provider = "gitlab" | ||
slug = "gitlab-projects" | ||
} | ||
} | ||
|
||
name = each.value.name | ||
repository_prefix = each.value.prefix | ||
repository_provider = each.value.provider | ||
slug = each.value.slug | ||
} |
45 changes: 45 additions & 0 deletions
45
examples/data-sources/nullplatform_dimension/data-source.tf
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,45 @@ | ||
terraform { | ||
required_providers { | ||
nullplatform = { | ||
source = "nullplatform/nullplatform" | ||
} | ||
} | ||
} | ||
|
||
provider "nullplatform" {} | ||
|
||
data "nullplatform_dimension" "example" { | ||
id = "123456" | ||
} | ||
|
||
data "nullplatform_dimension" "by_nrn" { | ||
nrn = "organization=1234567890:account=987654321:namespace=1122334455" | ||
} | ||
|
||
data "nullplatform_dimension" "by_components" { | ||
organization = "1234567890" | ||
account = "my-account" | ||
namespace = "platform-config" | ||
} | ||
|
||
resource "nullplatform_dimension_value" "prod" { | ||
dimension_id = data.nullplatform_dimension.example.id | ||
name = "Production" | ||
nrn = "${data.nullplatform_dimension.example.nrn}:value=prod" | ||
} | ||
|
||
output "dimension_name" { | ||
value = data.nullplatform_dimension.example.name | ||
} | ||
|
||
output "dimension_slug" { | ||
value = data.nullplatform_dimension.example.slug | ||
} | ||
|
||
output "dimension_status" { | ||
value = data.nullplatform_dimension.example.status | ||
} | ||
|
||
output "dimension_order" { | ||
value = data.nullplatform_dimension.example.order | ||
} |
37 changes: 37 additions & 0 deletions
37
examples/data-sources/nullplatform_dimension_value/data-source.tf
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,37 @@ | ||
terraform { | ||
required_providers { | ||
nullplatform = { | ||
source = "nullplatform/nullplatform" | ||
} | ||
} | ||
} | ||
|
||
data "nullplatform_dimension_value" "existing_value" { | ||
dimension_id = 12345 | ||
id = "67890" | ||
} | ||
|
||
data "nullplatform_dimension_value" "by_nrn" { | ||
dimension_id = 12345 | ||
nrn = "organization=1234567890:account=987654321:namespace=1122334455:value=prod" | ||
} | ||
|
||
data "nullplatform_dimension_value" "by_components" { | ||
dimension_id = 12345 | ||
organization = "1234567890" | ||
account = "my-account" | ||
namespace = "platform-config" | ||
name = "Production" | ||
} | ||
|
||
output "dimension_value_name" { | ||
value = data.nullplatform_dimension_value.existing_value.name | ||
} | ||
|
||
output "dimension_value_slug" { | ||
value = data.nullplatform_dimension_value.existing_value.slug | ||
} | ||
|
||
output "dimension_value_status" { | ||
value = data.nullplatform_dimension_value.existing_value.status | ||
} |
2 changes: 1 addition & 1 deletion
2
examples/data-sources/nullplatform_provider_config/data-source.tf
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,33 @@ | ||
terraform { | ||
required_providers { | ||
nullplatform = { | ||
source = "nullplatform/nullplatform" | ||
} | ||
} | ||
} | ||
|
||
provider "nullplatform" {} | ||
|
||
resource "nullplatform_account" "github_account" { | ||
name = "My GitHub Account" | ||
repository_prefix = "my-org" | ||
repository_provider = "github" | ||
slug = "github-account" | ||
} | ||
|
||
resource "nullplatform_account" "gitlab_account" { | ||
name = "My GitLab Account" | ||
repository_prefix = "my-company" | ||
repository_provider = "gitlab" | ||
slug = "gitlab-account" | ||
} | ||
|
||
output "github_account_id" { | ||
description = "The ID of the GitHub account" | ||
value = nullplatform_account.github_account.id | ||
} | ||
|
||
output "github_account_org_id" { | ||
description = "The organization ID the account belongs to" | ||
value = nullplatform_account.github_account.organization_id | ||
} |
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,32 @@ | ||
terraform { | ||
required_providers { | ||
nullplatform = { | ||
source = "nullplatform/nullplatform" | ||
} | ||
} | ||
} | ||
|
||
provider "nullplatform" {} | ||
|
||
resource "nullplatform_dimension" "ordered_dimension" { | ||
name = "Region" | ||
order = 2 | ||
nrn = "organization=1234567890:account=987654321:namespace=1122334455" | ||
} | ||
|
||
resource "nullplatform_dimension" "component_dimension" { | ||
name = "Department" | ||
account = "my-main-account" | ||
namespace = "platform-config" | ||
order = 3 | ||
} | ||
|
||
output "dimension_slug" { | ||
description = "The generated slug for the dimension" | ||
value = nullplatform_dimension.basic_dimension.slug | ||
} | ||
|
||
output "dimension_status" { | ||
description = "The current status of the dimension" | ||
value = nullplatform_dimension.basic_dimension.status | ||
} |
Oops, something went wrong.