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

--iam-instance-profile not being parsed correctly #2643

Closed
utterlyforked opened this issue Jun 6, 2017 · 6 comments
Closed

--iam-instance-profile not being parsed correctly #2643

utterlyforked opened this issue Jun 6, 2017 · 6 comments
Labels
confusing-error enhancement feature-request A feature should be added or improved.

Comments

@utterlyforked
Copy link

I know this issue has been raised previously in a few similar issues (#1470 and #2392) but I'm still seeing a simliar behaviour in a very recent release

Andrews-MacBook:~ andrewtaylor$ aws --version
aws-cli/1.11.97 Python/2.7.10 Darwin/16.6.0 botocore/1.5.60

--iam-instance-profile parameter causes error

Andrews-MacBook:~ andrewtaylor$ aws ec2 run-instances --image-id ami-01ccc867 --key-name systemmanager --instance-type m3.medium --iam-instance-profile systemmanager-instancerole

Error parsing parameter '--iam-instance-profile': Expected: '=', received: 'EOF' for input:
systemmanager-instancerole

I tried with the same parameter but removing the hyphen from the argument value in case it was just the value being passed. Same result:

Andrews-MacBook:~ andrewtaylor$ aws ec2 run-instances --image-id ami-01ccc867 --key-name systemmanager --instance-type m3.medium --iam-instance-profile systemmanager

Error parsing parameter '--iam-instance-profile': Expected: '=', received: 'EOF' for input:
systemmanager

When I remove the --iam-instance-profile argument the command is successful.

Here's the debug output which looks as if the params are correct.

Andrews-MacBook:~ andrewtaylor$ aws ec2 run-instances --image-id ami-01ccc867 --key-name systemmanager --instance-type m3.medium --iam-instance-profile systemmanager --debug 2>&1 | grep "Arguments entered"
2017-06-06 09:42:17,498 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['ec2', 'run-instances', '--image-id', 'ami-01ccc867', '--key-name', 'systemmanager', '--instance-type', 'm3.medium', '--iam-instance-profile', 'systemmanager', '--debug']

Is this a regression?

Andrew

@JordonPhillips
Copy link
Member

You need to specify whether you're providing a name or an arn (or both), like so: Name=systemmanager-instancerole. There are examples in the docs which demonstrate this.

@JordonPhillips JordonPhillips added api-question closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 6, 2017
@utterlyforked
Copy link
Author

Oh well now I feel foolish!

Thanks for the heads-up. Perhaps a pull request for a change in the error message would be accepted?

@JordonPhillips JordonPhillips added confusing-error and removed api-question closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 28, 2017
@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 18, 2020
@aws aws deleted a comment from github-actions bot Sep 18, 2020
@kdaily kdaily removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 18, 2020
@kdaily kdaily added the feature-request A feature should be added or improved. label Feb 8, 2021
@kdaily
Copy link
Member

kdaily commented Apr 16, 2021

The original issue was resolved and documentation shows expected parameter. Since the error returned notes which parameter is at fault, we wouldn't try to parse this particular specification as incorrect.

@kdaily kdaily closed this as completed Apr 16, 2021
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

@potionlibrary
Copy link

Its been 4 years and i literally ran into the same issue, its almost like were all treading down the same path, running into the same mistakes.

@saraswat40
Copy link

saraswat40 commented Sep 28, 2021

This stuff is not documented. This is how the the parameter needs to be passed:
# aws ec2 associate-iam-instance-profile --iam-instance-profile '{"Name": "name of the profile" }'
OR
# aws ec2 associate-iam-instance-profile --iam-instance-profile '{"arn": "arn of the profile" }'
OR
`# aws ec2 associate-iam-instance-profile --iam-instance-profile Name=name of the profile

thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confusing-error enhancement feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

6 participants