Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: consider enabling/disabling cloudtrail as reason to update the landing zone #704

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/packages/@aws-lza/common/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export async function getLandingZoneDetails(
landingZoneDetails.accessLoggingBucketRetentionDays =
value['configurations']['accessLoggingBucket']['retentionDays'];
landingZoneDetails.kmsKeyArn = value['configurations']['kmsKeyArn'];
landingZoneDetails.enableOrganizationTrail = value['enabled'];
break;
}
}
Expand Down
4 changes: 4 additions & 0 deletions source/packages/@aws-lza/common/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ export type ControlTowerLandingZoneDetailsType = {
* The name of Sandbox organization unit (OU)
*/
sandboxOuName?: string;
/**
* Flag indicating Organization level CloudTrail is enable or not.
*/
enableOrganizationTrail?: boolean;
/**
* Flag indicating weather AWS Control Tower sets up AWS account access with IAM Identity Center or not
*/
Expand Down
9 changes: 9 additions & 0 deletions source/packages/@aws-lza/lib/control-tower/utils/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export type ControlTowerLandingZoneDetailsType = {
* AWS KMS CMK arn to encrypt AWS Control Tower Landing Zone resources
*/
kmsKeyArn?: string;
/**
* Flag indicating Organization level CloudTrail is enable or not.
*/
enableOrganizationTrail?: boolean;
};

/**
Expand Down Expand Up @@ -385,6 +389,11 @@ export function landingZoneUpdateOrResetRequired(
`Changes made in EnableIdentityCenterAccess from ${landingZoneDetails.enableIdentityCenterAccess} to ${landingZoneConfiguration.enableIdentityCenterAccess}`,
);
}
if (landingZoneDetails.enableOrganizationTrail !== landingZoneConfiguration.enableOrganizationTrail) {
reasons.push(
`Changes made in EnableOrganizationTrail from ${landingZoneDetails.enableOrganizationTrail} to ${landingZoneConfiguration.enableOrganizationTrail}`,
);
}

if (governedRegionsChanged(landingZoneDetails.governedRegions ?? [], landingZoneConfiguration.governedRegions)) {
reasons.push(
Expand Down
Loading