-
Notifications
You must be signed in to change notification settings - Fork 399
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: missing functionality #1842
iam_instance_profile: missing functionality #1842
Comments
Thank you for taking the time to open this issue. I think this functionality would be very helpful to have in a standalone module. The community.aws.iam_role module has some support for creating Instance Profiles (by default creating an IAM role will create an Instance Profile), but has limited functionality. Given that this is much more related to iam_role than iam_user (or iam_policy), this RFE is currently better suited to community.aws. community.aws is also where new modules are usually first added. |
New modules: iam_instance_profile(_info) SUMMARY New modules for listing/managing IAM Instance Profiles ISSUE TYPE New Module Pull Request COMPONENT NAME iam_instance_profile iam_instance_profile_info ADDITIONAL INFORMATION Fixes: ansible-collections/community.aws#1842 Reviewed-by: Alina Buzachis Reviewed-by: Mark Chappell
New modules: iam_instance_profile(_info) SUMMARY New modules for listing/managing IAM Instance Profiles ISSUE TYPE New Module Pull Request COMPONENT NAME iam_instance_profile iam_instance_profile_info ADDITIONAL INFORMATION Fixes: ansible-collections/community.aws#1842 Reviewed-by: Alina Buzachis Reviewed-by: Mark Chappell (cherry picked from commit 6a1f875)
@tremble GH Issue should not be closed, as the PR does contain any Ansible Module changes to use the AWS IAM Instance Profile and attach to an AWS EC2 instance as a replacement for the following AWS CLI commands: - name: AWS EC2 Instances - Attach AWS IAM Instance Profile
ansible.builtin.command: aws ec2 associate-iam-instance-profile
--iam-instance-profile "Name=IAM-Instance-Profile-Test"
--instance-id {{hostvars['hostname'].ansible_board_asset_tag}}
ignore_errors: true |
@sean-freeman I'm not sure what functionality you're saying is missing, could you help me understand? The initial description mentions iam_policy (which is used for managing the inline policies for Users, Roles and Groups), and iam_user (which is used for managing Users). So I'm not sure why they're relevant.
Because IAM instance profiles can be attached to multiple EC2 instances, it's something we'd generally manage from the instance side rather than the profile side. (Managing them from the profile side means you need to know all instances mapped to the profile to add/delete an association) |
@tremble For what you describe, it only allows for two scenarios:
I agree, it should be managed from the instance side and this is my concern. There is no separated method in the Ansible Collection, which matches to the AWS CLI command shown above and allows:
Summary = |
[PR #1614/6a1f875e backport][stable-6] New modules: iam_instance_profile(_info) This is a backport of PR #1614 as merged into main (6a1f875). SUMMARY New modules for listing/managing IAM Instance Profiles ISSUE TYPE New Module Pull Request COMPONENT NAME iam_instance_profile iam_instance_profile_info ADDITIONAL INFORMATION Fixes: ansible-collections/community.aws#1842 Reviewed-by: Alina Buzachis
It shouldn't be necessary to fully redefine the attributes, if an attribute isn't set then it shouldn't be changed., as such it should be possible to attach an existing profile to an existing instance with something as simple as:
This would make |
Will attempt this approach. Would suggest this specific example is noted as an example in the documentation, so it can be seen how to associate an IAM Instance Profile to the EC2 instance. |
Summary
Use of AWS IAM Instance Profiles for managing policies for specified AWS EC2 Instances is missing functionality.
This is not a feature request, it is missing functionality not handled by Ansible Modules
iam_policy
andiam_user
that is necessary for proper management of AWS IAM for AWS EC2 resources.API Reference documents:
Workaround sample code block using AWS CLI:
Issue Type
Bug Report
Component Name
iam_instance_profile
Ansible Version
2.15.0
Collection Versions
5.4.0
AWS SDK versions
Code of Conduct
The text was updated successfully, but these errors were encountered: