-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added AWS * Support for aws cluster
- Loading branch information
Showing
20 changed files
with
1,100 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
page_title: "spectrocloud_cloudaccount_aws Data Source - terraform-provider-spectrocloud" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# Data Source `spectrocloud_cloudaccount_aws` | ||
|
||
|
||
|
||
|
||
|
||
## Schema | ||
|
||
### Optional | ||
|
||
- **id** (String) The ID of this resource. | ||
- **name** (String) | ||
|
||
### Read-only | ||
|
||
- **aws_access_key** (String) | ||
|
||
|
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,34 @@ | ||
--- | ||
page_title: "spectrocloud_cloudaccount_aws Resource - terraform-provider-spectrocloud" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# Resource `spectrocloud_cloudaccount_aws` | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "spectrocloud_cloudaccount_aws" "aws-1" { | ||
name = "aws-1" | ||
aws_access_key = var.aws_access_key | ||
aws_secret_key = var.aws_secret_key | ||
} | ||
``` | ||
|
||
## Schema | ||
|
||
### Required | ||
|
||
- **aws_access_key** (String) | ||
- **aws_secret_key** (String, Sensitive) | ||
- **name** (String) | ||
|
||
### Optional | ||
|
||
- **id** (String) The ID of this resource. | ||
|
||
|
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,142 @@ | ||
--- | ||
page_title: "spectrocloud_cluster_aws Resource - terraform-provider-spectrocloud" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# Resource `spectrocloud_cluster_aws` | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "spectrocloud_cloudaccount_aws" "account" { | ||
# id = <uid> | ||
name = var.cluster_cloud_account_name | ||
} | ||
data "spectrocloud_cluster_profile" "profile" { | ||
# id = <uid> | ||
name = var.cluster_cluster_profile_name | ||
} | ||
resource "spectrocloud_cluster_aws" "cluster" { | ||
name = var.cluster_name | ||
cluster_profile_id = data.spectrocloud_cluster_profile.profile.id | ||
cloud_account_id = data.spectrocloud_cloudaccount_aws.account.id | ||
cloud_config { | ||
ssh_key_name = "default" | ||
region = "us-west-2" | ||
} | ||
# To override or specify values for a cluster: | ||
# pack { | ||
# name = "spectro-byo-manifest" | ||
# tag = "1.0.x" | ||
# values = <<-EOT | ||
# manifests: | ||
# byo-manifest: | ||
# contents: | | ||
# # Add manifests here | ||
# apiVersion: v1 | ||
# kind: Namespace | ||
# metadata: | ||
# labels: | ||
# app: wordpress | ||
# app2: wordpress2 | ||
# name: wordpress | ||
# EOT | ||
# } | ||
machine_pool { | ||
control_plane = true | ||
control_plane_as_worker = true | ||
name = "master-pool" | ||
count = 1 | ||
instance_type = "t3.large" | ||
disk_size_gb = 62 | ||
azs = ["us-west-2a"] | ||
} | ||
machine_pool { | ||
name = "worker-basic" | ||
count = 1 | ||
instance_type = "t3.large" | ||
azs = ["us-west-2a"] | ||
} | ||
} | ||
``` | ||
|
||
## Schema | ||
|
||
### Required | ||
|
||
- **cloud_account_id** (String) | ||
- **cloud_config** (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--cloud_config)) | ||
- **cluster_profile_id** (String) | ||
- **machine_pool** (Block Set, Min: 1) (see [below for nested schema](#nestedblock--machine_pool)) | ||
- **name** (String) | ||
|
||
### Optional | ||
|
||
- **id** (String) The ID of this resource. | ||
- **pack** (Block Set) (see [below for nested schema](#nestedblock--pack)) | ||
- **timeouts** (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) | ||
|
||
### Read-only | ||
|
||
- **cloud_config_id** (String) | ||
|
||
<a id="nestedblock--cloud_config"></a> | ||
### Nested Schema for `cloud_config` | ||
|
||
Required: | ||
|
||
- **region** (String) | ||
- **ssh_key_name** (String) | ||
|
||
|
||
<a id="nestedblock--machine_pool"></a> | ||
### Nested Schema for `machine_pool` | ||
|
||
Required: | ||
|
||
- **azs** (Set of String) | ||
- **count** (Number) | ||
- **instance_type** (String) | ||
- **name** (String) | ||
|
||
Optional: | ||
|
||
- **control_plane** (Boolean) | ||
- **control_plane_as_worker** (Boolean) | ||
- **disk_size_gb** (Number) | ||
- **update_strategy** (String) | ||
|
||
|
||
<a id="nestedblock--pack"></a> | ||
### Nested Schema for `pack` | ||
|
||
Required: | ||
|
||
- **name** (String) | ||
- **tag** (String) | ||
- **values** (String) | ||
|
||
|
||
<a id="nestedblock--timeouts"></a> | ||
### Nested Schema for `timeouts` | ||
|
||
Optional: | ||
|
||
- **create** (String) | ||
- **delete** (String) | ||
- **update** (String) | ||
|
||
|
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
15 changes: 15 additions & 0 deletions
15
examples/resources/spectrocloud_cloudaccount_aws/providers.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,15 @@ | ||
terraform { | ||
required_providers { | ||
spectrocloud = { | ||
version = ">= 0.1" | ||
source = "spectrocloud/spectrocloud" | ||
} | ||
} | ||
} | ||
|
||
provider "spectrocloud" { | ||
host = var.sc_host | ||
username = var.sc_username | ||
password = var.sc_password | ||
project_name = var.sc_project_name | ||
} |
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,5 @@ | ||
resource "spectrocloud_cloudaccount_aws" "aws-1" { | ||
name = "aws-1" | ||
aws_access_key = var.aws_access_key | ||
aws_secret_key = var.aws_secret_key | ||
} |
2 changes: 2 additions & 0 deletions
2
examples/resources/spectrocloud_cloudaccount_aws/terraform.template.tfvars
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,2 @@ | ||
aws_access_key = "<...>" | ||
aws_secret_key = "<...>" |
7 changes: 7 additions & 0 deletions
7
examples/resources/spectrocloud_cloudaccount_aws/variables.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,7 @@ | ||
variable "sc_host" {} | ||
variable "sc_username" {} | ||
variable "sc_password" {} | ||
variable "sc_project_name" {} | ||
|
||
variable "aws_access_key" {} | ||
variable "aws_secret_key" {} |
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,15 @@ | ||
terraform { | ||
required_providers { | ||
spectrocloud = { | ||
version = ">= 0.1" | ||
source = "spectrocloud/spectrocloud" | ||
} | ||
} | ||
} | ||
|
||
provider "spectrocloud" { | ||
host = var.sc_host | ||
username = var.sc_username | ||
password = var.sc_password | ||
project_name = var.sc_project_name | ||
} |
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,59 @@ | ||
data "spectrocloud_cloudaccount_aws" "account" { | ||
# id = <uid> | ||
name = var.cluster_cloud_account_name | ||
} | ||
|
||
data "spectrocloud_cluster_profile" "profile" { | ||
# id = <uid> | ||
name = var.cluster_cluster_profile_name | ||
} | ||
|
||
|
||
resource "spectrocloud_cluster_aws" "cluster" { | ||
name = var.cluster_name | ||
cluster_profile_id = data.spectrocloud_cluster_profile.profile.id | ||
cloud_account_id = data.spectrocloud_cloudaccount_aws.account.id | ||
|
||
cloud_config { | ||
ssh_key_name = "default" | ||
region = "us-west-2" | ||
} | ||
|
||
# To override or specify values for a cluster: | ||
|
||
# pack { | ||
# name = "spectro-byo-manifest" | ||
# tag = "1.0.x" | ||
# values = <<-EOT | ||
# manifests: | ||
# byo-manifest: | ||
# contents: | | ||
# # Add manifests here | ||
# apiVersion: v1 | ||
# kind: Namespace | ||
# metadata: | ||
# labels: | ||
# app: wordpress | ||
# app2: wordpress2 | ||
# name: wordpress | ||
# EOT | ||
# } | ||
|
||
machine_pool { | ||
control_plane = true | ||
control_plane_as_worker = true | ||
name = "master-pool" | ||
count = 1 | ||
instance_type = "t3.large" | ||
disk_size_gb = 62 | ||
azs = ["us-west-2a"] | ||
} | ||
|
||
machine_pool { | ||
name = "worker-basic" | ||
count = 1 | ||
instance_type = "t3.large" | ||
azs = ["us-west-2a"] | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
examples/resources/spectrocloud_cluster_aws/terraform.template.tfvars
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,4 @@ | ||
cluster_cloud_account_name = "aws-1" | ||
cluster_cluster_profile_name = "ProdAWS" | ||
|
||
cluster_name = "aws-2" |
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,9 @@ | ||
variable "sc_host" {} | ||
variable "sc_username" {} | ||
variable "sc_password" {} | ||
variable "sc_project_name" {} | ||
|
||
variable "cluster_cloud_account_name" {} | ||
variable "cluster_cluster_profile_name" {} | ||
|
||
variable "cluster_name" {} |
Oops, something went wrong.