Terraform module which creates Child Accounts and SSO permissions assignements resources on AWS. It will also create a Terraform Backend in Child Accounts. This module is an abstraction of the terraform-aws-sso by @cloudposse.
- AAOps I can create child AWS account with terraform backend for my organization
- AAOps I can give my users rights to all the accounts of my organization
- An organization AWS account
- AWS SSO enabled (in the right region)
- In AWS SSO settings, MFA configured
- AWS SSO Groups created
module "orga" {
source = "https://github.com/padok-team/terraform-aws-orga"
accounts = {
staging = {
email = "aws+staging@company.com"
tf_admin_groups = ["padok"]
},
prod = {
email = "aws+prod@company.com"
tf_admin_groups = ["padok"]
}
}
account_assignements = {
stagging = {
settlers = ["padok", "dev"],
},
prod = {
settlers = ["padok"],
watchers = ["dev"]
}
}
permission_sets = [
{
name = "settlers",
description = "Allow Full Access to the account",
relay_state = "",
session_duration = "",
tags = {},
inline_policy = "",
policy_attachments = ["arn:aws:iam::aws:policy/AdministratorAccess"]
},
{
name = "watchers",
description = "Allow ViewOnly access to the account",
relay_state = "",
session_duration = "",
tags = {},
inline_policy = "",
policy_attachments = ["arn:aws:iam::aws:policy/job-function/ViewOnlyAccess"]
}
]
}
Warning : You need to make the terraform apply in two step.
# First create only the accounts
terraform apply -target module.orga.aws_organizations_account.this
# Then everythings else
terrform apply
- Give users access to the AWS organization accounts with AWS SSO
- Create 3 AWS account (staging, preprod, prod) and give my users access with AWS SSO
Name | Description | Type | Default | Required |
---|---|---|---|---|
account_assignements | List of assignements between an account within the organization, a permission set and a group. | map(map(list(string))) |
n/a | yes |
accounts | List of accounts to be created | map(object({ |
n/a | yes |
permission_sets | List of available permission sets | list(object({ |
n/a | yes |
Name | Description |
---|---|
accounts_information | List of accounts created with terraform backend information |
See LICENSE for full details.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.