-
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.
* Using azs from az-subnet map * az_subnets change
- Loading branch information
1 parent
ed78ec4
commit a5b9787
Showing
5 changed files
with
250 additions
and
71 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
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,203 @@ | ||
--- | ||
page_title: "spectrocloud_cluster_eks Resource - terraform-provider-spectrocloud" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# Resource `spectrocloud_cluster_eks` | ||
|
||
|
||
|
||
## 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_eks" "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 | ||
name = "master-pool" | ||
count = 1 | ||
instance_type = "t3.large" | ||
disk_size_gb = 62 | ||
} | ||
machine_pool { | ||
name = "worker-basic" | ||
count = 1 | ||
instance_type = "t3.large" | ||
} | ||
} | ||
``` | ||
|
||
```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_eks" "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" | ||
vpc_id = "vpc-123" | ||
} | ||
# 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 | ||
name = "master-pool" | ||
count = 1 | ||
instance_type = "t3.large" | ||
disk_size_gb = 62 | ||
az_subnets = { | ||
"us-west-2a" = "subnet-0d4978ddbff16c868" | ||
} | ||
} | ||
machine_pool { | ||
name = "worker-basic" | ||
count = 1 | ||
instance_type = "t3.large" | ||
az_subnets = { | ||
"us-west-2a" = "subnet-0d4978ddbff16c868" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## 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) | ||
- **kubeconfig** (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) | ||
- **disk_size_gb** (Number) | ||
|
||
|
||
<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
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 |
---|---|---|
|
@@ -4,15 +4,6 @@ sc_username = "{enter Spectro Cloud username}" #e.g: [email protected] | |
sc_password = "{enter Spectro Cloud password}" #e.g: supereSecure1! | ||
sc_project_name = "{enter Spectro Cloud project Name}" #e.g: Default | ||
|
||
# Existing SSH Key in AWS | ||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html | ||
aws_ssh_key_name = "{enter AWS SSH key name}" #e.g: default | ||
|
||
# Enter the AWS Region and AZ for cluster resources | ||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions | ||
aws_region = "{enter AWS Region}" #e.g: us-west-2 | ||
aws_region_az = ["{enter AWS Availability Zone A}", "{enter AWS Availability Zone B}"] #e.g: ["us-west-2a", "us-west-2b"] | ||
|
||
|
||
# AWS Cloud Account credentials | ||
# Ensure minimum AWS account permissions: | ||
|
@@ -29,7 +20,14 @@ aws_secret_key = "{enter AWS secret key}" | |
arn = "{enter AWS Arn}" | ||
external_id = "{enter AWS External Id}" | ||
|
||
aws_region_az = ["us-west-2a", "us-west-2b"] #e.g: us-west-2a | ||
|
||
# Existing SSH Key in AWS | ||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html | ||
aws_ssh_key_name = "{enter AWS SSH key name}" #e.g: default | ||
|
||
# Enter the AWS Region and AZ for cluster resources | ||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions | ||
aws_region = "{enter AWS Region}" #e.g: us-west-2 | ||
|
||
master_azs_subnets_map = { | ||
"{enter AWS Availability Zone A}" = "{enter Subnet For Availability Zone A}", | ||
|
Oops, something went wrong.