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

InvalidParameter on IAM Role and Policy #4

Closed
dannyrandall opened this issue Feb 5, 2020 · 3 comments · Fixed by #5
Closed

InvalidParameter on IAM Role and Policy #4

dannyrandall opened this issue Feb 5, 2020 · 3 comments · Fixed by #5

Comments

@dannyrandall
Copy link
Contributor

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
Copy link
Collaborator

Good catch! PR would be great.

headcr4sh pushed a commit that referenced this issue Feb 8, 2020
Use null value for aws_iam_path_prefix if no value is set

Closes #4
@suraj120432
Copy link

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

@suraj120432
Copy link

i am getting this error plz can any one help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants