New in version 2015.8.0.
This module uses boto
, which can be installed via package, or pip.
This module accepts explicit IAM credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More information available here.
It's also possible to specify key
, keyid
and region
via a profile, either
passed in as a dict, or as a string to pull from pillars or minion config:
delete-user:
boto_iam.user_absent:
- name: myuser
- delete_keys: true
delete-keys:
boto_iam.keys_absent:
- access_keys:
- 'AKIAJHTMIQ2ASDFLASDF'
- 'PQIAJHTMIQ2ASRTLASFR'
- user_name: myuser
create-user:
boto_iam.user_present:
- name: myuser
- policies:
mypolicy: |
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "*",
"Resource": "*"}]
}
- password: NewPassword$$1
- region: eu-west-1
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'fdkjsafkljsASSADFalkfjasdf'
create-group:
boto_iam.group_present:
- name: mygroup
- users:
- myuser
- myuser1
- policies:
mypolicy: |
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "*",
"Resource": "*"}]
}
- region: eu-west-1
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'safsdfsal;fdkjsafkljsASSADFalkfj'
change-policy:
boto_iam.account_policy:
- change_password: True
- region: eu-west-1
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'safsdfsal;fdkjsafkljsASSADFalkfj'
create server certificate:
boto_iam.server_cert_present:
- name: mycert
- public_key: salt://base/mycert.crt
- private_key: salt://base/mycert.key
- cert_chain: salt://base/mycert_chain.crt
- region: eu-west-1
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'fdkjsafkljsASSADFalkfjasdf'
delete server certificate:
boto_iam.server_cert_absent:
- name: mycert
create keys for user:
boto_iam.keys_present:
- name: myusername
- number: 2
- save_dir: /root
- region: eu-west-1
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'fdkjsafkljsASSADFalkfjasdf'
create policy:
boto_iam.policy_present:
- name: myname
- policy_document: '{"MyPolicy": "Statement": [{"Action": ["sqs:*"], "Effect": "Allow", "Resource": ["arn:aws:sqs:*:*:*"], "Sid": "MyPolicySqs1"}]}'
- region: eu-west-1
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'fdkjsafkljsASSADFalkfjasdf'
add-saml-provider:
boto_iam.saml_provider_present:
- name: my_saml_provider
- saml_metadata_document: salt://base/files/provider.xml
- keyid: 'AKIAJHTMIQ2ASDFLASDF'
- key: 'safsdfsal;fdkjsafkljsASSADFalkfj'
Change account policy.
New in version 2015.8.0.
The name of the account policy
Allows all IAM users in your account to use the AWS Management Console to change their own passwords.
Prevents IAM users from setting a new password after their password has expired.
The number of days that an IAM user password is valid.
The minimum number of characters allowed in an IAM user password.
Specifies the number of previous passwords that IAM users are prevented from reusing.
Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).
Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).
Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters: ! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string)
New in version 2015.8.0.
Ensure the IAM group is absent.
The name of the group.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
New in version 2015.8.0.
Ensure the IAM group is present
The name of the new group.
The path for the group, defaults to '/'
A dict of IAM group policy documents.
A list of pillars that contain role policy dicts. Policies in the pillars will be merged in the order defined in the list and key conflicts will be handled by later defined keys overriding earlier defined keys. The policies defined here will be merged with the policies defined in the policies argument. If keys conflict, the keys in the policies argument will override the keys defined in policies_from_pillars.
A list of policy names or ARNs that should be attached to this group.
A list of users to be added to the group.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
Delete or detach existing policies that are not in the given list of policies.
Default value is True
. If False
is specified, existing policies
will not be deleted or detached allowing manual modifications on the IAM group
to be persistent.
New in version 2015.8.0.
Ensure the IAM user access_key_id is absent.
A list of access key ids
The username of the user
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
New in version 2015.8.0.
Ensure the IAM access keys are present.
The name of the new user.
Number of keys that user should have.
The directory that the key/keys will be saved. Keys are saved to a file named according to the username privided.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
Save format is repeated for each key. Default format is "{2}n{0}n{3}n{1}n", where {0} and {1} are placeholders for new key_id and key respectively, whereas {2} and {3} are "key_id-{number}" and 'key-{number}' strings kept for compatibility.
New in version 2015.8.0.
Ensure the IAM managed policy with the specified name is absent
The name of the new policy.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
New in version 2015.8.0.
Ensure the IAM managed policy is present
The name of the new policy.
The document of the new policy
The path in which the policy will be created. Default is '/'.
Description
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
New in version 2016.11.0.
Ensure the SAML provider with the specified name is absent.
The name of the SAML provider.
The xml document of the SAML provider.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
New in version 2016.11.0.
Ensure the SAML provider with the specified name is present.
The name of the SAML provider.
The xml document of the SAML provider.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
Deletes a server certificate.
New in version 2015.8.0.
The name for the server certificate. Do not include the path in this value.
The name of the region to connect to.
The key to be used in order to connect
The keyid to be used in order to connect
The profile that contains a dict of region, key, keyid
Crete server certificate.
New in version 2015.8.0.
The name for the server certificate. Do not include the path in this value.
The contents of the public key certificate in PEM-encoded format.
The contents of the private key in PEM-encoded format.
The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
The path for the server certificate.
The name of the region to connect to.
The key to be used in order to connect
The keyid to be used in order to connect
The profile that contains a dict of region, key, keyid
New in version 2015.8.0.
Ensure the IAM user is absent. User cannot be deleted if it has keys.
The name of the new user.
Delete all keys from user.
Delete all mfa devices from user.
New in version 2016.3.0.
Delete profile from user.
New in version 2016.3.0.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.
New in version 2015.8.0.
Ensure the IAM user is present
The name of the new user.
A dict of IAM group policy documents.
A list of pillars that contain role policy dicts. Policies in the pillars will be merged in the order defined in the list and key conflicts will be handled by later defined keys overriding earlier defined keys. The policies defined here will be merged with the policies defined in the policies argument. If keys conflict, the keys in the policies argument will override the keys defined in policies_from_pillars.
A list of managed policy names or ARNs that should be attached to this user.
The password for the new user. Must comply with account policy.
The path of the user. Default is '/'.
New in version 2015.8.2.
Region to connect to.
Secret key to be used.
Access key to be used.
A dict with region, key and keyid, or a pillar key (string) that contains a dict with region, key and keyid.