mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-04-30 20:34:37 +02:00
feat!: Removed support for launch configuration and replace count with for_each (#1680)
This commit is contained in:
78
examples/user_data/README.md
Normal file
78
examples/user_data/README.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Internal User Data Module
|
||||
|
||||
Configuration in this directory render various user data outputs used for testing and validating the internal `_user-data` sub-module.
|
||||
|
||||
## Usage
|
||||
|
||||
To run this example you need to execute:
|
||||
|
||||
```bash
|
||||
$ terraform init
|
||||
$ terraform plan
|
||||
$ terraform apply
|
||||
```
|
||||
|
||||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
||||
## Requirements
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
|
||||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.64 |
|
||||
|
||||
## Providers
|
||||
|
||||
No providers.
|
||||
|
||||
## Modules
|
||||
|
||||
| Name | Source | Version |
|
||||
|------|--------|---------|
|
||||
| <a name="module_eks_mng_bottlerocket_additional"></a> [eks\_mng\_bottlerocket\_additional](#module\_eks\_mng\_bottlerocket\_additional) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_bottlerocket_custom_ami"></a> [eks\_mng\_bottlerocket\_custom\_ami](#module\_eks\_mng\_bottlerocket\_custom\_ami) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_bottlerocket_custom_template"></a> [eks\_mng\_bottlerocket\_custom\_template](#module\_eks\_mng\_bottlerocket\_custom\_template) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_bottlerocket_no_op"></a> [eks\_mng\_bottlerocket\_no\_op](#module\_eks\_mng\_bottlerocket\_no\_op) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_linux_additional"></a> [eks\_mng\_linux\_additional](#module\_eks\_mng\_linux\_additional) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_linux_custom_ami"></a> [eks\_mng\_linux\_custom\_ami](#module\_eks\_mng\_linux\_custom\_ami) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_linux_custom_template"></a> [eks\_mng\_linux\_custom\_template](#module\_eks\_mng\_linux\_custom\_template) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_eks_mng_linux_no_op"></a> [eks\_mng\_linux\_no\_op](#module\_eks\_mng\_linux\_no\_op) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_bottlerocket_bootstrap"></a> [self\_mng\_bottlerocket\_bootstrap](#module\_self\_mng\_bottlerocket\_bootstrap) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_bottlerocket_custom_template"></a> [self\_mng\_bottlerocket\_custom\_template](#module\_self\_mng\_bottlerocket\_custom\_template) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_bottlerocket_no_op"></a> [self\_mng\_bottlerocket\_no\_op](#module\_self\_mng\_bottlerocket\_no\_op) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_linux_bootstrap"></a> [self\_mng\_linux\_bootstrap](#module\_self\_mng\_linux\_bootstrap) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_linux_custom_template"></a> [self\_mng\_linux\_custom\_template](#module\_self\_mng\_linux\_custom\_template) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_linux_no_op"></a> [self\_mng\_linux\_no\_op](#module\_self\_mng\_linux\_no\_op) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_windows_bootstrap"></a> [self\_mng\_windows\_bootstrap](#module\_self\_mng\_windows\_bootstrap) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_windows_custom_template"></a> [self\_mng\_windows\_custom\_template](#module\_self\_mng\_windows\_custom\_template) | ../../modules/_user_data | n/a |
|
||||
| <a name="module_self_mng_windows_no_op"></a> [self\_mng\_windows\_no\_op](#module\_self\_mng\_windows\_no\_op) | ../../modules/_user_data | n/a |
|
||||
|
||||
## Resources
|
||||
|
||||
No resources.
|
||||
|
||||
## Inputs
|
||||
|
||||
No inputs.
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| <a name="output_eks_mng_bottlerocket_additional"></a> [eks\_mng\_bottlerocket\_additional](#output\_eks\_mng\_bottlerocket\_additional) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_bottlerocket_custom_ami"></a> [eks\_mng\_bottlerocket\_custom\_ami](#output\_eks\_mng\_bottlerocket\_custom\_ami) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_bottlerocket_custom_template"></a> [eks\_mng\_bottlerocket\_custom\_template](#output\_eks\_mng\_bottlerocket\_custom\_template) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_bottlerocket_no_op"></a> [eks\_mng\_bottlerocket\_no\_op](#output\_eks\_mng\_bottlerocket\_no\_op) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_linux_additional"></a> [eks\_mng\_linux\_additional](#output\_eks\_mng\_linux\_additional) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_linux_custom_ami"></a> [eks\_mng\_linux\_custom\_ami](#output\_eks\_mng\_linux\_custom\_ami) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_linux_custom_template"></a> [eks\_mng\_linux\_custom\_template](#output\_eks\_mng\_linux\_custom\_template) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_eks_mng_linux_no_op"></a> [eks\_mng\_linux\_no\_op](#output\_eks\_mng\_linux\_no\_op) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_bottlerocket_bootstrap"></a> [self\_mng\_bottlerocket\_bootstrap](#output\_self\_mng\_bottlerocket\_bootstrap) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_bottlerocket_custom_template"></a> [self\_mng\_bottlerocket\_custom\_template](#output\_self\_mng\_bottlerocket\_custom\_template) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_bottlerocket_no_op"></a> [self\_mng\_bottlerocket\_no\_op](#output\_self\_mng\_bottlerocket\_no\_op) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_linux_bootstrap"></a> [self\_mng\_linux\_bootstrap](#output\_self\_mng\_linux\_bootstrap) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_linux_custom_template"></a> [self\_mng\_linux\_custom\_template](#output\_self\_mng\_linux\_custom\_template) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_linux_no_op"></a> [self\_mng\_linux\_no\_op](#output\_self\_mng\_linux\_no\_op) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_windows_bootstrap"></a> [self\_mng\_windows\_bootstrap](#output\_self\_mng\_windows\_bootstrap) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_windows_custom_template"></a> [self\_mng\_windows\_custom\_template](#output\_self\_mng\_windows\_custom\_template) | Base64 decoded user data rendered for the provided inputs |
|
||||
| <a name="output_self_mng_windows_no_op"></a> [self\_mng\_windows\_no\_op](#output\_self\_mng\_windows\_no\_op) | Base64 decoded user data rendered for the provided inputs |
|
||||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
||||
289
examples/user_data/main.tf
Normal file
289
examples/user_data/main.tf
Normal file
@@ -0,0 +1,289 @@
|
||||
locals {
|
||||
name = "ex-${replace(basename(path.cwd), "_", "-")}"
|
||||
|
||||
cluster_endpoint = "https://012345678903AB2BAE5D1E0BFE0E2B50.gr7.us-east-1.eks.amazonaws.com"
|
||||
cluster_auth_base64 = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKbXFqQ1VqNGdGR2w3ZW5PeWthWnZ2RjROOTVOUEZCM2o0cGhVZUsrWGFtN2ZSQnZya0d6OGxKZmZEZWF2b2plTwpQK2xOZFlqdHZncmxCUEpYdHZIZmFzTzYxVzdIZmdWQ2EvamdRM2w3RmkvL1dpQmxFOG9oWUZkdWpjc0s1SXM2CnNkbk5KTTNYUWN2TysrSitkV09NT2ZlNzlsSWdncmdQLzgvRU9CYkw3eUY1aU1hS3lsb1RHL1V3TlhPUWt3ZUcKblBNcjdiUmdkQ1NCZTlXYXowOGdGRmlxV2FOditsTDhsODBTdFZLcWVNVlUxbjQyejVwOVpQRTd4T2l6L0xTNQpYV2lXWkVkT3pMN0xBWGVCS2gzdkhnczFxMkI2d1BKZnZnS1NzWllQRGFpZTloT1NNOUJkNFNPY3JrZTRYSVBOCkVvcXVhMlYrUDRlTWJEQzhMUkVWRDdCdVZDdWdMTldWOTBoL3VJUy9WU2VOcEdUOGVScE5DakszSjc2aFlsWm8KWjNGRG5QWUY0MWpWTHhiOXF0U1ROdEp6amYwWXBEYnFWci9xZzNmQWlxbVorMzd3YWM1eHlqMDZ4cmlaRUgzZgpUM002d2lCUEVHYVlGeWN5TmNYTk5aYW9DWDJVL0N1d2JsUHAKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ=="
|
||||
cluster_service_ipv4_cidr = "172.16.0.0/16"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# User Data Module
|
||||
################################################################################
|
||||
|
||||
# EKS managed node group - linux
|
||||
module "eks_mng_linux_no_op" {
|
||||
source = "../../modules/_user_data"
|
||||
}
|
||||
|
||||
module "eks_mng_linux_additional" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
echo "foo"
|
||||
export FOO=bar
|
||||
EOT
|
||||
|
||||
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=node.kubernetes.io/lifecycle=spot'"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
echo "All done"
|
||||
EOT
|
||||
}
|
||||
|
||||
module "eks_mng_linux_custom_ami" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
cluster_service_ipv4_cidr = local.cluster_service_ipv4_cidr
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
echo "foo"
|
||||
export FOO=bar
|
||||
EOT
|
||||
|
||||
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=node.kubernetes.io/lifecycle=spot'"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
echo "All done"
|
||||
EOT
|
||||
}
|
||||
|
||||
|
||||
module "eks_mng_linux_custom_template" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
user_data_template_path = "${path.module}/templates/linux_custom.tpl"
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
echo "foo"
|
||||
export FOO=bar
|
||||
EOT
|
||||
|
||||
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=node.kubernetes.io/lifecycle=spot'"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
echo "All done"
|
||||
EOT
|
||||
}
|
||||
|
||||
# EKS managed node group - bottlerocket
|
||||
module "eks_mng_bottlerocket_no_op" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
}
|
||||
|
||||
module "eks_mng_bottlerocket_additional" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
|
||||
bootstrap_extra_args = <<-EOT
|
||||
# extra args added
|
||||
[settings.kernel]
|
||||
lockdown = "integrity"
|
||||
EOT
|
||||
}
|
||||
|
||||
module "eks_mng_bottlerocket_custom_ami" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
|
||||
bootstrap_extra_args = <<-EOT
|
||||
# extra args added
|
||||
[settings.kernel]
|
||||
lockdown = "integrity"
|
||||
EOT
|
||||
}
|
||||
|
||||
module "eks_mng_bottlerocket_custom_template" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
user_data_template_path = "${path.module}/templates/bottlerocket_custom.tpl"
|
||||
|
||||
bootstrap_extra_args = <<-EOT
|
||||
# extra args added
|
||||
[settings.kernel]
|
||||
lockdown = "integrity"
|
||||
EOT
|
||||
}
|
||||
|
||||
# Self managed node group - linux
|
||||
module "self_mng_linux_no_op" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
is_eks_managed_node_group = false
|
||||
}
|
||||
|
||||
module "self_mng_linux_bootstrap" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
is_eks_managed_node_group = false
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
echo "foo"
|
||||
export FOO=bar
|
||||
EOT
|
||||
|
||||
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=node.kubernetes.io/lifecycle=spot'"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
echo "All done"
|
||||
EOT
|
||||
}
|
||||
|
||||
module "self_mng_linux_custom_template" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
is_eks_managed_node_group = false
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
user_data_template_path = "${path.module}/templates/linux_custom.tpl"
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
echo "foo"
|
||||
export FOO=bar
|
||||
EOT
|
||||
|
||||
bootstrap_extra_args = "--kubelet-extra-args '--node-labels=node.kubernetes.io/lifecycle=spot'"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
echo "All done"
|
||||
EOT
|
||||
}
|
||||
|
||||
# Self managed node group - bottlerocket
|
||||
module "self_mng_bottlerocket_no_op" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
|
||||
is_eks_managed_node_group = false
|
||||
}
|
||||
|
||||
module "self_mng_bottlerocket_bootstrap" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
is_eks_managed_node_group = false
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
bootstrap_extra_args = <<-EOT
|
||||
# extra args added
|
||||
[settings.kernel]
|
||||
lockdown = "integrity"
|
||||
EOT
|
||||
}
|
||||
|
||||
module "self_mng_bottlerocket_custom_template" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "bottlerocket"
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
is_eks_managed_node_group = false
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
user_data_template_path = "${path.module}/templates/bottlerocket_custom.tpl"
|
||||
|
||||
bootstrap_extra_args = <<-EOT
|
||||
# extra args added
|
||||
[settings.kernel]
|
||||
lockdown = "integrity"
|
||||
EOT
|
||||
}
|
||||
|
||||
# Self managed node group - windows
|
||||
module "self_mng_windows_no_op" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "windows"
|
||||
|
||||
is_eks_managed_node_group = false
|
||||
}
|
||||
|
||||
module "self_mng_windows_bootstrap" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "windows"
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
is_eks_managed_node_group = false
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
[string]$Something = 'IDoNotKnowAnyPowerShell ¯\_(ツ)_/¯'
|
||||
EOT
|
||||
# I don't know if this is the right way on WindowsOS, but its just a string check here anyways
|
||||
bootstrap_extra_args = "-KubeletExtraArgs --node-labels=node.kubernetes.io/lifecycle=spot"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
[string]$Something = 'IStillDoNotKnowAnyPowerShell ¯\_(ツ)_/¯'
|
||||
EOT
|
||||
}
|
||||
|
||||
module "self_mng_windows_custom_template" {
|
||||
source = "../../modules/_user_data"
|
||||
|
||||
platform = "windows"
|
||||
|
||||
enable_bootstrap_user_data = true
|
||||
is_eks_managed_node_group = false
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_endpoint = local.cluster_endpoint
|
||||
cluster_auth_base64 = local.cluster_auth_base64
|
||||
|
||||
user_data_template_path = "${path.module}/templates/windows_custom.tpl"
|
||||
|
||||
pre_bootstrap_user_data = <<-EOT
|
||||
[string]$Something = 'IDoNotKnowAnyPowerShell ¯\_(ツ)_/¯'
|
||||
EOT
|
||||
# I don't know if this is the right way on WindowsOS, but its just a string check here anyways
|
||||
bootstrap_extra_args = "-KubeletExtraArgs --node-labels=node.kubernetes.io/lifecycle=spot"
|
||||
|
||||
post_bootstrap_user_data = <<-EOT
|
||||
[string]$Something = 'IStillDoNotKnowAnyPowerShell ¯\_(ツ)_/¯'
|
||||
EOT
|
||||
}
|
||||
89
examples/user_data/outputs.tf
Normal file
89
examples/user_data/outputs.tf
Normal file
@@ -0,0 +1,89 @@
|
||||
# EKS managed node group - linux
|
||||
output "eks_mng_linux_no_op" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_linux_no_op.user_data)
|
||||
}
|
||||
|
||||
output "eks_mng_linux_additional" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_linux_additional.user_data)
|
||||
}
|
||||
|
||||
output "eks_mng_linux_custom_ami" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_linux_custom_ami.user_data)
|
||||
}
|
||||
|
||||
output "eks_mng_linux_custom_template" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_linux_custom_template.user_data)
|
||||
}
|
||||
|
||||
# EKS managed node group - bottlerocket
|
||||
output "eks_mng_bottlerocket_no_op" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_bottlerocket_no_op.user_data)
|
||||
}
|
||||
|
||||
output "eks_mng_bottlerocket_additional" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_bottlerocket_additional.user_data)
|
||||
}
|
||||
|
||||
output "eks_mng_bottlerocket_custom_ami" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_bottlerocket_custom_ami.user_data)
|
||||
}
|
||||
|
||||
output "eks_mng_bottlerocket_custom_template" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.eks_mng_bottlerocket_custom_template.user_data)
|
||||
}
|
||||
|
||||
# Self managed node group - linux
|
||||
output "self_mng_linux_no_op" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_linux_no_op.user_data)
|
||||
}
|
||||
|
||||
output "self_mng_linux_bootstrap" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_linux_bootstrap.user_data)
|
||||
}
|
||||
|
||||
output "self_mng_linux_custom_template" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_linux_custom_template.user_data)
|
||||
}
|
||||
|
||||
# Self managed node group - bottlerocket
|
||||
output "self_mng_bottlerocket_no_op" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_bottlerocket_no_op.user_data)
|
||||
}
|
||||
|
||||
output "self_mng_bottlerocket_bootstrap" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_bottlerocket_bootstrap.user_data)
|
||||
}
|
||||
|
||||
output "self_mng_bottlerocket_custom_template" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_bottlerocket_custom_template.user_data)
|
||||
}
|
||||
|
||||
# Self managed node group - windows
|
||||
output "self_mng_windows_no_op" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_windows_no_op.user_data)
|
||||
}
|
||||
|
||||
output "self_mng_windows_bootstrap" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_windows_bootstrap.user_data)
|
||||
}
|
||||
|
||||
output "self_mng_windows_custom_template" {
|
||||
description = "Base64 decoded user data rendered for the provided inputs"
|
||||
value = base64decode(module.self_mng_windows_custom_template.user_data)
|
||||
}
|
||||
7
examples/user_data/templates/bottlerocket_custom.tpl
Normal file
7
examples/user_data/templates/bottlerocket_custom.tpl
Normal file
@@ -0,0 +1,7 @@
|
||||
# Custom user data template provided for rendering
|
||||
[settings.kubernetes]
|
||||
"cluster-name" = "${cluster_name}"
|
||||
"api-server" = "${cluster_endpoint}"
|
||||
"cluster-certificate" = "${cluster_auth_base64}"
|
||||
|
||||
${bootstrap_extra_args~}
|
||||
10
examples/user_data/templates/linux_custom.tpl
Normal file
10
examples/user_data/templates/linux_custom.tpl
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
${pre_bootstrap_user_data ~}
|
||||
|
||||
# Custom user data template provided for rendering
|
||||
B64_CLUSTER_CA=${cluster_auth_base64}
|
||||
API_SERVER_URL=${cluster_endpoint}
|
||||
/etc/eks/bootstrap.sh ${cluster_name} ${bootstrap_extra_args} --b64-cluster-ca $B64_CLUSTER_CA --apiserver-endpoint $API_SERVER_URL
|
||||
${post_bootstrap_user_data ~}
|
||||
10
examples/user_data/templates/windows_custom.tpl
Normal file
10
examples/user_data/templates/windows_custom.tpl
Normal file
@@ -0,0 +1,10 @@
|
||||
# Custom user data template provided for rendering
|
||||
<powershell>
|
||||
${pre_bootstrap_user_data ~}
|
||||
[string]$EKSBinDir = "$env:ProgramFiles\Amazon\EKS"
|
||||
[string]$EKSBootstrapScriptName = 'Start-EKSBootstrap.ps1'
|
||||
[string]$EKSBootstrapScriptFile = "$EKSBinDir\$EKSBootstrapScriptName"
|
||||
& $EKSBootstrapScriptFile -EKSClusterName ${cluster_name} -APIServerEndpoint ${cluster_endpoint} -Base64ClusterCA ${cluster_auth_base64} ${bootstrap_extra_args} 3>&1 4>&1 5>&1 6>&1
|
||||
$LastError = if ($?) { 0 } else { $Error[0].Exception.HResult }
|
||||
${post_bootstrap_user_data ~}
|
||||
</powershell>
|
||||
0
examples/user_data/variables.tf
Normal file
0
examples/user_data/variables.tf
Normal file
10
examples/user_data/versions.tf
Normal file
10
examples/user_data/versions.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
terraform {
|
||||
required_version = ">= 0.13.1"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 3.64"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user