qvest-digital / terraform-kubernetes-alb-ingress-controller

Terraform module to ease deployment of the AWS ALB Ingress Controller
https://registry.terraform.io/modules/iplabs/alb-ingress-controller/kubernetes/
Mozilla Public License 2.0
57 stars 66 forks source link

InvalidParameter on IAM Role and Policy #4

Closed dannyrandall closed 4 years ago

dannyrandall commented 4 years ago

The default aws_iam_path_prefix parameter of "" causes a validation error on terraform apply:

Error: Error creating IAM Role k8s-av-alb-ingress-controller: InvalidParameter: 1 validation error(s) found.                                
- minimum field size of 1, CreateRoleInput.Path.                                                                                            

  on .terraform/modules/alb-ingress-controller/iplabs-terraform-kubernetes-alb-ingress-controller-76eb4a6/main.tf line 58, in resource "aws_iam_role" "this":
  58: resource "aws_iam_role" "this" {                                                                                                      

Error: Error creating IAM policy k8s-av-alb-management: InvalidParameter: 1 validation error(s) found.                                      
- minimum field size of 1, CreatePolicyInput.Path.                                                                                                                                                                                                                                       

  on .terraform/modules/alb-ingress-controller/iplabs-terraform-kubernetes-alb-ingress-controller-76eb4a6/main.tf line 186, in resource "aws_iam_policy" "this":
 186: resource "aws_iam_policy" "this" {

It seems like path has to at least have a length of 1 to be valid. There are two possible solutions I can think of:

  1. Change the default aws_iam_path_prefix to "/" like it is in the terraform documentation
  2. Change the default aws_iam_path_prefix to null, and only set the path value if a path prefix was passed in.

I'm happy to make a PR if that would help.

headcr4sh commented 4 years ago

Good catch! PR would be great.

suraj120432 commented 2 years ago

Error: failed creating IAM Role (test-role): InvalidParameter: 1 validation error(s) found. │ - minimum field size of 1, CreateRoleInput.AssumeRolePolicyDocument.

suraj120432 commented 2 years ago

i am getting this error plz can any one help