Skip to content

spectrocloud/terraform-spectrocloud-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spectrocloud Terraform Modules.

Spectro Cloud module is a container for all Palette resources that are used together. You can use modules to create lightweight abstractions, using yaml files translated into Terraform.

Disclaimer

This repository serves as a demonstration for utilizing the SpectroCloud Terraform Provider to create resources using YAML as a source. SpectroCloud does not actively maintain or provide modules support for all active Spectrocloud Terraform Provider releases/features.

This repository can be forked and customized to meet your specific requirements.

Module structure.

Create yaml files such as: cluster.yaml, profile.yaml, main.tf and others describing the cloud resources and module configuration. More examples could be found here.

The list of Spectro Cloud module supported cloud types are:

  • EKS
  • AKS
  • VMware
  • Edge

Additional Spectro Cloud resources supported:

  • cloud accounts for supported cloud types
  • alerts
  • cluster profiles
  • addon deployments
  • appliances
  • backup storage locations
  • registries
  • projects
  • teams
  • macros
  • application profiles

1. Users can provision multiple resources from different modules and define and set as many parameters as required with unique names (duplicate names are not recommended).

module "SpectroAcc" {

accounts = {
for k in fileset("config/account", "account-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/account/${k}", local.accounts_params))
}
}

module "SpectroOrg" {

profiles = {
for k in fileset("config/profile", "profile-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/profile/${k}", local.profile_params))
}
}

module "SpectroProject" {

clusters = {
for k in fileset("config/cluster", "cluster-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/cluster/${k}", local.project_params))
}
1. Provision cloud accounts:
terraform apply -target module.SpectroAcc.spectrocloud_cloudaccount_aws.account 2. Provision profiles:
terraform apply -target module.SpectroOrg.spectrocloud_cluster_profile.profile_resource 3. Provision clusters:
terraform apply -target module.SpectroProject.spectrocloud_cluster_eks.this 4. Provision addon deployments:
terraform apply -target module.SpectroProject.spectrocloud_addon_deployment.this

2. Use reverse commands order to de-provision resources:

1. terraform destroy -target module.SpectroProject.spectrocloud_addon_deployment.this
2. terraform destroy -target module.SpectroProject.spectrocloud_cluster_eks.this
3. terraform destroy -target module.SpectroOrg.spectrocloud_cluster_profile.profile_resource
4. terraform destroy -target module.SpectroAcc.spectrocloud_cloudaccount_aws.account

Module Resources & Requirements

Requirements

Name Version
spectrocloud ~> 0.11.0

Providers

Name Version
spectrocloud ~> 0.11.0

Modules

No modules.

Resources

Name Type
spectrocloud_addon_deployment.this resource
spectrocloud_alert.cluster_health_alerts resource
spectrocloud_appliance.appliance resource
spectrocloud_application.app_deployment resource
spectrocloud_application_profile.app_profile resource
spectrocloud_backup_storage_location.bsl resource
spectrocloud_cloudaccount_aws.account resource
spectrocloud_cloudaccount_tencent.account resource
spectrocloud_cluster_edge.this resource
spectrocloud_cluster_edge_vsphere.this resource
spectrocloud_cluster_eks.this resource
spectrocloud_cluster_group.clustergroup resource
spectrocloud_cluster_libvirt.this resource
spectrocloud_cluster_profile.profile_resource resource
spectrocloud_cluster_profile_import.import resource
spectrocloud_cluster_tke.this resource
spectrocloud_cluster_vsphere.this resource
spectrocloud_macro.macro resource
spectrocloud_project.project resource
spectrocloud_registry_helm.helm_registry resource
spectrocloud_registry_oci.oci_registry resource
spectrocloud_team.project_team resource
spectrocloud_virtual_cluster.virtual_cluster resource
spectrocloud_appliance.this data source
spectrocloud_application_profile.app_profile data source
spectrocloud_backup_storage_location.this data source
spectrocloud_cloudaccount_aws.this data source
spectrocloud_cloudaccount_tencent.this data source
spectrocloud_cloudaccount_vsphere.this data source
spectrocloud_cluster.cluster_gps data source
spectrocloud_cluster.clusters data source
spectrocloud_cluster.deployment_cluster data source
spectrocloud_cluster.host_cluster data source
spectrocloud_cluster_group.cluster_group data source
spectrocloud_cluster_group.vir_cluster_group data source
spectrocloud_cluster_profile.this data source
spectrocloud_pack.data_packs data source
spectrocloud_pack_simple.app_source_tiers data source
spectrocloud_registry.all_registries data source
spectrocloud_registry.app_registries data source
spectrocloud_role.data_roles data source

Inputs

Name Description Type Default Required
accounts n/a map(any) {} no
alerts n/a any {} no
appliances n/a map(any) {} no
application_deployments n/a any {} no
application_profiles n/a any {} no
bsls n/a map(any) {} no
cluster_groups n/a any {} no
cluster_profile_imports n/a list(string) [] no
cluster_profile_imports_context n/a string "project" no
clusters n/a map {} no
macros n/a map(any) {} no
profiles n/a map {} no
projects n/a map(any) {} no
registries n/a map(any) {} no
teams n/a map(any) {} no
virtual_clusters n/a any {} no

Outputs

Name Description
debug n/a
debug_addon_pack_manifests n/a
debug_aws_accounts n/a
debug_cluster_infra_profiles_map n/a
debug_cluster_profile_pack_map not addon specific
debug_cluster_system_profiles_map n/a
debug_libvirt_system n/a
debug_system_pack_manifests n/a