Commit Graph

70 Commits

Author SHA1 Message Date
Zack A
0d2a4c2af3 feat: Add output for access_policy_associations (#2904)
* add output for access_policy_associations

* wording
2024-02-06 07:48:19 -05:00
Bryant Biggs
6b40bdbb1d feat!: Replace the use of aws-auth configmap with EKS cluster access entry (#2858)
* feat: Replace `resolve_conflicts` with `resolve_conflicts_on_create`/`delete`; raise MSV of AWS provider to `v5.0` to support

* fix: Replace dynamic DNS suffix for `sts:AssumeRole` API calls for static suffix

* feat: Add module tag

* feat: Align Karpenter permissions with Karpenter v1beta1/v0.32 permissions from upstream

* refactor: Move `aws-auth` ConfigMap functionality to its own sub-module

* chore: Update examples

* feat: Add state `moved` block for Karpenter Pod Identity role re-name

* fix: Correct variable `create` description

* feat: Add support for cluster access entries

* chore: Bump MSV of Terraform to `1.3`

* fix: Replace defunct kubectl provider with an updated forked equivalent

* chore: Update and validate examples for access entry; clean up provider usage

* docs: Correct double redundant variable descriptions

* feat: Add support for Cloudwatch log group class argument

* fix: Update usage tag placement, fix Karpenter event spelling, add upcoming changes section to upgrade guide

* feat: Update Karpenter module to generalize naming used and align policy with the upstream Karpenter policy

* feat: Add native support for Windows based managed nodegroups similar to AL2 and Bottlerocket

* feat: Update self-managed nodegroup module to use latest features of ASG

* docs: Update and simplify docs

* fix: Correct variable description for AMI types

* fix: Update upgrade guide with changes; rename Karpenter controller resource names to support migrating for users

* docs: Complete upgrade guide docs for migration and changes applied

* Update examples/karpenter/README.md

Co-authored-by: Anton Babenko <anton@antonbabenko.com>

* Update examples/outposts/README.md

Co-authored-by: Anton Babenko <anton@antonbabenko.com>

* Update modules/karpenter/README.md

Co-authored-by: Anton Babenko <anton@antonbabenko.com>

---------

Co-authored-by: Anton Babenko <anton@antonbabenko.com>
2024-02-02 09:36:25 -05:00
Cody Grant
f977d83500 fix: Add aws_eks_addons.before_compute to the cluster_addons output (#2533)
Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
2023-03-23 12:03:02 -04:00
Bryant Biggs
78027f37e4 feat: Add support for enabling addons before data plane compute is created (#2478) 2023-02-17 07:28:03 -05:00
Andrés Pozo
9adc475bc1 fix: Invalid value for "replace" parameter: argument must not be null. (#2322) 2022-12-06 20:26:12 -05:00
Bryant Biggs
b2e97ca3dc feat!: Add support for Outposts, remove node security group, add support for addon preserve and most_recent configurations (#2250)
Co-authored-by: Anton Babenko <anton@antonbabenko.com>
Resolves undefined
2022-12-05 16:26:23 -05:00
Bryant Biggs
f24de3326d feat: New Karpenter sub-module for easily enabling Karpenter on EKS (#2303) 2022-11-21 13:50:34 -05:00
Bryant Biggs
a74e98017b feat: Add output for cluster TLS certificate SHA1 fingerprint and provider tags to cluster primary security group (#2249) 2022-09-29 15:34:20 -04:00
Bryant Biggs
d2f162b190 fix: Remove empty "" from node group names output when node group creation is disabled (#2197) 2022-08-09 15:25:11 -04:00
Bryant Biggs
75acb09ec5 feat: Add support for creating KMS key for cluster secret encryption (#2121)
* feat: Add support for creating KMS key for cluster secret encryption

* fix: Update naming scheme to include `kms_`
2022-06-28 10:55:39 -04:00
Chris Sng
3feb36927f feat: Apply distinct() on role arns to ensure no duplicated roles in aws-auth configmap (#2097) 2022-06-02 08:12:31 -04:00
Bryant Biggs
c173ba2d62 fix: Add compact() to aws_auth_configmap_yaml for when node groups are set to create = false (#2029) 2022-04-20 18:14:09 +02:00
Bryant Biggs
da3d54cde7 feat: Add support for managing aws-auth configmap using new kubernetes_config_map_v1_data resource (#1999) 2022-04-09 09:15:46 +02:00
Bryant Biggs
fd3a3e9a96 fix: Default to cluster version for EKS and self managed node groups when a cluster_version is not specified (#1963) 2022-03-24 15:56:55 +01:00
Bryant Biggs
8b03b7b85e feat: Add outputs for autoscaling group names created to aid in autoscaling group tagging (#1953) 2022-03-22 22:26:00 +01:00
Bryant Biggs
d3b68479de feat: Add additional output for OIDC provider (issuer URL without leading https://) (#1870) 2022-02-11 22:26:36 +01:00
Kaji
776009d74b fix: Wrong rolearn in aws_auth_configmap_yaml (#1820) 2022-02-01 19:21:51 +01:00
Bryant Biggs
ee9f0c646a feat!: Removed support for launch configuration and replace count with for_each (#1680) 2022-01-05 13:01:31 +01:00
Anton Babenko
2bdf7d7dd6 refactor: Refactoring to match the rest of terraform-aws-modules (#1583) 2021-09-16 11:35:44 +02:00
Thierno IB. BARRY
06e9078bf4 feat: Search for Windows or Linux AMIs only if they are needed (#1371) 2021-05-19 16:47:40 +02:00
Dov Salomon
f7d09a2901 feat: Remove dependency on deprecated hashicorp/template provider (#1297)
BREAKING CHANGES: We remove the dependency on the deprecated `hashicorp/template` provider and use the Terraform built in `templatefile` function. This will broke some workflows due to previously being able to pass in the raw contents of a template file for processing. The `templatefile` function requires a template file that exists before running a plan.
2021-05-17 10:25:38 +02:00
Thierno IB. BARRY
e3bf48bba2 feat: Replace the local-exec script with a http datasource for waiting cluster (#1339)
NOTES: Using the [terraform-aws-modules/http](https://registry.terraform.io/providers/terraform-aws-modules/http/latest) provider is a more platform agnostic way to wait for the cluster availability than using a local-exec. With this change we're able to provision EKS clusters and manage the `aws_auth` configmap while still using the `hashicorp/tfc-agent` docker image.
2021-05-17 10:11:36 +02:00
Tjeu Kayim
2a6f07a0e8 fix: Updated code and version requirements to work with Terraform 0.15 (#1165) 2021-04-16 09:56:37 +02:00
Thierno IB. BARRY
0d77e30075 feat: Add EKS Fargate support (#1067)
Co-authored-by: Simon Gurcke <simon@gurcke.de>
Co-authored-by: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com>
2020-11-07 23:03:12 +01:00
Ken Kaizu
62a8f46ba7 feat: Add cloudwatch_log_group_arn to outputs (#1071) 2020-10-29 01:17:17 +01:00
Paul Pop
ca7593a6db fix: The type of the output cloudwatch_log_group_name should be a string instead of a list of strings (#1061)
NOTES: The output `cloudwatch_log_group_name` was incorrectly returning the log group name as a list of strings. As a workaround, people were using `module.eks_cluster.cloudwatch_log_group_name[0]` but that was totally inconsistent with output name. Those users can now use `module.eks_cluster.cloudwatch_log_group_name` directly.
2020-10-28 22:37:21 +01:00
Daniel Piddock
9ace344c57 docs: Better documentation of cluster_id output blocking (#955)
NOTES: Starting in v12.1.0 the `cluster_id` output depends on the
`wait_for_cluster` null resource. This means that initialisation of the
kubernetes provider will be blocked until the cluster is really ready,
if the module is set to manage the aws_auth ConfigMap and user followed
the typical Usage Example. kubernetes resources in the same plan do not
need to depend on anything explicitly.
2020-08-12 15:22:24 +02:00
Michael Marshall
a89e91bf8f feat: Add aws_security_group_rule.cluster_https_worker_ingress to output values (#901) 2020-06-06 10:55:35 +02:00
Daniel Piddock
7de18cd9cd fix: Revert removal of templates provider (#883)
Broke use case of passing in custom template content. Reverts most of the following PRs:
- #865
- #863 
- #854
2020-06-05 10:34:23 +02:00
Simon Gurcke
3fefc2a66c feat: Allow communication between pods on workers and pods using the primary cluster security group (optional) (#892)
NOTES: New variable `worker_create_cluster_primary_security_group_rules` to allow communication between pods on workers and pods using the primary cluster security group (Managed Node Groups or Fargate). It defaults to `false` to avoid potential conflicts with existing security group rules users may have implemented.
2020-05-30 22:43:26 +02:00
Daniel Piddock
c748899d0e cluster_id blocks on wait_for_cluster (#890) 2020-05-29 17:45:24 +02:00
Daniel Piddock
b183b97253 improvement: Remove dependency on external template provider (#854)
* Remove template_file for generating kubeconfig

Push logic from terraform down to the template. Makes the formatting
slightly easier to follow

* Remove template_file for generating userdata

Updates to the eks_cluster now do not trigger recreation of launch
configurations

* Remove template_file for LT userdata

* Remove template dependency
2020-05-06 10:54:14 +02:00
slimm609
9c2a718744 fix: Add vpc_config.cluster_security_group output as primary cluster security group id (#828) 2020-04-23 17:36:51 +02:00
Max Williams
626a393ab9 Remove of autoscaling IAM policy related stuff (#716)
* Disable management of autoscaling IAM policy by default

* remove completely

* update changelog notes

* fix pre-commit stuff

* misc updates

* fmt

* fix changelog

* Removal of tags and update docs

* Change after updating terraform-docs

* Add second tag
2020-02-04 19:34:17 +01:00
Steffen Tautenhahn
0ee36d0aee Don't fail on destroy, when provider resource was removed (#667)
* Don't fail on destroy, when provider resource was removed

* Update Changelog

* Node groups submodule (#650)

* WIP Move node_groups to a submodule

* Split the old node_groups file up

* Start moving locals

* Simplify IAM creation logic

* depends_on from the TF docs

* Wire in the variables

* Call module from parent

* Allow to customize the role name. As per workers

* aws_auth ConfigMap for node_groups

* Get the managed_node_groups example to plan

* Get the basic example to plan too

* create_eks = false works

"The true and false result expressions must have consistent types. The
given expressions are object and object, respectively."
Well, that's useful. But apparently set(string) and set() are ok. So
everything else is more complicated. Thanks.

* Update Changelog

* Update README

* Wire in node_groups_defaults

* Remove node_groups from workers_defaults_defaults

* Synchronize random and node_group defaults

* Error: "name_prefix" cannot be longer than 32

* Update READMEs again

* Fix double destroy

Was producing index errors when running destroy on an empty state.

* Remove duplicate iam_role in node_group

I think this logic works. Needs some testing with an externally created
role.

* Fix index fail if node group manually deleted

* Keep aws_auth template in top module

Downside: count causes issues as usual: can't use distinct() in the
child module so there's a template render for every node_group even if
only one role is really in use. Hopefully just output noise instead of
technical issue

* Hack to have node_groups depend on aws_auth etc

The AWS Node Groups create or edit the aws-auth ConfigMap so that nodes
can join the cluster. This breaks the kubernetes resource which cannot
do a force create. Remove the race condition with explicit depend.

Can't pull the IAM role out of the node_group any more.

* Pull variables via the random_pet to cut logic

No point having the same logic in two different places

* Pass all ForceNew variables through the pet

* Do a deep merge of NG labels and tags

* Update README.. again

* Additional managed node outputs #644

Add change from @TBeijin from PR #644

* Remove unused local

* Use more for_each

* Remove the change when create_eks = false

* Make documentation less confusing

* node_group version user configurable

* Pass through raw output from aws_eks_node_groups

* Merge workers defaults in the locals

This simplifies the random_pet and aws_eks_node_group logic. Which was
causing much consernation on the PR.

* Fix typo

Co-authored-by: Max Williams <max.williams@deliveryhero.com>

* Update Changelog

* Add public access endpoint CIDRs option (terraform-aws-eks#647) (#673)

* Add public access endpoint CIDRs option (terraform-aws-eks#647)

* Update required provider version to 2.44.0

* Fix formatting in docs

* Re-generate docs with terraform-docs 0.7.0 and bump pre-commit-terraform version (#668)

* re-generate docs with terraform-docs 0.7.0

* bump pre-commit-terraform version

* Release 8.0.0 (#662)

* Release 8.0.0

* Update changelog

* remove 'defauls' node group

* Make curl silent

* Update Changelog

Co-authored-by: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com>
Co-authored-by: Max Williams <max.williams@deliveryhero.com>
Co-authored-by: Siddarth Prakash <1428486+sidprak@users.noreply.github.com>
Co-authored-by: Thierno IB. BARRY <ibrahima.br@gmail.com>
2020-01-15 11:46:13 +01:00
Daniel Piddock
11147e9af3 Node groups submodule (#650)
* WIP Move node_groups to a submodule

* Split the old node_groups file up

* Start moving locals

* Simplify IAM creation logic

* depends_on from the TF docs

* Wire in the variables

* Call module from parent

* Allow to customize the role name. As per workers

* aws_auth ConfigMap for node_groups

* Get the managed_node_groups example to plan

* Get the basic example to plan too

* create_eks = false works

"The true and false result expressions must have consistent types. The
given expressions are object and object, respectively."
Well, that's useful. But apparently set(string) and set() are ok. So
everything else is more complicated. Thanks.

* Update Changelog

* Update README

* Wire in node_groups_defaults

* Remove node_groups from workers_defaults_defaults

* Synchronize random and node_group defaults

* Error: "name_prefix" cannot be longer than 32

* Update READMEs again

* Fix double destroy

Was producing index errors when running destroy on an empty state.

* Remove duplicate iam_role in node_group

I think this logic works. Needs some testing with an externally created
role.

* Fix index fail if node group manually deleted

* Keep aws_auth template in top module

Downside: count causes issues as usual: can't use distinct() in the
child module so there's a template render for every node_group even if
only one role is really in use. Hopefully just output noise instead of
technical issue

* Hack to have node_groups depend on aws_auth etc

The AWS Node Groups create or edit the aws-auth ConfigMap so that nodes
can join the cluster. This breaks the kubernetes resource which cannot
do a force create. Remove the race condition with explicit depend.

Can't pull the IAM role out of the node_group any more.

* Pull variables via the random_pet to cut logic

No point having the same logic in two different places

* Pass all ForceNew variables through the pet

* Do a deep merge of NG labels and tags

* Update README.. again

* Additional managed node outputs #644

Add change from @TBeijin from PR #644

* Remove unused local

* Use more for_each

* Remove the change when create_eks = false

* Make documentation less confusing

* node_group version user configurable

* Pass through raw output from aws_eks_node_groups

* Merge workers defaults in the locals

This simplifies the random_pet and aws_eks_node_group logic. Which was
causing much consernation on the PR.

* Fix typo

Co-authored-by: Max Williams <max.williams@deliveryhero.com>
2020-01-09 12:53:08 +01:00
Eytan Hanig
ab412fb060 Add the OIDC provider ARN to outputs (#653) 2020-01-03 14:25:09 +01:00
Mukesh Gupta
7c8bcc967b Adding node group iam role arns to outputs (#641) 2019-12-20 16:50:29 +01:00
chewvader
77f947ec91 Cluster oidc issuer url string (#626)
* cluster_oidc_issuer_url to string

change cluster_oidc_issuer_url output to return string

* Update CHANGELOG.md

adding entry to changelog

* Update outputs.tf

Co-Authored-By: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com>
2019-12-12 17:44:45 +01:00
Tomislav Tomašić
124ea7c151 Add destroy time flag (#580)
* Add destroy-time flag

* Update changelog

Fix cluster count

* Fix cluster count

* Fix docs

* Fix outputs

* Fix unsupported attribute on cluster_certificate_authority_data output

Co-Authored-By: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com>

* Remove unnecessary flatten from cluster_endpoint output

Co-Authored-By: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com>

* Improve description of var.enabled

* Fix errors manifesting when used on an existing-cluster

* Update README.md

* Renamed destroy-time flag

* Revert removal of changelog addition entry

* Update flag name in readme

* Update flag variable name

* Update cluster referencing for consistency

* Update flag name to `create_eks`

* Fixed incorrect count-based reference to aws_eks_cluster.this (there's only one)

* Replaced all incorrect aws_eks_cluster.this[count.index] references (there will be just one, so using '[0]').

* Changelog update, explicitly mentioning flag

* Fixed interpolation deprecation warning

* Fixed outputs to support conditional cluster

* Applied create_eks to aws_auth.tf

* Removed unused variable. Updated Changelog. Formatting.

* Fixed references to aws_eks_cluster.this[0] that would raise errors when setting create_eks to false whilst having launch templates or launch configurations configured.

* Readme and example updates.

* Revert "Readme and example updates."

This reverts commit 18a0746355e136010ad54858a1b518406f6a3638.

* Updated readme section of conditionally creation with provider example.

* Added conditions to node_groups.

* Fixed reversed map_roles check

* Update aws_auth.tf

Revert this due to https://github.com/terraform-aws-modules/terraform-aws-eks/pull/611
2019-12-09 10:06:10 +01:00
Stijn De Haes
9363662574 Use kubernetes provider to manage aws auth (#355)
This commit changes the way aws auth is managed. Before a local file
was used the generate the template and a null resource to apply it. This
is now switched to the terraform kubernetes provider.
2019-11-28 10:25:13 +01:00
Ankit Wal
a43e44f164 Update worker_iam_instance_profile outputs for launch template use (#583)
* Add launch template instance profiles to output

Concat launch template and asg instance profile lists

Signed-off-by: Ankit Wal <ankitwal@gmail.com>

* Update ChangeLog

Added changes made to output in Changelog
Signed-off-by: Ankit Wal <ankitwal@thoughtworks.com>
2019-11-06 17:27:56 +01:00
Daniel Piddock
813c607e90 Make "dangerous" policy attachments optional (#539) 2019-10-04 14:25:19 +02:00
Thierno IB. BARRY
b6125b8501 output empty string when cluster identity is empty (#516) 2019-09-18 16:43:01 +02:00
russwhelan
2b88e506e3 Add URL for OIDC issuer to allow IAM roles for Pods (#506)
* Add URL for OIDC issuer to allow IAM roles for Pods

* Update Documentation
2019-09-16 11:45:35 +02:00
Sergiu Plotnicu
461cf5482e Support for Mixed Instances ASG in worker_groups_launch_template variable (#468)
* Create ASG tags via for - utility from terraform 12

* Updated support for mixed ASG in worker_groups_launch_template variable

* Updated launch_template example to include spot and mixed ASG with worker_groups_launch_template variable

* Removed old config

* Removed workers_launch_template_mixed.tf file, added support for mixed/spot in workers_launch_template variable

* Updated examples/spot_instances/main.tf with Mixed Spot and ondemand instances

* Removed launch_template_mixed from relevant files

* Updated README.md file

* Removed workers_launch_template.tf.bkp

* Fixed case with null on_demand_allocation_strategy and Spot allocation

* Fixed workers_launch_template.tf, covered spot instances via Launch Template
2019-09-13 16:50:59 +02:00
gbooth27
f1041af57c add cloudwatch log group access (#410)
* add cloudwatch log group access

* update readme for outputs

* update outputs

* fix formatting

* add splat for access to name
2019-06-25 17:04:01 +02:00
刘相轩
da2c78b8ba Upgrade to terraform 0.12 (#394)
* run terraform upgrade tool

* fix post upgrade TODOs

* use strict typing for variables

* upgrade examples, point them at VPC module tf 0.12 PR

* remove unnecessary `coalesce()` calls

coalesce(lookup(map, key, ""), default) -> lookup(map, key, default)

* Fix autoscaling_enabled broken (#1)

* always set a value for tags, fix coalescelist calls

* always set a value for these tags

* fix tag value

* fix tag value

* default element available

* added default value

* added a general default

without this default - TF is throwing an error when running a destroy

* Fix CI

* Change vpc module back to `terraform-aws-modules/vpc/aws` in example

* Update CHANGELOG.md

* Change type of variable `cluster_log_retention_in_days` to number

* Remove `xx_count` variables

* Actual lists instead of strings with commas

* Remove `xx_count` variable from docs

* Replace element with list indexing

* Change variable `worker_group_tags` to a attribute of worker_group

* Fix workers_launch_template_mixed tags

* Change override_instance_type_x variables to list.

* Update CHANGELOG.md
2019-06-19 09:57:51 +02:00
Max Williams
ae2f8e58db Adding new mixed type of worker group with instance overrides and mixed instances policy (#371)
* Adding new mixed type of worker group with instance overrides and mixed instances policy

* moving all count and lifecycle rule parameters to top/bottom

* adding custom IAM parts

* updating doc with new options

* fixes for spot instances
2019-05-07 16:50:42 +02:00
Touch Ungboriboonpisal
959e5330e3 Support custom IAM roles for cluster and workers (#338)
* allow specifying custom worker IAM instance profiles

* allow specifying custom cluster IAM role

* add doc

* update changelog

* use data.aws_iam_instance_profile.name
2019-05-07 14:46:06 +02:00