Skip to content

Commit 0f2caea

Browse files
author
AWS
committed
Release: 1.6.0
1 parent 3169235 commit 0f2caea

File tree

17 files changed

+269
-6
lines changed

17 files changed

+269
-6
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ for more information.
5454

5555
Now that you have configured and deployed AWS Control Tower Account Factory for Terraform, follow the steps outlined in [Post-deployment steps](https://docs.aws.amazon.com/controltower/latest/userguide/aft-post-deployment.html) and [Provision accounts with AWS Control Tower Account Factory for Terraform](https://docs.aws.amazon.com/controltower/latest/userguide/taf-account-provisioning.html) to begin using your environment.
5656

57+
## Collection of Operational Metrics
58+
As of version 1.6.0, AFT collects anonymous operational metrics to help AWS improve the quality and features of the solution. For more information, including how to disable this capability, please see the [documentation here](https://docs.aws.amazon.com/controltower/latest/userguide/aft-operational-metrics.html).
59+
5760

5861
<!-- BEGIN_TF_DOCS -->
5962
## Requirements
@@ -108,6 +111,7 @@ Now that you have configured and deployed AWS Control Tower Account Factory for
108111
| <a name="input_aft_framework_repo_git_ref"></a> [aft\_framework\_repo\_git\_ref](#input\_aft\_framework\_repo\_git\_ref) | Git branch from which the AFT framework should be sourced from | `string` | `null` | no |
109112
| <a name="input_aft_framework_repo_url"></a> [aft\_framework\_repo\_url](#input\_aft\_framework\_repo\_url) | Git repo URL where the AFT framework should be sourced from | `string` | `"https://github.com/aws-ia/terraform-aws-control_tower_account_factory.git"` | no |
110113
| <a name="input_aft_management_account_id"></a> [aft\_management\_account\_id](#input\_aft\_management\_account\_id) | AFT Management Account ID | `string` | n/a | yes |
114+
| <a name="input_aft_metrics_reporting"></a> [aft\_metrics\_reporting](#input\_aft\_metrics\_reporting) | Flag toggling reporting of operational metrics | `bool` | `true` | no |
111115
| <a name="input_aft_vpc_cidr"></a> [aft\_vpc\_cidr](#input\_aft\_vpc\_cidr) | CIDR Block to allocate to the AFT VPC | `string` | `"192.168.0.0/22"` | no |
112116
| <a name="input_aft_vpc_endpoints"></a> [aft\_vpc\_endpoints](#input\_aft\_vpc\_endpoints) | Flag turning VPC endpoints on/off for AFT VPC | `bool` | `true` | no |
113117
| <a name="input_aft_vpc_private_subnet_01_cidr"></a> [aft\_vpc\_private\_subnet\_01\_cidr](#input\_aft\_vpc\_private\_subnet\_01\_cidr) | CIDR Block to allocate to the Private Subnet 01 | `string` | `"192.168.0.0/24"` | no |

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.2
1+
1.6.0

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,5 @@ module "aft_ssm_parameters" {
243243
account_provisioning_customizations_repo_branch = var.account_provisioning_customizations_repo_branch
244244
maximum_concurrent_customizations = var.maximum_concurrent_customizations
245245
github_enterprise_url = var.github_enterprise_url
246+
aft_metrics_reporting = var.aft_metrics_reporting
246247
}

modules/aft-customizations/buildspecs/aft-account-customizations-terraform.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ phases:
8787
fi
8888
8989
build:
90-
on-failure: ABORT
90+
on-failure: CONTINUE
9191
commands:
9292
# Apply Customizations
9393
- |
@@ -136,6 +136,14 @@ phases:
136136
post_build:
137137
on-failure: ABORT
138138
commands:
139+
- export PYTHONPATH="$DEFAULT_PATH/aws-aft-core-framework/sources/aft-lambda-layer:$PYTHONPATH"
140+
- export AWS_PROFILE=aft-management
141+
- python3 $DEFAULT_PATH/aws-aft-core-framework/sources/aft-lambda-layer/aft_common/report_metrics.py --codebuild-name "aft-account-customizations" --codebuild-status $CODEBUILD_BUILD_SUCCEEDING
142+
- unset AWS_PROFILE
143+
- |
144+
if [[ $CODEBUILD_BUILD_SUCCEEDING == 0 ]]; then
145+
exit 1
146+
fi
139147
- |
140148
if [[ ! -z "$CUSTOMIZATION" ]]; then
141149
source $DEFAULT_PATH/api-helpers-venv/bin/activate

modules/aft-customizations/buildspecs/aft-global-customizations-terraform.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ phases:
6969
- unset AWS_PROFILE
7070

7171
build:
72-
on-failure: ABORT
72+
on-failure: CONTINUE
7373
commands:
7474
# Apply customizations
7575
- source $DEFAULT_PATH/aft-venv/bin/activate
@@ -115,6 +115,14 @@ phases:
115115
post_build:
116116
on-failure: ABORT
117117
commands:
118+
- export PYTHONPATH="$DEFAULT_PATH/aws-aft-core-framework/sources/aft-lambda-layer:$PYTHONPATH"
119+
- export AWS_PROFILE=aft-management
120+
- python3 $DEFAULT_PATH/aws-aft-core-framework/sources/aft-lambda-layer/aft_common/report_metrics.py --codebuild-name "aft-global-customizations" --codebuild-status $CODEBUILD_BUILD_SUCCEEDING
121+
- unset AWS_PROFILE
122+
- |
123+
if [[ $CODEBUILD_BUILD_SUCCEEDING == 0 ]]; then
124+
exit 1
125+
fi
118126
- source $DEFAULT_PATH/api-helpers-venv/bin/activate
119127
- export AWS_PROFILE=aft-target
120128
- $DEFAULT_PATH/api_helpers/post-api-helpers.sh

modules/aft-ssm-parameters/ssm.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,18 @@ resource "aws_ssm_parameter" "aft_maximum_concurrent_customizations" {
368368
value = var.maximum_concurrent_customizations
369369
type = "String"
370370
}
371+
372+
resource "aws_ssm_parameter" "aft_metrics_reporting" {
373+
name = "/aft/config/metrics-reporting"
374+
value = var.aft_metrics_reporting
375+
type = "String"
376+
}
377+
378+
resource "random_uuid" "metrics_reporting_uuid" {
379+
}
380+
381+
resource "aws_ssm_parameter" "aft_metrics_reporting_uuid" {
382+
name = "/aft/config/metrics-reporting-uuid"
383+
value = random_uuid.metrics_reporting_uuid.result
384+
type = "String"
385+
}

modules/aft-ssm-parameters/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,7 @@ variable "maximum_concurrent_customizations" {
249249
variable "aft_version" {
250250
type = string
251251
}
252+
253+
variable "aft_metrics_reporting" {
254+
type = string
255+
}

sources/aft-lambda-layer/aft_common/account_provisioning_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import aft_common.aft_utils as utils
1111
import jsonschema
12+
from aft_common.aft_types import AftAccountInfo
1213
from aft_common.auth import AuthClient
13-
from aft_common.types import AftAccountInfo
1414
from boto3.session import Session
1515
from botocore.exceptions import ClientError
1616

sources/aft-lambda-layer/aft_common/aft_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
STSClient = object
6464

6565

66-
from aft_common.types import AftAccountInfo
66+
from aft_common.aft_types import AftAccountInfo
6767

6868
from .logger import Logger
6969

@@ -129,6 +129,12 @@
129129
SSM_PARAM_ACCOUNT_LOG_ARCHIVE_ACCOUNT_ID = "/aft/account/log-archive/account-id"
130130
SSM_PARAM_ACCOUNT_AFT_MANAGEMENT_ACCOUNT_ID = "/aft/account/aft-management/account-id"
131131

132+
SSM_PARAM_ACCOUNT_AFT_VERSION = "/aft/config/aft/version"
133+
SSM_PARAM_ACCOUNT_TERRAFORM_VERSION = "/aft/config/terraform/version"
134+
135+
SSM_PARAM_AFT_METRICS_REPORTING = "/aft/config/metrics-reporting"
136+
SSM_PARAM_AFT_METRICS_REPORTING_UUID = "/aft/config/metrics-reporting-uuid"
137+
132138

133139
# INIT
134140
def get_logger() -> Logger:

0 commit comments

Comments
 (0)