Skip to content

Commit 5cc34f1

Browse files
authored
Merge pull request #7 from meshcloud/feature/match-output-to-meshstack-input
Feature/match output to meshstack input
2 parents e4332f7 + c9041cd commit 5cc34f1

File tree

12 files changed

+103
-25
lines changed

12 files changed

+103
-25
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added CHANGELOG.md
1313
- Added pre-commit hooks
14+
- Added ARNs of managed accounts roles to output
15+
- Added meshStack access role to output
16+
- Renamed metering related parts from kraken to metering
1417

1518
## [v0.1.0]
1619

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
meshStack is a Cloud Foundation Platform by meshcloud. AWS is a proprietary public cloud platform provided by Amazon Web Services. meshStack supports project and user management for AWS to include AWS services into cloud projects managed by meshStack.
44

5-
This terraform module is used to integrate AWS into a meshStack instance as a meshPlatform. The output of this module is a set of credentials that need to be configured in meshStack as described in [meshcloud public docs](https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform.html).
5+
This terraform module is used to integrate AWS into a meshStack instance as a meshPlatform. The output of this module is a set of credentials that need to be configured in meshStack as described in [meshcloud public docs](https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform.html).
66

77
<p align="center">
88
<img src="/.github/Icon_AWS_Meshi_Hugs.png" width="250">
@@ -165,18 +165,18 @@ Before opening a Pull Request, we recommend following the below steps to get a f
165165
166166
| Name | Version |
167167
|------|---------|
168-
| <a name="provider_aws.automation"></a> [aws.automation](#provider\_aws.automation) | 4.21.0 |
169-
| <a name="provider_aws.management"></a> [aws.management](#provider\_aws.management) | 4.21.0 |
170-
| <a name="provider_aws.meshcloud"></a> [aws.meshcloud](#provider\_aws.meshcloud) | 4.21.0 |
168+
| <a name="provider_aws.automation"></a> [aws.automation](#provider\_aws.automation) | 4.57.1 |
169+
| <a name="provider_aws.management"></a> [aws.management](#provider\_aws.management) | 4.57.1 |
170+
| <a name="provider_aws.meshcloud"></a> [aws.meshcloud](#provider\_aws.meshcloud) | 4.57.1 |
171171
172172
## Modules
173173
174174
| Name | Source | Version |
175175
|------|--------|---------|
176176
| <a name="module_automation_account_replicator_access"></a> [automation\_account\_replicator\_access](#module\_automation\_account\_replicator\_access) | ./modules/meshcloud-replicator/replicator-automation-account-access | n/a |
177-
| <a name="module_management_account_kraken_access"></a> [management\_account\_kraken\_access](#module\_management\_account\_kraken\_access) | ./modules/meshcloud-cost-explorer/ce-management-account-access | n/a |
177+
| <a name="module_management_account_metering_access"></a> [management\_account\_metering\_access](#module\_management\_account\_metering\_access) | ./modules/meshcloud-cost-explorer/ce-management-account-access | n/a |
178178
| <a name="module_management_account_replicator_access"></a> [management\_account\_replicator\_access](#module\_management\_account\_replicator\_access) | ./modules/meshcloud-replicator/replicator-management-account-access | n/a |
179-
| <a name="module_meshcloud_account_kraken_access"></a> [meshcloud\_account\_kraken\_access](#module\_meshcloud\_account\_kraken\_access) | ./modules/meshcloud-cost-explorer/ce-meshcloud-account-access | n/a |
179+
| <a name="module_meshcloud_account_metering_access"></a> [meshcloud\_account\_metering\_access](#module\_meshcloud\_account\_metering\_access) | ./modules/meshcloud-cost-explorer/ce-meshcloud-account-access | n/a |
180180
| <a name="module_meshcloud_account_replicator_access"></a> [meshcloud\_account\_replicator\_access](#module\_meshcloud\_account\_replicator\_access) | ./modules/meshcloud-replicator/replicator-meshcloud-account-access | n/a |
181181
182182
## Resources
@@ -208,10 +208,14 @@ Before opening a Pull Request, we recommend following the below steps to get a f
208208
| Name | Description |
209209
|------|-------------|
210210
| <a name="output_automation_account_id"></a> [automation\_account\_id](#output\_automation\_account\_id) | Automation Account ID |
211+
| <a name="output_cost_explorer_management_account_role_arn"></a> [cost\_explorer\_management\_account\_role\_arn](#output\_cost\_explorer\_management\_account\_role\_arn) | Amazon Resource Name (ARN) of Management Account Role for replicator |
211212
| <a name="output_cost_explorer_privileged_external_id"></a> [cost\_explorer\_privileged\_external\_id](#output\_cost\_explorer\_privileged\_external\_id) | Cost explorer privileged\_external\_id |
212-
| <a name="output_kraken_aws_iam_keys"></a> [kraken\_aws\_iam\_keys](#output\_kraken\_aws\_iam\_keys) | You can access your credentials when you execute `terraform output kraken_aws_iam_keys` command |
213213
| <a name="output_management_account_id"></a> [management\_account\_id](#output\_management\_account\_id) | Management Account ID |
214214
| <a name="output_meshcloud_account_id"></a> [meshcloud\_account\_id](#output\_meshcloud\_account\_id) | Meshcloud Account ID |
215+
| <a name="output_meshstack_access_role_name"></a> [meshstack\_access\_role\_name](#output\_meshstack\_access\_role\_name) | The name for the Account Access Role that will be rolled out to all managed accounts. |
216+
| <a name="output_metering_aws_iam_keys"></a> [metering\_aws\_iam\_keys](#output\_metering\_aws\_iam\_keys) | You can access your credentials when you execute `terraform output metering_aws_iam_keys` command |
217+
| <a name="output_replicator_automation_account_role_arn"></a> [replicator\_automation\_account\_role\_arn](#output\_replicator\_automation\_account\_role\_arn) | Amazon Resource Name (ARN) of Automation Account Role for replicator |
215218
| <a name="output_replicator_aws_iam_keys"></a> [replicator\_aws\_iam\_keys](#output\_replicator\_aws\_iam\_keys) | You can access your credentials when you execute `terraform output replicator_aws_iam_keys` command |
219+
| <a name="output_replicator_management_account_role_arn"></a> [replicator\_management\_account\_role\_arn](#output\_replicator\_management\_account\_role\_arn) | Amazon Resource Name (ARN) of Management Account Role for replicator |
216220
| <a name="output_replicator_privileged_external_id"></a> [replicator\_privileged\_external\_id](#output\_replicator\_privileged\_external\_id) | Replicator privileged\_external\_id |
217221
<!-- END_TF_DOCS -->

examples/basic-aws-integration/main.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
# Remove/comment the backend block below if you are only testing the module.
66
# Please be aware that you cannot destroy the created resources via terraform if you lose the state file.
77
terraform {
8-
backend "gcs" {
9-
prefix = "meshplatforms/aws"
10-
bucket = "my-terraform-states"
8+
backend "s3" {
9+
region = "eu-west-1"
10+
profile = "myprofile"
11+
bucket = "cloudfoundation-tfstates"
12+
key = "meshstack/platforms/aws"
13+
encrypt = true
1114
}
1215
}
1316

@@ -42,4 +45,5 @@ module "meshplatform" {
4245
aws_enrollment_enabled = true
4346
replicator_privileged_external_id = "replace with random UUID v4"
4447
cost_explorer_privileged_external_id = "replace with random UUID v4"
48+
landing_zone_ou_arns = ["arn:aws:organizations::*:ou/o-*/ou-*"]
4549
}

examples/basic-aws-integration/outputs.tf

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,38 @@ output "replicator_aws_iam_keys" {
1919
sensitive = true
2020
}
2121

22+
output "replicator_management_account_role_arn" {
23+
description = "Amazon Resource Name (ARN) of Management Account Role for replicator"
24+
value = module.meshplatform.replicator_management_account_role_arn
25+
}
26+
27+
output "replicator_automation_account_role_arn" {
28+
description = "Amazon Resource Name (ARN) of Automation Account Role for replicator"
29+
value = module.meshplatform.replicator_automation_account_role_arn
30+
}
31+
2232
output "replicator_privileged_external_id" {
2333
value = module.meshplatform.replicator_privileged_external_id
2434
description = "Replicator privileged_external_id"
2535
sensitive = true
2636
}
2737

28-
output "kraken_aws_iam_keys" {
29-
value = module.meshplatform.kraken_aws_iam_keys
30-
description = "You can access your credentials when you execute `terraform output kraken_aws_iam_keys` command"
38+
output "meshstack_access_role_name" {
39+
value = module.meshplatform.meshstack_access_role_name
40+
description = "The name for the Account Access Role that will be rolled out to all managed accounts."
41+
}
42+
43+
output "metering_aws_iam_keys" {
44+
value = module.meshplatform.metering_aws_iam_keys
45+
description = "You can access your credentials when you execute `terraform output metering_aws_iam_keys` command"
3146
sensitive = true
3247
}
3348

49+
output "cost_explorer_management_account_role_arn" {
50+
description = "Amazon Resource Name (ARN) of Management Account Role for replicator"
51+
value = module.meshplatform.cost_explorer_management_account_role_arn
52+
}
53+
3454
output "cost_explorer_privileged_external_id" {
3555
value = module.meshplatform.cost_explorer_privileged_external_id
3656
description = "Cost explorer privileged_external_id"

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data "aws_caller_identity" "automation" {
88
provider = aws.automation
99
}
1010

11-
module "meshcloud_account_kraken_access" {
11+
module "meshcloud_account_metering_access" {
1212
source = "./modules/meshcloud-cost-explorer/ce-meshcloud-account-access"
1313
providers = {
1414
aws = aws.meshcloud
@@ -32,7 +32,7 @@ module "meshcloud_account_replicator_access" {
3232
automation_account_service_role_name = var.automation_account_service_role_name
3333
}
3434

35-
module "management_account_kraken_access" {
35+
module "management_account_metering_access" {
3636
source = "./modules/meshcloud-cost-explorer/ce-management-account-access"
3737
providers = {
3838
aws = aws.management
@@ -43,7 +43,7 @@ module "management_account_kraken_access" {
4343
meshcloud_account_service_user_name = var.cost_explorer_meshcloud_account_service_user_name
4444

4545
depends_on = [
46-
module.meshcloud_account_kraken_access
46+
module.meshcloud_account_metering_access
4747
]
4848
}
4949

modules/meshcloud-cost-explorer/ce-management-account-access/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
| Name | Version |
1111
|------|---------|
12-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.21.0 |
12+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.7.0 |
1313

1414
## Modules
1515

@@ -37,5 +37,7 @@ No modules.
3737

3838
## Outputs
3939

40-
No outputs.
40+
| Name | Description |
41+
|------|-------------|
42+
| <a name="output_management_account_role_arn"></a> [management\_account\_role\_arn](#output\_management\_account\_role\_arn) | Amazon Resource Name (ARN) of Management Account Role |
4143
<!-- END_TF_DOCS -->
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "management_account_role_arn" {
2+
description = "Amazon Resource Name (ARN) of Management Account Role"
3+
value = aws_iam_role.cost_explorer_service.arn
4+
}

modules/meshcloud-replicator/replicator-automation-account-access/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
| Name | Version |
1111
|------|---------|
12-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.21.0 |
12+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.7.0 |
1313

1414
## Modules
1515

@@ -42,5 +42,7 @@ No modules.
4242

4343
## Outputs
4444

45-
No outputs.
45+
| Name | Description |
46+
|------|-------------|
47+
| <a name="output_automation_account_role_arn"></a> [automation\_account\_role\_arn](#output\_automation\_account\_role\_arn) | Amazon Resource Name (ARN) of Automation Account Role |
4648
<!-- END_TF_DOCS -->
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "automation_account_role_arn" {
2+
description = "Amazon Resource Name (ARN) of Automation Account Role"
3+
value = aws_iam_role.meshfed_automation.arn
4+
}

modules/meshcloud-replicator/replicator-management-account-access/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
| Name | Version |
1111
|------|---------|
12-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.21.0 |
12+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.7.0 |
1313

1414
## Modules
1515

@@ -47,5 +47,8 @@ No modules.
4747

4848
## Outputs
4949

50-
No outputs.
50+
| Name | Description |
51+
|------|-------------|
52+
| <a name="output_management_account_role_arn"></a> [management\_account\_role\_arn](#output\_management\_account\_role\_arn) | Amazon Resource Name (ARN) of Management Account Role |
53+
| <a name="output_meshstack_access_role_name"></a> [meshstack\_access\_role\_name](#output\_meshstack\_access\_role\_name) | The name for the Account Access Role that will be rolled out to all managed accounts. |
5154
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)