Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct key used on license_configuration_arn #2796

Merged
merged 1 commit into from
Oct 30, 2023
Merged

fix: Correct key used on license_configuration_arn #2796

merged 1 commit into from
Oct 30, 2023

Conversation

palpaga
Copy link
Contributor

@palpaga palpaga commented Oct 30, 2023

Description

Following issue #2753.

Motivation and Context

Currently, it is not possible to provide a license through the self-managed-node-group and eks-managed-node-group modules.
This is necessary in cases like the following configuration:

placement = {
  tenancy                 = "host"
  host_resource_group_arn = ......
}

Breaking Changes

I do not see any potential breaking changes.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

After these modifications, I can define license_configuration_arn as follows:

module "self_managed_node_group" {
  source  = "terraform-aws-modules/eks/aws//modules/self-managed-node-group"
  version = "19.17.2"

  name                = local.eks_name
  cluster_name        = module.eks.cluster_name
  cluster_version     = var.eks_version
  cluster_endpoint    = module.eks.cluster_endpoint
  cluster_auth_base64 = module.eks.cluster_certificate_authority_data

  ....

  placement = {
    tenancy                 = "host"
    host_resource_group_arn = "arn:aws:resource-groups:us-east-1:XXXXXXX:group/XXXXXX"
  }

  license_specifications = [
    {
      license_configuration_arn = "arn:aws:license-manager:us-east-1:XXXXXX:license-configuration:lic-XXXXXXXXX"
    }
  ]
}

I'm not entirely sure in this case if it makes sense to have the map within a list. If you have a better idea, please feel free to suggest it. Nevertheless, it's currently working well for me in this way.

@palpaga palpaga closed this Oct 30, 2023
@palpaga palpaga reopened this Oct 30, 2023
@bryantbiggs bryantbiggs changed the title fix: Reference to undeclared resource fix: Correct key used on license_configuration_arn Oct 30, 2023
Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@bryantbiggs bryantbiggs merged commit bd4bda2 into terraform-aws-modules:master Oct 30, 2023
35 checks passed
antonbabenko pushed a commit that referenced this pull request Oct 30, 2023
### [19.17.3](v19.17.2...v19.17.3) (2023-10-30)

### Bug Fixes

* Correct key used on `license_configuration_arn` ([#2796](#2796)) ([bd4bda2](bd4bda2))
@antonbabenko
Copy link
Member

This PR is included in version 19.17.3 🎉

@khrisrichardson
Copy link

It looks like the type on the right side of that ternary ought not have changed

Error: Inconsistent conditional result types

  on .terraform/modules/eks.eks/modules/eks-managed-node-group/main.tf line 179, in resource "aws_launch_template" "this":
 179:     for_each = length(var.license_specifications) > 0 ? var.license_specifications : []
    ├────────────────
    │ var.license_specifications is object with no attributes

The true and false result expressions must have consistent types. The
'true' value is object, but the 'false' value is tuple.

@palpaga
Copy link
Contributor Author

palpaga commented Oct 30, 2023

The issue lies with the following code:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/modules/self-managed-node-group/variables.tf#L198C6-L198C6

I forgot to change the type and default values of license_specifications variable.

I solved the issue like this:
palpaga@559a5f9

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using license_specifications into terraform EKS self_managed_node_group module
4 participants