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

aws cloudformation - Error Message if IAM::Group Policy given string is Unclear #838

Closed
colinbjohnson opened this issue Jul 6, 2014 · 1 comment
Assignees
Labels
bug This issue is a bug.

Comments

@colinbjohnson
Copy link

Description of Issue

In CloudFormation, if passing a string to the policy property of a IAM::Group resource the following error is given: list index out of range.

Steps to Reproduce

Using aws cloudformation provide a template file that contains the following:
"GroupDevelopers" : { "Type": "AWS::IAM::Group", "Properties": { "Policies": {"Ref": "PolicyDevelopers"} } }

Run

aws cloudformation create-stack --stack-name Test --parameters --template-body file://test.template

Result

aws cloudformation create-stack --stack-name Test --parameters --template-body file://test.template
list index out of range

Expected Result

A more descriptive error message.

Documentation Detailing only Lists Expected

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html

@jamesls
Copy link
Member

jamesls commented Jul 7, 2014

Agreed, this is not a good error message. The actual problem is related to when a parameter is of type list:

       --parameters (list)
          A list of Parameter structures that specify input parameters for the
          stack.

which expects space separated values, but if no value is provided, you'll get a bad error message, as shown in your above command:

...  create-stack --stack-name Test --parameters      --template-body file://test.template
                                                ^^^^missing values

You can either:

a) omit the parameter
b) if you meant to explicitly send an empty list to the service (for some services an empty list is significant and means something different than omitting the param altogether), you can use the --parameters [] syntax

@jamesls jamesls self-assigned this Jul 7, 2014
jamesls added a commit to jamesls/aws-cli that referenced this issue Oct 21, 2015
Fixes aws#838.

The new behavior is that an empty list will be parsed, and we'll
rely on botocore's min/max validation for lists to check whether
or not a list can be empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants