39 | > Watch demo of using Atmos with Terraform
40 | > 
41 | > Example of running atmos to manage infrastructure from our Quick Start tutorial.
42 | >
43 |
44 |
45 |
46 |
47 |
48 | ## Usage
49 |
50 | ```hcl
51 | module "account_settings" {
52 | source = "cloudposse/iam-account-settings/aws"
53 | # Cloud Posse recommends pinning every module to a specific version
54 | # version = "x.x.x"
55 |
56 | namespace = "eg"
57 | stage = "prod"
58 | name = "account"
59 |
60 | allow_users_to_change_password = true
61 | minimum_password_length = 20
62 | password_reuse_prevention = 30
63 | }
64 |
65 | output "account_alias" {
66 | value = "${module.account_settings.account_alias}"
67 | }
68 |
69 | output "signin_url" {
70 | value = "${module.account_settings.signin_url}"
71 | }
72 | ```
73 |
74 | ## Security Info
75 |
76 | For better compliance with modern security best practices the following rules are enabled for the AWS account:
77 |
78 | Initial password creation (upon user creation) requires password to be reset on first login
79 | * Minimum password length: 16 chars
80 | * Requires at least one upper case letter
81 | * Requires at least one lower case letter
82 | * Requires at least one number
83 | * Requires at least one alphanumeric character
84 | * Passwords expire after 90 days
85 | * Passwords may not be repeated more than every 5th time you reset a password
86 | * Furthermore, MFA is required to assume a role (access to dev/staging/prod accounts), which is how access is granted to any and all AWS resources for staging/production.
87 |
88 | These password requirements are a best effort to meet PCI DSS v3.2.1 regulations for passwords and MFA, as published in May 2018 (in this instance, only for AWS)
89 |
90 | https://www.pcisecuritystandards.org/documents/PCI_DSS_v3-2-1.pdf
91 |
92 | Source Sections (starting on page 72):
93 |
94 | * 8.2.3
95 | * 8.2.4
96 | * 8.2.5
97 | * 8.2.6
98 | * 8.4 (documentation only)
99 |
100 | > [!IMPORTANT]
101 | > In Cloud Posse's examples, we avoid pinning modules to specific versions to prevent discrepancies between the documentation
102 | > and the latest released versions. However, for your own projects, we strongly advise pinning each module to the exact version
103 | > you're using. This practice ensures the stability of your infrastructure. Additionally, we recommend implementing a systematic
104 | > approach for updating versions to avoid unexpected changes.
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | ## Requirements
115 |
116 | | Name | Version |
117 | |------|---------|
118 | | [terraform](#requirement\_terraform) | >= 0.12.26 |
119 | | [aws](#requirement\_aws) | >= 2.0 |
120 |
121 | ## Providers
122 |
123 | | Name | Version |
124 | |------|---------|
125 | | [aws](#provider\_aws) | >= 2.0 |
126 |
127 | ## Modules
128 |
129 | | Name | Source | Version |
130 | |------|--------|---------|
131 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 |
132 |
133 | ## Resources
134 |
135 | | Name | Type |
136 | |------|------|
137 | | [aws_iam_account_alias.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_account_alias) | resource |
138 | | [aws_iam_account_password_policy.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_account_password_policy) | resource |
139 | | [aws_caller_identity.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
140 |
141 | ## Inputs
142 |
143 | | Name | Description | Type | Default | Required |
144 | |------|-------------|------|---------|:--------:|
145 | | [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
146 | | [allow\_users\_to\_change\_password](#input\_allow\_users\_to\_change\_password) | Whether to allow users to change their own password | `bool` | `true` | no |
147 | | [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
148 | | [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | {
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
} | no |
149 | | [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
150 | | [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
151 | | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
152 | | [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
153 | | [hard\_expiry](#input\_hard\_expiry) | Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset) | `bool` | `false` | no |
154 | | [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no |
155 | | [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no |
156 | | [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no |
157 | | [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no |
158 | | [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | [
"default"
]
| no |
159 | | [max\_password\_age](#input\_max\_password\_age) | The number of days that a user's password is valid | `number` | `90` | no |
160 | | [minimum\_password\_length](#input\_minimum\_password\_length) | Minimum length to require for user passwords | `number` | `14` | no |
161 | | [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
162 | | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
163 | | [password\_policy\_enabled](#input\_password\_policy\_enabled) | Whether or not to create the IAM account password policy | `bool` | `true` | no |
164 | | [password\_reuse\_prevention](#input\_password\_reuse\_prevention) | The number of previous passwords that users are prevented from reusing | `number` | `24` | no |
165 | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
166 | | [require\_lowercase\_characters](#input\_require\_lowercase\_characters) | Whether to require lowercase characters for user passwords | `bool` | `true` | no |
167 | | [require\_numbers](#input\_require\_numbers) | Whether to require numbers for user passwords | `bool` | `true` | no |
168 | | [require\_symbols](#input\_require\_symbols) | Whether to require symbols for user passwords | `bool` | `true` | no |
169 | | [require\_uppercase\_characters](#input\_require\_uppercase\_characters) | Whether to require uppercase characters for user passwords | `bool` | `true` | no |
170 | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
171 | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
172 | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
173 |
174 | ## Outputs
175 |
176 | | Name | Description |
177 | |------|-------------|
178 | | [account\_alias](#output\_account\_alias) | IAM account alias |
179 | | [minimum\_password\_length](#output\_minimum\_password\_length) | IAM account minimum password length |
180 | | [signin\_url](#output\_signin\_url) | IAM users sign-in URL |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 | ## Related Projects
190 |
191 | Check out these related projects.
192 |
193 | - [terraform-aws-iam-assumed-roles](https://github.com/cloudposse/terraform-aws-iam-assumed-roles) - Terraform Module for Assumed Roles on AWS with IAM Groups Requiring MFA
194 | - [terraform-aws-iam-user](https://github.com/cloudposse/terraform-aws-iam-user) - Terraform Module to provision a basic IAM user suitable for humans.
195 | - [terraform-aws-iam-s3-user](https://github.com/cloudposse/terraform-aws-iam-s3-user) - Terraform module to provision a basic IAM user with permissions to access S3 resources, e.g. to give the user read/write/delete access to the objects in an S3 bucket
196 | - [terraform-aws-organization-access-group](https://github.com/cloudposse/terraform-aws-organization-access-group) - Terraform module to create an IAM Group and Policy to grant permissions to delegated IAM users in the Organization's master account to access a member account
197 | - [terraform-aws-ssm-iam-role](https://github.com/cloudposse/terraform-aws-ssm-iam-role) - Terraform module to provision an IAM role with configurable permissions to access SSM Parameter Store
198 | - [terraform-aws-iam-chamber-user](https://github.com/cloudposse/terraform-aws-iam-chamber-user) - Terraform module to provision a basic IAM chamber user with access to SSM parameters and KMS key to decrypt secrets, suitable for CI/CD systems (e.g. TravisCI, CircleCI, CodeFresh) or systems which are external to AWS that cannot leverage AWS IAM Instance Profiles
199 | - [terraform-aws-lb-s3-bucket](https://github.com/cloudposse/terraform-aws-lb-s3-bucket) - Terraform module to provision an S3 bucket with built in IAM policy to allow AWS Load Balancers to ship access logs
200 |
201 |
202 | > [!TIP]
203 | > #### Use Terraform Reference Architectures for AWS
204 | >
205 | > Use Cloud Posse's ready-to-go [terraform architecture blueprints](https://cloudposse.com/reference-architecture/) for AWS to get up and running quickly.
206 | >
207 | > ✅ We build it together with your team.
208 | > ✅ Your team owns everything.
209 | > ✅ 100% Open Source and backed by fanatical support.
210 | >
211 | >
212 | > 📚 Learn More
213 | >
214 | >
215 | >
216 | > Cloud Posse is the leading [**DevOps Accelerator**](https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-iam-account-settings&utm_content=commercial_support) for funded startups and enterprises.
217 | >
218 | > *Your team can operate like a pro today.*
219 | >
220 | > Ensure that your team succeeds by using Cloud Posse's proven process and turnkey blueprints. Plus, we stick around until you succeed.
221 | > #### Day-0: Your Foundation for Success
222 | > - **Reference Architecture.** You'll get everything you need from the ground up built using 100% infrastructure as code.
223 | > - **Deployment Strategy.** Adopt a proven deployment strategy with GitHub Actions, enabling automated, repeatable, and reliable software releases.
224 | > - **Site Reliability Engineering.** Gain total visibility into your applications and services with Datadog, ensuring high availability and performance.
225 | > - **Security Baseline.** Establish a secure environment from the start, with built-in governance, accountability, and comprehensive audit logs, safeguarding your operations.
226 | > - **GitOps.** Empower your team to manage infrastructure changes confidently and efficiently through Pull Requests, leveraging the full power of GitHub Actions.
227 | >
228 | >
229 | >
230 | > #### Day-2: Your Operational Mastery
231 | > - **Training.** Equip your team with the knowledge and skills to confidently manage the infrastructure, ensuring long-term success and self-sufficiency.
232 | > - **Support.** Benefit from a seamless communication over Slack with our experts, ensuring you have the support you need, whenever you need it.
233 | > - **Troubleshooting.** Access expert assistance to quickly resolve any operational challenges, minimizing downtime and maintaining business continuity.
234 | > - **Code Reviews.** Enhance your team’s code quality with our expert feedback, fostering continuous improvement and collaboration.
235 | > - **Bug Fixes.** Rely on our team to troubleshoot and resolve any issues, ensuring your systems run smoothly.
236 | > - **Migration Assistance.** Accelerate your migration process with our dedicated support, minimizing disruption and speeding up time-to-value.
237 | > - **Customer Workshops.** Engage with our team in weekly workshops, gaining insights and strategies to continuously improve and innovate.
238 | >
239 | >
240 | >
241 |
242 | ## ✨ Contributing
243 |
244 | This project is under active development, and we encourage contributions from our community.
245 |
246 |
247 |
248 | Many thanks to our outstanding contributors:
249 |
250 |
251 |
252 |
253 |
254 | For 🐛 bug reports & feature requests, please use the [issue tracker](https://github.com/cloudposse/terraform-aws-iam-account-settings/issues).
255 |
256 | In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
257 | 1. Review our [Code of Conduct](https://github.com/cloudposse/terraform-aws-iam-account-settings/?tab=coc-ov-file#code-of-conduct) and [Contributor Guidelines](https://github.com/cloudposse/.github/blob/main/CONTRIBUTING.md).
258 | 2. **Fork** the repo on GitHub
259 | 3. **Clone** the project to your own machine
260 | 4. **Commit** changes to your own branch
261 | 5. **Push** your work back up to your fork
262 | 6. Submit a **Pull Request** so that we can review your changes
263 |
264 | **NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
265 |
266 | ### 🌎 Slack Community
267 |
268 | Join our [Open Source Community](https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-iam-account-settings&utm_content=slack) on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
269 |
270 | ### 📰 Newsletter
271 |
272 | Sign up for [our newsletter](https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-iam-account-settings&utm_content=newsletter) and join 3,000+ DevOps engineers, CTOs, and founders who get insider access to the latest DevOps trends, so you can always stay in the know.
273 | Dropped straight into your Inbox every week — and usually a 5-minute read.
274 |
275 | ### 📆 Office Hours
276 |
277 | [Join us every Wednesday via Zoom](https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-iam-account-settings&utm_content=office_hours) for your weekly dose of insider DevOps trends, AWS news and Terraform insights, all sourced from our SweetOps community, plus a _live Q&A_ that you can’t find anywhere else.
278 | It's **FREE** for everyone!
279 | ## License
280 |
281 |
282 |
283 |
284 | Preamble to the Apache License, Version 2.0
285 |
286 |
287 |
288 | Complete license is available in the [`LICENSE`](LICENSE) file.
289 |
290 | ```text
291 | Licensed to the Apache Software Foundation (ASF) under one
292 | or more contributor license agreements. See the NOTICE file
293 | distributed with this work for additional information
294 | regarding copyright ownership. The ASF licenses this file
295 | to you under the Apache License, Version 2.0 (the
296 | "License"); you may not use this file except in compliance
297 | with the License. You may obtain a copy of the License at
298 |
299 | https://www.apache.org/licenses/LICENSE-2.0
300 |
301 | Unless required by applicable law or agreed to in writing,
302 | software distributed under the License is distributed on an
303 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
304 | KIND, either express or implied. See the License for the
305 | specific language governing permissions and limitations
306 | under the License.
307 | ```
308 |
309 |
310 | ## Trademarks
311 |
312 | All other trademarks referenced herein are the property of their respective owners.
313 |
314 |
315 | ---
316 | Copyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright)
317 |
318 |
319 |
320 |
321 |
322 |
--------------------------------------------------------------------------------