Skip to content
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

fix: change terraform file style from imperative to declarative #487

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/guides/tanzu-mission-control_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ data "tanzu-mission-control_cluster" "ready_only_cluster_view" {
}

# Create Tanzu Mission Control Tanzu Kubernetes Grid Service workload cluster entry
resource "tanzu-mission-control_cluster" "create_tkgs_workload" {
resource "tanzu-mission-control_cluster" "tkgs_workload" {
management_cluster_name = "<management-cluster>"
provisioner_name = "<prov-name>"
name = "<cluster-name>"
Expand Down Expand Up @@ -175,7 +175,7 @@ data "tanzu-mission-control_cluster" "ready_only_cluster_view" {
}

// Create Tanzu Mission Control Tanzu Kubernetes Grid vSphere workload cluster entry
resource "tanzu-mission-control_cluster" "create_tkg_vsphere_cluster" {
resource "tanzu-mission-control_cluster" "tkg_vsphere_cluster" {
management_cluster_name = "<management-cluster>" // Default: attached
provisioner_name = "<prov-name>" // Default: attached
name = "<cluster-name>" // Required
Expand Down Expand Up @@ -312,7 +312,7 @@ data "tanzu-mission-control_cluster" "ready_only_cluster_view" {
}

// Create Tanzu Mission Control Tanzu Kubernetes Grid AWS workload cluster entry
resource "tanzu-mission-control_cluster" "create_tkg_aws_cluster" {
resource "tanzu-mission-control_cluster" "tkg_aws_cluster" {
management_cluster_name = "<management-cluster>" // Default: attached
provisioner_name = "<prov-name>" // Default: attached
name = "<cluster-name>" // Required
Expand Down
68 changes: 34 additions & 34 deletions docs/guides/tanzu-mission-control_gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ terraform {
}

# Create cluster group
resource "tanzu-mission-control_cluster_group" "create_cluster_group" {
resource "tanzu-mission-control_cluster_group" "cluster_group" {
name = "demo-cluster-group"
}

Expand All @@ -84,15 +84,15 @@ resource "tanzu-mission-control_cluster" "attach_cluster_with_kubeconfig" {
}

spec {
cluster_group = tanzu-mission-control_cluster_group.create_cluster_group.name // Default: default
cluster_group = tanzu-mission-control_cluster_group.cluster_group.name // Default: default
}

ready_wait_timeout = "15m" # Default: waits until 3 min for the cluster to become ready
// The deployment link and the command needed to be run to attach this cluster would be provided in the output.status.execution_cmd
}

# Create basic Repository Credential
resource "tanzu-mission-control_repository_credential" "create_cluster_source_secret_username_password" {
resource "tanzu-mission-control_repository_credential" "cluster_source_secret_username_password" {
name = "tf-secret" # Required

scope {
Expand All @@ -119,7 +119,7 @@ resource "tanzu-mission-control_repository_credential" "create_cluster_source_se
}

# Create cluster level Git Repository with basic authentication
resource "tanzu-mission-control_git_repository" "create_cluster_git_repository" {
resource "tanzu-mission-control_git_repository" "cluster_git_repository" {
name = "tf-git-repository-name" # Required

namespace_name = "tf-namespace" #Required
Expand All @@ -139,7 +139,7 @@ resource "tanzu-mission-control_git_repository" "create_cluster_git_repository"

spec {
url = "testGitRepositoryURL" # Required
secret_ref = tanzu-mission-control_repository_credential.create_cluster_source_secret_username_password.name
secret_ref = tanzu-mission-control_repository_credential.cluster_source_secret_username_password.name
interval = "10m" # Default: 5m
git_implementation = "GO_GIT" # Default: GO_GIT
ref {
Expand All @@ -152,7 +152,7 @@ resource "tanzu-mission-control_git_repository" "create_cluster_git_repository"
}

# Create cluster level Kustomization
resource "tanzu-mission-control_kustomization" "create_cluster_kustomization" {
resource "tanzu-mission-control_kustomization" "cluster_kustomization" {
name = "tf-kustomization-name" # Required

namespace_name = "tf-namespace" #Required
Expand All @@ -176,8 +176,8 @@ resource "tanzu-mission-control_kustomization" "create_cluster_kustomization" {
interval = "10m" # Default: 5m
target_namespace = "testTargetNamespace"
source {
name = tanzu-mission-control_git_repository.create_cluster_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.create_cluster_git_repository.namespace_name # Required
name = tanzu-mission-control_git_repository.cluster_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.cluster_git_repository.namespace_name # Required
}
}
}
Expand All @@ -200,7 +200,7 @@ terraform {
}

# Create cluster group
resource "tanzu-mission-control_cluster_group" "create_cluster_group" {
resource "tanzu-mission-control_cluster_group" "cluster_group" {
name = "demo-cluster-group"
}

Expand All @@ -222,15 +222,15 @@ resource "tanzu-mission-control_cluster" "attach_cluster_with_kubeconfig" {
}

spec {
cluster_group = tanzu-mission-control_cluster_group.create_cluster_group.name // Default: default
cluster_group = tanzu-mission-control_cluster_group.cluster_group.name // Default: default
}

ready_wait_timeout = "15m" # Default: waits until 3 min for the cluster to become ready
// The deployment link and the command needed to be run to attach this cluster would be provided in the output.status.execution_cmd
}

# Create cluster level Git Repository
resource "tanzu-mission-control_git_repository" "create_cluster_git_repository" {
resource "tanzu-mission-control_git_repository" "cluster_git_repository" {
name = "tf-git-repository-name" # Required

namespace_name = "tf-namespace" #Required
Expand Down Expand Up @@ -262,7 +262,7 @@ resource "tanzu-mission-control_git_repository" "create_cluster_git_repository"
}

# Create cluster level Kustomization
resource "tanzu-mission-control_kustomization" "create_cluster_kustomization" {
resource "tanzu-mission-control_kustomization" "cluster_kustomization" {
name = "tf-kustomization-name" # Required

namespace_name = "tf-namespace" #Required
Expand All @@ -286,8 +286,8 @@ resource "tanzu-mission-control_kustomization" "create_cluster_kustomization" {
interval = "10m" # Default: 5m
target_namespace = "testTargetNamespace"
source {
name = tanzu-mission-control_git_repository.create_cluster_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.create_cluster_git_repository.namespace_name # Required
name = tanzu-mission-control_git_repository.cluster_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.cluster_git_repository.namespace_name # Required
}
}
}
Expand All @@ -312,7 +312,7 @@ terraform {
}

# Create cluster group
resource "tanzu-mission-control_cluster_group" "create_cluster_group" {
resource "tanzu-mission-control_cluster_group" "cluster_group" {
name = "demo-cluster-group"
}

Expand All @@ -334,15 +334,15 @@ resource "tanzu-mission-control_cluster" "attach_cluster_with_kubeconfig" {
}

spec {
cluster_group = tanzu-mission-control_cluster_group.create_cluster_group.name // Default: default
cluster_group = tanzu-mission-control_cluster_group.cluster_group.name // Default: default
}

ready_wait_timeout = "15m" # Default: waits until 3 min for the cluster to become ready
// The deployment link and the command needed to be run to attach this cluster would be provided in the output.status.execution_cmd
}

# Create cluster level Repository Credential
resource "tanzu-mission-control_repository_credential" "create_cluster_source_secret_ssh" {
resource "tanzu-mission-control_repository_credential" "cluster_source_secret_ssh" {
name = "tf-secret" # Required

scope {
Expand Down Expand Up @@ -386,17 +386,17 @@ terraform {
}

# Create cluster group
resource "tanzu-mission-control_cluster_group" "create_cluster_group" {
resource "tanzu-mission-control_cluster_group" "cluster_group" {
name = "demo-cluster-group"
}

# Create cluster group level SSH key type Repository Credential
resource "tanzu-mission-control_repository_credential" "create_cluster_source_secret_ssh" {
resource "tanzu-mission-control_repository_credential" "cluster_source_secret_ssh" {
name = "tf-secret" # Required

scope {
cluster_group {
name = tanzu-mission-control_cluster_group.create_cluster_group.name
name = tanzu-mission-control_cluster_group.cluster_group.name
}
}

Expand All @@ -417,14 +417,14 @@ resource "tanzu-mission-control_repository_credential" "create_cluster_source_se


# Create cluster group level Git Repository with SSH key type authentication
resource "tanzu-mission-control_git_repository" "create_cluster_group_git_repository" {
resource "tanzu-mission-control_git_repository" "cluster_group_git_repository" {
name = "tf-git-repository-name" # Required

namespace_name = "tf-namespace" #Required

scope {
cluster_group {
cluster_group = tanzu-mission-control_cluster_group.create_cluster_group.name
cluster_group = tanzu-mission-control_cluster_group.cluster_group.name
}
}

Expand All @@ -435,7 +435,7 @@ resource "tanzu-mission-control_git_repository" "create_cluster_group_git_reposi

spec {
url = "testGitRepositoryURL" # Required
secret_ref = tanzu-mission-control_repository_credential.create_cluster_source_secret_ssh.name
secret_ref = tanzu-mission-control_repository_credential.cluster_source_secret_ssh.name
interval = "10m" # Default: 5m
git_implementation = "GO_GIT" # Default: GO_GIT
ref {
Expand All @@ -449,14 +449,14 @@ resource "tanzu-mission-control_git_repository" "create_cluster_group_git_reposi


# Create cluster group level Kustomization
resource "tanzu-mission-control_kustomization" "create_cluster_group_kustomization" {
resource "tanzu-mission-control_kustomization" "cluster_group_kustomization" {
name = "tf-kustomization-name" # Required

namespace_name = "tf-namespace" #Required

scope {
cluster_group {
cluster_group = tanzu-mission-control_cluster_group.create_cluster_group.name
cluster_group = tanzu-mission-control_cluster_group.cluster_group.name
}
}

Expand All @@ -471,8 +471,8 @@ resource "tanzu-mission-control_kustomization" "create_cluster_group_kustomizati
interval = "10m" # Default: 5m
target_namespace = "testTargetNamespace"
source {
name = tanzu-mission-control_git_repository.create_cluster_group_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.create_cluster_group_git_repository.namespace_name # Required
name = tanzu-mission-control_git_repository.cluster_group_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.cluster_group_git_repository.namespace_name # Required
}
}
}
Expand All @@ -495,19 +495,19 @@ terraform {
}

# Create cluster group
resource "tanzu-mission-control_cluster_group" "create_cluster_group" {
resource "tanzu-mission-control_cluster_group" "cluster_group" {
name = "demo-cluster-group"
}

# Create cluster group level Git Repository
resource "tanzu-mission-control_git_repository" "create_cluster_git_repository" {
resource "tanzu-mission-control_git_repository" "cluster_git_repository" {
name = "tf-git-repository-name" # Required

namespace_name = "tf-namespace" #Required

scope {
cluster_group {
name = tanzu-mission-control_cluster_group.create_cluster_group.name
name = tanzu-mission-control_cluster_group.cluster_group.name
}
}

Expand All @@ -530,14 +530,14 @@ resource "tanzu-mission-control_git_repository" "create_cluster_git_repository"
}

# Create cluster group level Kustomization
resource "tanzu-mission-control_kustomization" "create_cluster_kustomization" {
resource "tanzu-mission-control_kustomization" "cluster_kustomization" {
name = "tf-kustomization-name" # Required

namespace_name = "tf-namespace" #Required

scope {
cluster_group {
name = tanzu-mission-control_cluster_group.create_cluster_group.name
name = tanzu-mission-control_cluster_group.cluster_group.name
}
}

Expand All @@ -552,8 +552,8 @@ resource "tanzu-mission-control_kustomization" "create_cluster_kustomization" {
interval = "10m" # Default: 5m
target_namespace = "testTargetNamespace"
source {
name = tanzu-mission-control_git_repository.create_cluster_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.create_cluster_git_repository.namespace_name # Required
name = tanzu-mission-control_git_repository.cluster_git_repository.name # Required
namespace = tanzu-mission-control_git_repository.cluster_git_repository.namespace_name # Required
}
}
}
Expand Down
Loading
Loading