Skip to content

Commit

Permalink
Update Examples with FQCN (ansible-collections#67)
Browse files Browse the repository at this point in the history
Updated module examples with FQCN

Signed-off-by: Abhijeet Kasurde <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@98173ae
  • Loading branch information
Akasurde authored and alinabuzachis committed Oct 6, 2023
1 parent bed16e2 commit 150fd56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions plugins/modules/iam_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
description:
- A list of managed policy ARNs or, since Ansible 2.4, a list of either managed policy ARNs or friendly names.
- To remove all policies set I(purge_polices=true) and I(managed_policies=[None]).
- To embed an inline policy, use M(iam_policy).
- To embed an inline policy, use M(community.aws.iam_policy).
aliases: ['managed_policy']
type: list
max_session_duration:
Expand Down Expand Up @@ -98,28 +98,28 @@
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Create a role with description and tags
iam_role:
community.aws.iam_role:
name: mynewrole
assume_role_policy_document: "{{ lookup('file','policy.json') }}"
description: This is My New Role
tags:
env: dev
- name: "Create a role and attach a managed policy called 'PowerUserAccess'"
iam_role:
community.aws.iam_role:
name: mynewrole
assume_role_policy_document: "{{ lookup('file','policy.json') }}"
managed_policies:
- arn:aws:iam::aws:policy/PowerUserAccess
- name: Keep the role created above but remove all managed policies
iam_role:
community.aws.iam_role:
name: mynewrole
assume_role_policy_document: "{{ lookup('file','policy.json') }}"
managed_policies: []
- name: Delete the role
iam_role:
community.aws.iam_role:
name: mynewrole
assume_role_policy_document: "{{ lookup('file', 'policy.json') }}"
state: absent
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/iam_role_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
'''

EXAMPLES = '''
# find all existing IAM roles
- iam_role_info:
- name: find all existing IAM roles
community.aws.iam_role_info:
register: result
# describe a single role
- iam_role_info:
- name: describe a single role
community.aws.iam_role_info:
name: MyIAMRole
# describe all roles matching a path prefix
- iam_role_info:
- name: describe all roles matching a path prefix
community.aws.iam_role_info:
path_prefix: /application/path
'''

Expand Down

0 comments on commit 150fd56

Please sign in to comment.