-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Does not assume role correctly when use salt-cloud to create AWS ec2 #52501
Comments
ping @saltstack/team-cloud any ideas here? |
I do not believe we have any code in place for assuming roles. This would require the feature to be added. |
Oh, looks like it actually should be assuming the role_arn. I don't know. probably a bug. |
Could you please reproduce it on your end and confirm if it is a bug? |
Hi, I checked the codes and found the problem. When the variable |
@Ch3LL Hi, I'm facing exactly the same issue while trying to create an instance (it doesn't find the security group and fails) and while destroying an instance (it cannot find the instance and fails). |
Thanks to @changyong comment I've sorted it by changing
into
in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Thank you for updating this issue. It is no longer marked as stale. |
I think this was closed prematurely. The bug still exists and the fix from #52572 was never merged in. |
This was a fairly useful stop-gap to work around this particular bug. |
Description of Issue/Question
When i try to use salt-cloud to create AWS ec2, it does not assume role correctly
Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
My purpose is using salt-cloud ec2 in account 22222222 to create AWS ec2 in account 11111111
Create role alt-cloud-cross-account in AWS account 11111111 with trust entities = aws account 22222222
Attached Full EC2Acess policy to role salt-clou1d-cross-account
Create ec2 in AWS account 22222222 and install salt cloud version 2019.2
Create ec2 role with policy allow it to assume 11111111:role/salt-cloud-cross-account
Config prodiver file:
xxxxx-xxxxx-xxxx:
id: 'use-instance-role-credentials'
key: 'use-instance-role-credentials'
role_arn: 'arn:aws:iam::11111111:role/salt-cloud-cross-account'
driver: ec2
config provider fine
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
Run salt-cloud -m test-map-file
From cloudTrail, i can see
return 400, Bad request, an instance with instance id xxx not found
Salt-Cloud error out
According to cloudTrail, I believe it assumes the role as expected when creating ec2, but after then when it queries the result of the creation, it does not assume role correctly. As it considers ec2 is not created, exit without finishing other following tasks like tag ec2, ssh ec2, install/config/start salt minion
Is it a bug of cloud-salt??
Versions Report
(Provided by running
salt --versions-report
. Please also mention any differences in master/minion versions.)2019.2
The text was updated successfully, but these errors were encountered: