-
Notifications
You must be signed in to change notification settings - Fork 6
Improve documentation and add HCL examples #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
dfaaa4c
Improve docs
0401f7a
Improve docs
074344b
#
c087b13
#
d5e1407
#
8ae518e
#
8b73293
#
0edcb2f
#
5fa2a58
#
ac858a6
#
ea147ee
#
f10acf1
#
6155949
Add ForceNew to Supervisor namespace
83f9860
fmt
052f5ce
apply suggestion
7e070e6
Rename
6c1e7e8
#
5931a4d
#
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,3 +1,3 @@ | ||
| - **New Resource:** `vcfa_supervisor_namespace` to manage Supervisor Namespaces [GH-35, GH-58, GH-59, GH-80] | ||
| - **New Resource:** `vcfa_supervisor_namespace` to manage Supervisor Namespaces [GH-35, GH-58, GH-59, GH-80, GH-81] | ||
| - **New Data Source:** `vcfa_supervisor_namespace` to read Supervisor Namespaces [GH-35, GH-58, GH-59] | ||
| - **New Data Source:** `vcfa_kubeconfig` to get Kubeconfig [GH-35, GH-59] |
This file contains hidden or 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 @@ | ||
| * Add examples of how to use the VMware Cloud Foundation Automation Terraform Provider, that can be found [here](examples) [GH-81] | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,6 @@ | ||
| # Example configuration files for the Terraform Provider for VMware Cloud Foundation Automation | ||
|
|
||
| In this folder you can find configuration files (`.tf`) for several use cases in VMware Cloud Foundation Automation: | ||
|
|
||
| - [Greenfield deployment](greenfield): The Terraform files describe the configuration to apply to a completely fresh installation | ||
| of VMware Cloud Foundation Automation |
This file contains hidden or 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,9 @@ | ||
| # Greenfield configuration for VMware Cloud Foundation Automation | ||
|
|
||
| In this folder you can find configuration files (`.tf`) to apply to a completely fresh installation of VMware Cloud Foundation Automation. | ||
|
|
||
| It is divided into two parts, corresponding to two main roles: | ||
|
|
||
| - [`provider`](provider): Is the part that the VMware Cloud Foundation Automation administrator will apply to create the | ||
| required Organizations (tenants) and configure the underlying infrastructure (vCenter, NSX, Provider Gateways, roles...) | ||
| - [`tenant`](tenant): Is the part that a tenant user will apply to configure the layout of the Organization, like Content Libraries |
This file contains hidden or 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,27 @@ | ||
| # Configure the VMware Cloud Foundation Automation Terraform Provider | ||
|
|
||
| terraform { | ||
| required_providers { | ||
| vcfa = { | ||
| source = "vmware/vcfa" | ||
| version = "~> 1.0.0" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| provider "vcfa" { | ||
| user = var.username | ||
| password = var.password | ||
| url = var.url | ||
| org = "System" # Login in the Provider (System) org | ||
| allow_unverified_ssl = "true" | ||
| logging = true # Generates the log file for troubleshooting | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/data-sources/org | ||
| data "vcfa_org" "system" { | ||
| name = "System" | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/data-sources/kubeconfig | ||
| data "vcfa_kubeconfig" "example" {} |
This file contains hidden or 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,15 @@ | ||
| variable "url" { | ||
| type = string | ||
| description = "VMware Cloud Foundation Automation URL, e.g. https://HOST" | ||
| } | ||
|
|
||
| variable "username" { | ||
| type = string | ||
| description = "Username for authenticating" | ||
| } | ||
|
|
||
| variable "password" { | ||
| type = string | ||
| sensitive = true | ||
| description = "Password for a given 'username'" | ||
| } |
This file contains hidden or 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,25 @@ | ||
| # Configure underlying vCenter and NSX | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/nsx_manager | ||
| resource "vcfa_nsx_manager" "example" { | ||
| name = "tf-example-nsx-manager" | ||
| description = "Created by Terraform VCFA Provider" | ||
| username = var.nsx_manager_username | ||
| password = var.nsx_manager_password | ||
| url = var.nsx_manager_url | ||
| auto_trust_certificate = true | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/vcenter | ||
| resource "vcfa_vcenter" "example" { | ||
| nsx_manager_id = vcfa_nsx_manager.example.id | ||
| name = "tf-example-vcenter" | ||
| description = "Created by Terraform VCFA Provider" | ||
| url = var.vcenter_url | ||
| auto_trust_certificate = true | ||
| refresh_vcenter_on_create = true | ||
| refresh_policies_on_create = true | ||
| username = var.vcenter_username | ||
| password = var.vcenter_password | ||
| is_enabled = true | ||
| } |
This file contains hidden or 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,31 @@ | ||
| variable "vcenter_url" { | ||
| type = string | ||
| description = "URL of vCenter, e.g. https://HOST" | ||
| } | ||
|
|
||
| variable "vcenter_username" { | ||
| type = string | ||
| description = "Username for authenticating to vCenter" | ||
| } | ||
|
|
||
| variable "vcenter_password" { | ||
| type = string | ||
| sensitive = true | ||
| description = "Password for a given 'vcenter_username'" | ||
| } | ||
|
|
||
| variable "nsx_manager_url" { | ||
| type = string | ||
| description = "URL of NSX manager, e.g. https://HOST" | ||
| } | ||
|
|
||
| variable "nsx_manager_username" { | ||
| type = string | ||
| description = "Username for authenticating to NSX Manager" | ||
| } | ||
|
|
||
| variable "nsx_manager_password" { | ||
| type = string | ||
| sensitive = true | ||
| description = "Password for a given 'nsx_manager_username'" | ||
| } |
This file contains hidden or 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,40 @@ | ||
| # Create some Organizations (tenants) | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/org | ||
| resource "vcfa_org" "example" { | ||
| name = "tf-example-org" | ||
| display_name = "tf-example-org" | ||
| description = "Created by Terraform VCFA Provider" | ||
| is_enabled = true | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/org_settings | ||
| resource "vcfa_org_settings" "example" { | ||
| org_id = vcfa_org.example.id | ||
| can_create_subscribed_libraries = true | ||
| quarantine_content_library_items = false | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/data-sources/role | ||
| data "vcfa_role" "org-admin" { | ||
| org_id = vcfa_org.example.id | ||
| name = "Organization Administrator" | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/org_local_user | ||
| resource "vcfa_org_local_user" "example" { | ||
| org_id = vcfa_org.example.id | ||
| role_ids = [data.vcfa_role.org-admin.id] | ||
| username = "tf-example-local-user" | ||
| password = "long-change-ME1" | ||
| } | ||
|
|
||
| # A classic VRA-style organization. See "is_classic_tenant" argument at: | ||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/org | ||
| resource "vcfa_org" "example-classic" { | ||
| name = "tf-example-org-classic" | ||
| display_name = "tf-example-org-classic" | ||
| description = "Created by Terraform VCFA Provider" | ||
| is_classic_tenant = true | ||
| is_enabled = true | ||
| } |
This file contains hidden or 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 @@ | ||
| # Create some Rights Bundles and Roles | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/rights_bundle | ||
| resource "vcfa_rights_bundle" "example" { | ||
| name = "tf-example-rights-bundle" | ||
| description = "Created by Terraform VCFA Provider" | ||
| rights = [ | ||
| "Content Library: View", | ||
| "Content Library Item: View", | ||
| "Group / User: View", | ||
| "IP Blocks: View", | ||
| ] | ||
| publish_to_all_orgs = false | ||
| org_ids = [ | ||
| vcfa_org.example.id | ||
| ] | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/role | ||
| resource "vcfa_role" "example-role" { | ||
| org_id = vcfa_org.example.id | ||
| name = "tf-example-role" | ||
| description = "Created by Terraform VCFA Provider" | ||
| rights = [ | ||
| "Content Library: View", | ||
| "Content Library Item: View", | ||
| "Group / User: View", | ||
| "IP Blocks: View", | ||
| ] | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/global_role | ||
| resource "vcfa_global_role" "new-global-role" { | ||
| name = "tf-example-global-role" | ||
| description = "Created by Terraform VCFA Provider" | ||
| rights = [ | ||
| "Content Library: View", | ||
| "Content Library Item: View", | ||
| "Group / User: View", | ||
| "IP Blocks: View", | ||
| ] | ||
| publish_to_all_orgs = false | ||
| org_ids = [ | ||
| vcfa_org.example.id | ||
| ] | ||
| } |
This file contains hidden or 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,22 @@ | ||
| # Create a Region | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/data-sources/supervisor | ||
| data "vcfa_supervisor" "example" { | ||
| name = var.supervisor_name | ||
| vcenter_id = vcfa_vcenter.example.id | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/data-sources/supervisor_zone | ||
| data "vcfa_supervisor_zone" "example" { | ||
| supervisor_id = data.vcfa_supervisor.example.id | ||
| name = var.supervisor_zone_name | ||
| } | ||
|
|
||
| # https://registry.terraform.io/providers/vmware/vcfa/latest/docs/resources/region | ||
| resource "vcfa_region" "example" { | ||
| name = "tf-example-region" | ||
| description = "Created by Terraform VCFA Provider" | ||
| nsx_manager_id = vcfa_nsx_manager.example.id | ||
| supervisor_ids = [data.vcfa_supervisor.example.id] | ||
| storage_policy_names = var.vcenter_storage_policy_names[*] | ||
| } |
This file contains hidden or 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,14 @@ | ||
| variable "supervisor_name" { | ||
| type = string | ||
| description = "Name of Supervisor in vCenter" | ||
| } | ||
|
|
||
| variable "supervisor_zone_name" { | ||
| type = string | ||
| description = "Name of Supervisor Zone in vCenter" | ||
| } | ||
|
|
||
| variable "vcenter_storage_policy_names" { | ||
| type = set(string) | ||
| description = "vCenter storage profiles" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.