Skip to content

Commit

Permalink
Data Resource Examples (#488)
Browse files Browse the repository at this point in the history
* docs: DOC-976

* docs: DOC-977

* docs: DOC-978
  • Loading branch information
karl-cardenas-coding authored Jul 21, 2024
1 parent 7d754b8 commit 5d29b0a
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 22 deletions.
27 changes: 20 additions & 7 deletions docs/data-sources/cloudaccount_aws.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "spectrocloud_cloudaccount_aws Data Source - terraform-provider-spectrocloud"
subcategory: ""
description: |-
A data source for retrieving information about an AWS cloud account registered in Palette.
---

# spectrocloud_cloudaccount_aws (Data Source)

A data source for retrieving information about an AWS cloud account registered in Palette.

## Example Usage


You can retrieve the details of an AWS cloud registered in Palette by specifying the ID of the cloud account.

```hcl
data "spectrocloud_cloudaccount_aws" "aws_account" {
id = "45bddf48b8fc3ea6c1774886"
}
```

Alternatively, you specify the ID of the cloud account to retrieve the details of the AWS cloud.

```hcl
data "spectrocloud_cloudaccount_aws" "aws_account" {
name = "primary-aws-account"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `depends` (String)
- `name` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `id` (String) ID of the AWS cloud account registered in Palette.
- `name` (String) Name of the AWS cloud account registered in Palette.
32 changes: 24 additions & 8 deletions docs/data-sources/cloudaccount_azure.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "spectrocloud_cloudaccount_azure Data Source - terraform-provider-spectrocloud"
subcategory: ""
description: |-
A data source for retrieving information about an Azure cloud account registered in Palette.
---

# spectrocloud_cloudaccount_azure (Data Source)

A data source for retrieving information about an Azure cloud account registered in Palette.

## Example Usage


You can retrieve the details of an Azure cloud registered in Palette by specifying the ID of the cloud account.

```hcl
data "spectrocloud_cloudaccount_azure" "azure_account" {
id = "45bddf48b8fc3ea6c1774886"
}
```

Alternatively, you specify the ID of the cloud account to retrieve the details of the Azure cloud account.

```hcl
data "spectrocloud_cloudaccount_azure" "azure_account" {
name = "primary-azure-account"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `name` (String)
- `id` (String) ID of the Azure cloud account registered in Palette.
- `name` (String) Name of the Azure cloud account registered in Palette.

### Read-Only

- `azure_client_id` (String)
- `azure_tenant_id` (String)
- `disable_properties_request` (Boolean)
- `id` (String) The ID of this resource.
- `tenant_name` (String)
- `azure_client_id` (String) The unique client ID from Azure Management Portal.
- `azure_tenant_id` (String) The tenant ID of the Azure cloud account registered in Palette.
- `disable_properties_request` (Boolean) The status of the disable properties option.
- `tenant_name` (String) The name of the Azure tenant.
27 changes: 20 additions & 7 deletions docs/data-sources/cloudaccount_gcp.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "spectrocloud_cloudaccount_gcp Data Source - terraform-provider-spectrocloud"
subcategory: ""
description: |-
A data source for retrieving information about a GCP cloud account registered in Palette.
---

# spectrocloud_cloudaccount_gcp (Data Source)

A data source for retrieving information about a GCP cloud account registered in Palette.

## Example Usage


You can retrieve the details of a GCP cloud registered in Palette by specifying the ID of the cloud account.

```hcl
data "spectrocloud_cloudaccount_gcp" "gcp_account" {
id = "45bddf48b8fc3ea6c1774886"
}
```

Alternatively, you specify the ID of the cloud account to retrieve the details of the GCP cloud account.

```hcl
data "spectrocloud_cloudaccount_gcp" "gcp_account" {
name = "primary-gcp-account"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `name` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `id` (String) ID of the GCP cloud account registered in Palette.
- `name` (String) Name of the GCP cloud account registered in Palette.
3 changes: 3 additions & 0 deletions spectrocloud/data_source_cloud_account_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ import (
func dataSourceCloudAccountAws() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceCloudAccountAwsRead,
Description: "A data source for retrieving information about an AWS cloud account registered in Palette.",

Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Description: "ID of the AWS cloud account registered in Palette.",
Optional: true,
Computed: true,
ExactlyOneOf: []string{"id", "name"},
},
"name": {
Type: schema.TypeString,
Description: "Name of the AWS cloud account registered in Palette.",
Optional: true,
Computed: true,
ExactlyOneOf: []string{"id", "name"},
Expand Down
7 changes: 7 additions & 0 deletions spectrocloud/data_source_cloud_account_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,41 @@ import (
func dataSourceCloudAccountAzure() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceCloudAccountAzureRead,
Description: "A data source for retrieving information about an Azure cloud account registered in Palette.",

Schema: map[string]*schema.Schema{
"azure_tenant_id": {
Type: schema.TypeString,
Description: "The tenant ID of the Azure cloud account registered in Palette.",
Computed: true,
},
"azure_client_id": {
Type: schema.TypeString,
Description: "The unique client ID from Azure Management Portal.",
Computed: true,
},
"id": {
Type: schema.TypeString,
Description: "ID of the Azure cloud account registered in Palette.",
Optional: true,
Computed: true,
ExactlyOneOf: []string{"id", "name"},
},
"name": {
Type: schema.TypeString,
Description: "Name of the Azure cloud account registered in Palette.",
Optional: true,
Computed: true,
ExactlyOneOf: []string{"id", "name"},
},
"tenant_name": {
Description: "The name of the Azure tenant.",
Type: schema.TypeString,
Computed: true,
},
"disable_properties_request": {
Type: schema.TypeBool,
Description: "The status of the disable properties option.",
Computed: true,
},
},
Expand Down
3 changes: 3 additions & 0 deletions spectrocloud/data_source_cloud_account_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ import (
func dataSourceCloudAccountGcp() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceCloudAccountGcpRead,
Description: "A data source for retrieving information about a GCP cloud account registered in Palette.",

Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Description: "ID of the GCP cloud account registered in Palette.",
Optional: true,
Computed: true,
ExactlyOneOf: []string{"id", "name"},
},
"name": {
Type: schema.TypeString,
Description: "Name of the GCP cloud account registered in Palette.",
Optional: true,
Computed: true,
ExactlyOneOf: []string{"id", "name"},
Expand Down
31 changes: 31 additions & 0 deletions templates/data-sources/cloudaccount_aws.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | plainmarkdown | trimspace | prefixlines " " }}

## Example Usage


You can retrieve the details of an AWS cloud registered in Palette by specifying the ID of the cloud account.

```hcl
data "spectrocloud_cloudaccount_aws" "aws_account" {
id = "45bddf48b8fc3ea6c1774886"
}
```

Alternatively, you specify the ID of the cloud account to retrieve the details of the AWS cloud.

```hcl
data "spectrocloud_cloudaccount_aws" "aws_account" {
name = "primary-aws-account"
}
```

{{ .SchemaMarkdown | trimspace }}
31 changes: 31 additions & 0 deletions templates/data-sources/cloudaccount_azure.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | plainmarkdown | trimspace | prefixlines " " }}

## Example Usage


You can retrieve the details of an Azure cloud registered in Palette by specifying the ID of the cloud account.

```hcl
data "spectrocloud_cloudaccount_azure" "azure_account" {
id = "45bddf48b8fc3ea6c1774886"
}
```

Alternatively, you specify the ID of the cloud account to retrieve the details of the Azure cloud account.

```hcl
data "spectrocloud_cloudaccount_azure" "azure_account" {
name = "primary-azure-account"
}
```

{{ .SchemaMarkdown | trimspace }}
31 changes: 31 additions & 0 deletions templates/data-sources/cloudaccount_gcp.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | plainmarkdown | trimspace | prefixlines " " }}

## Example Usage


You can retrieve the details of a GCP cloud registered in Palette by specifying the ID of the cloud account.

```hcl
data "spectrocloud_cloudaccount_gcp" "gcp_account" {
id = "45bddf48b8fc3ea6c1774886"
}
```

Alternatively, you specify the ID of the cloud account to retrieve the details of the GCP cloud account.

```hcl
data "spectrocloud_cloudaccount_gcp" "gcp_account" {
name = "primary-gcp-account"
}
```

{{ .SchemaMarkdown | trimspace }}

0 comments on commit 5d29b0a

Please sign in to comment.