You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/iam-user/README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# AWS IAM User Example
2
2
3
-
Configuration in this directory creates an IAM user with a random password, a pair of IAM access/secret keys and uploads IAM SSH public key.
3
+
Configuration in this directory creates an IAM user with a random password, a pair of IAM access/secret keys, uploads IAM SSH public key, and demonstrates inline policy creation.
4
4
User password and secret key is encrypted using public key of keybase.io user named `test`.
| <aname="output_iam_user_ssh_key_fingerprint"></a> [iam\_user\_ssh\_key\_fingerprint](#output\_iam\_user\_ssh\_key\_fingerprint)| The MD5 message digest of the SSH public key |
94
95
| <aname="output_iam_user_ssh_key_public_key_id"></a> [iam\_user\_ssh\_key\_public\_key\_id](#output\_iam\_user\_ssh\_key\_public\_key\_id)| The unique identifier for the SSH public key |
95
96
| <aname="output_iam_user_unique_id"></a> [iam\_user\_unique\_id](#output\_iam\_user\_unique\_id)| The unique ID assigned by AWS |
96
-
<!-- END_TF_DOCS -->
97
+
| <aname="output_iam_user_with_inline_policy_arn"></a> [iam\_user\_with\_inline\_policy\_arn](#output\_iam\_user\_with\_inline\_policy\_arn)| The ARN assigned by AWS for this user |
98
+
| <aname="output_iam_user_with_inline_policy_name"></a> [iam\_user\_with\_inline\_policy\_name](#output\_iam\_user\_with\_inline\_policy\_name)| The user's name |
99
+
| <aname="output_iam_user_with_inline_policy_unique_id"></a> [iam\_user\_with\_inline\_policy\_unique\_id](#output\_iam\_user\_with\_inline\_policy\_unique\_id)| The unique ID assigned by AWS |
|[aws_iam_policy_document.inline](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
57
98
58
99
## Inputs
59
100
@@ -62,16 +103,20 @@ No modules.
62
103
| <aname="input_access_key_status"></a> [access\_key\_status](#input\_access\_key\_status)| Access key status to apply |`string`|`null`| no |
63
104
| <aname="input_create"></a> [create](#input\_create)| Controls if resources should be created (affects all resources) |`bool`|`true`| no |
64
105
| <aname="input_create_access_key"></a> [create\_access\_key](#input\_create\_access\_key)| Whether to create IAM access key |`bool`|`true`| no |
106
+
| <aname="input_create_inline_policy"></a> [create\_inline\_policy](#input\_create\_inline\_policy)| Determines whether to create an inline policy |`bool`|`false`| no |
65
107
| <aname="input_create_login_profile"></a> [create\_login\_profile](#input\_create\_login\_profile)| Whether to create IAM user login profile |`bool`|`true`| no |
66
108
| <aname="input_create_ssh_key"></a> [create\_ssh\_key](#input\_create\_ssh\_key)| Whether to upload a public ssh key to the IAM user |`bool`|`false`| no |
67
109
| <aname="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy)| When destroying this user, destroy even if it has non-Terraform-managed IAM access keys, login profile or MFA devices. Without force\_destroy a user with non-Terraform-managed access keys and login profile will fail to be destroyed |`bool`|`false`| no |
110
+
| <aname="input_inline_policy_permissions"></a> [inline\_policy\_permissions](#input\_inline\_policy\_permissions)| A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for inline policy permissions | <pre>map(object({<br/> sid = optional(string)<br/> actions = optional(list(string))<br/> not_actions = optional(list(string))<br/> effect = optional(string, "Allow")<br/> resources = optional(list(string))<br/> not_resources = optional(list(string))<br/> principals = optional(list(object({<br/> type = string<br/> identifiers = list(string)<br/> })))<br/> not_principals = optional(list(object({<br/> type = string<br/> identifiers = list(string)<br/> })))<br/> condition = optional(list(object({<br/> test = string<br/> variable = string<br/> values = list(string)<br/> })))<br/> }))</pre> |`null`| no |
68
111
| <aname="input_name"></a> [name](#input\_name)| Desired name for the IAM user |`string`|`""`| no |
112
+
| <aname="input_override_inline_policy_documents"></a> [override\_inline\_policy\_documents](#input\_override\_inline\_policy\_documents)| List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid`|`list(string)`|`[]`| no |
69
113
| <aname="input_password_length"></a> [password\_length](#input\_password\_length)| The length of the generated password |`number`|`null`| no |
70
114
| <aname="input_password_reset_required"></a> [password\_reset\_required](#input\_password\_reset\_required)| Whether the user should be forced to reset the generated password on first login |`bool`|`true`| no |
71
115
| <aname="input_path"></a> [path](#input\_path)| Desired path for the IAM user |`string`|`null`| no |
72
116
| <aname="input_permissions_boundary"></a> [permissions\_boundary](#input\_permissions\_boundary)| The ARN of the policy that is used to set the permissions boundary for the user |`string`|`null`| no |
73
117
| <aname="input_pgp_key"></a> [pgp\_key](#input\_pgp\_key)| Either a base-64 encoded PGP public key, or a keybase username in the form `keybase:username`. Used to encrypt password and access key |`string`|`null`| no |
74
118
| <aname="input_policies"></a> [policies](#input\_policies)| Policies to attach to the IAM user in `{'static_name' = 'policy_arn'}` format |`map(string)`|`{}`| no |
119
+
| <aname="input_source_inline_policy_documents"></a> [source\_inline\_policy\_documents](#input\_source\_inline\_policy\_documents)| List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s |`list(string)`|`[]`| no |
75
120
| <aname="input_ssh_key_encoding"></a> [ssh\_key\_encoding](#input\_ssh\_key\_encoding)| Specifies the public key encoding format to use in the response. To retrieve the public key in ssh-rsa format, use SSH. To retrieve the public key in PEM format, use PEM |`string`|`"SSH"`| no |
76
121
| <aname="input_ssh_public_key"></a> [ssh\_public\_key](#input\_ssh\_public\_key)| The SSH public key. The public key must be encoded in ssh-rsa format or PEM format |`string`|`""`| no |
77
122
| <aname="input_tags"></a> [tags](#input\_tags)| A map of tags to add to all resources |`map(string)`|`{}`| no |
description="Determines whether to create an inline policy"
119
+
type=bool
120
+
default=false
121
+
}
122
+
123
+
variable"source_inline_policy_documents" {
124
+
description="List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s"
125
+
type=list(string)
126
+
default=[]
127
+
}
128
+
129
+
variable"override_inline_policy_documents" {
130
+
description="List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid`"
131
+
type=list(string)
132
+
default=[]
133
+
}
134
+
135
+
variable"inline_policy_permissions" {
136
+
description="A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for inline policy permissions"
0 commit comments