aws-data-landing-zone 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +7 -7
- package/assets/constructs/dlz-tag-compliance-alert/lambda/tag-alert-formatter/index.js +51 -24
- package/assets/constructs/dlz-tag-compliance-alert/lambda/tag-alert-formatter/index.js.map +3 -3
- package/lib/constructs/account-chatbots/index.js +1 -1
- package/lib/constructs/dlz-account-budgets/index.js +1 -1
- package/lib/constructs/dlz-budget/index.js +1 -1
- package/lib/constructs/dlz-control-tower-control/control-tower-control.js +1 -1
- package/lib/constructs/dlz-cost-anomaly-detection/index.js +1 -1
- package/lib/constructs/dlz-data-exports/dlz-data-export.js +1 -1
- package/lib/constructs/dlz-data-exports/dlz-data-exports-athena.js +1 -1
- package/lib/constructs/dlz-data-exports/dlz-data-exports-data-plane.js +1 -1
- package/lib/constructs/dlz-data-exports/dlz-data-exports-tag-activation.js +1 -1
- package/lib/constructs/dlz-guardduty/guardduty-delegated-admin.js +1 -1
- package/lib/constructs/dlz-guardduty/guardduty-member-features.js +1 -1
- package/lib/constructs/dlz-guardduty/guardduty-org-config.js +1 -1
- package/lib/constructs/dlz-lake-formation/dlz-lake-formation.js +1 -1
- package/lib/constructs/dlz-macie/macie-delegated-admin.js +1 -1
- package/lib/constructs/dlz-macie/macie-members.js +1 -1
- package/lib/constructs/dlz-macie/macie-org-config.js +1 -1
- package/lib/constructs/dlz-ssm-reader/dlz-ssm-reader-stack-cache.js +1 -1
- package/lib/constructs/dlz-ssm-reader/dlz-ssm-reader.js +1 -1
- package/lib/constructs/dlz-stack/index.js +1 -1
- package/lib/constructs/dlz-tag-compliance-alert/index.js +8 -7
- package/lib/constructs/dlz-tag-compliance-alert/lambda/tag-alert-formatter/index.js +55 -21
- package/lib/constructs/dlz-vpc/dlz-account-networks.js +1 -1
- package/lib/constructs/dlz-vpc/dlz-vpc.js +1 -1
- package/lib/constructs/dlz-vpc/network-address.js +1 -1
- package/lib/constructs/iam/iam-account-alias.js +1 -1
- package/lib/constructs/iam/iam-password-policy.js +1 -1
- package/lib/constructs/iam-identity-center/iam-identity-center-group.js +1 -1
- package/lib/constructs/iam-identity-center/iam-identity-center.js +1 -1
- package/lib/constructs/iam-identity-center/identity-store-user.js +1 -1
- package/lib/constructs/organization-policies/scp-merge.js +2 -2
- package/lib/constructs/organization-policies/scp-presets/control-tower-exemption.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-actions-outside-regions.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-backup-vault-lock.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-bedrock-provisioned-throughput.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-cfn-stacks-without-standard-tags.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-dedicated-infra-and-subscriptions.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-disabling-security-services.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-domain-registrations.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-glacier-vault-lock.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-iam-without-permissions-boundary.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-leaving-organization.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-marketplace-subscriptions.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-reserved-capacity-purchases.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-resource-creation-without-standard-tags.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-root-credentials-management-in-member-accounts.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-root-user-actions.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-s3-object-lock-and-retention.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-s3-public-access-bypass.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-savings-plan-purchases.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/deny-service-actions.js +1 -1
- package/lib/constructs/organization-policies/scp-presets/finops-account-baseline.js +1 -1
- package/lib/constructs/organization-policies/service-control-policy.js +1 -1
- package/lib/constructs/organization-policies/tag-policy.js +1 -1
- package/lib/data-landing-zone-client.js +1 -1
- package/lib/data-landing-zone.js +1 -1
- package/lib/defaults.js +1 -1
- package/lib/lib/report/index.js +1 -1
- package/lib/scripts/index.js +1 -1
- package/lib/stacks/organization/management/management-data-exports-stack.js +1 -1
- package/lib/stacks/organization/management/management-global-iam-identity-center-stack.js +1 -1
- package/lib/stacks/organization/management/management-global-stack.js +1 -1
- package/lib/stacks/organization/security/audit/global-stack.js +1 -1
- package/lib/stacks/organization/security/audit/regional-stack.js +1 -1
- package/lib/stacks/organization/security/log/global-stack.js +1 -1
- package/lib/stacks/organization/security/log/regional-stack.js +1 -1
- package/lib/stacks/organization/shared-services/finops/global-stack.js +1 -1
- package/lib/stacks/organization/workloads/base/global-stack.js +1 -1
- package/lib/stacks/organization/workloads/base/regional-stack.js +1 -1
- package/lib/stacks/organization/workloads/data-services-phase-1-stack/global-stack.js +1 -1
- package/lib/stacks/organization/workloads/data-services-phase-1-stack/regional-stack.js +1 -1
- package/lib/stacks/organization/workloads/network-connections-phase-1-stack/global-stack.js +1 -1
- package/lib/stacks/organization/workloads/network-connections-phase-2-stack/global-stack.js +1 -1
- package/lib/stacks/organization/workloads/network-connections-phase-2-stack/regional-stack.js +1 -1
- package/lib/stacks/organization/workloads/network-connections-phase-3-stack/global-stack.js +1 -1
- package/lib/stacks/organization/workloads/network-connections-phase-3-stack/regional-stack.js +1 -1
- package/package.json +1 -1
package/.jsii
CHANGED
|
@@ -17594,7 +17594,7 @@
|
|
|
17594
17594
|
},
|
|
17595
17595
|
"locationInModule": {
|
|
17596
17596
|
"filename": "src/constructs/dlz-tag-compliance-alert/index.ts",
|
|
17597
|
-
"line":
|
|
17597
|
+
"line": 154
|
|
17598
17598
|
},
|
|
17599
17599
|
"parameters": [
|
|
17600
17600
|
{
|
|
@@ -17620,7 +17620,7 @@
|
|
|
17620
17620
|
"kind": "class",
|
|
17621
17621
|
"locationInModule": {
|
|
17622
17622
|
"filename": "src/constructs/dlz-tag-compliance-alert/index.ts",
|
|
17623
|
-
"line":
|
|
17623
|
+
"line": 153
|
|
17624
17624
|
},
|
|
17625
17625
|
"name": "DlzTagComplianceForwardingRule",
|
|
17626
17626
|
"symbolId": "src/constructs/dlz-tag-compliance-alert/index:DlzTagComplianceForwardingRule"
|
|
@@ -17635,7 +17635,7 @@
|
|
|
17635
17635
|
"kind": "interface",
|
|
17636
17636
|
"locationInModule": {
|
|
17637
17637
|
"filename": "src/constructs/dlz-tag-compliance-alert/index.ts",
|
|
17638
|
-
"line":
|
|
17638
|
+
"line": 141
|
|
17639
17639
|
},
|
|
17640
17640
|
"name": "DlzTagComplianceForwardingRuleProps",
|
|
17641
17641
|
"properties": [
|
|
@@ -17648,7 +17648,7 @@
|
|
|
17648
17648
|
"immutable": true,
|
|
17649
17649
|
"locationInModule": {
|
|
17650
17650
|
"filename": "src/constructs/dlz-tag-compliance-alert/index.ts",
|
|
17651
|
-
"line":
|
|
17651
|
+
"line": 145
|
|
17652
17652
|
},
|
|
17653
17653
|
"name": "centralBusArn",
|
|
17654
17654
|
"type": {
|
|
@@ -17665,7 +17665,7 @@
|
|
|
17665
17665
|
"immutable": true,
|
|
17666
17666
|
"locationInModule": {
|
|
17667
17667
|
"filename": "src/constructs/dlz-tag-compliance-alert/index.ts",
|
|
17668
|
-
"line":
|
|
17668
|
+
"line": 143
|
|
17669
17669
|
},
|
|
17670
17670
|
"name": "configRuleNames",
|
|
17671
17671
|
"type": {
|
|
@@ -26851,6 +26851,6 @@
|
|
|
26851
26851
|
"symbolId": "src/stacks/organization/workloads/base/regional-stack:WorkloadRegionalStack"
|
|
26852
26852
|
}
|
|
26853
26853
|
},
|
|
26854
|
-
"version": "0.6.
|
|
26855
|
-
"fingerprint": "
|
|
26854
|
+
"version": "0.6.7",
|
|
26855
|
+
"fingerprint": "SXEmh7i67SrxocaBJG5pHvAnjXyQiEmzPRfVRxJCUD0="
|
|
26856
26856
|
}
|
|
@@ -29287,7 +29287,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
29287
29287
|
return [endpoints.getEndpointPlugin(config2, Command2.getEndpointParameterInstructions())];
|
|
29288
29288
|
}).s("AWSOrganizationsV20161128", "ListRoots", {}).n("OrganizationsClient", "ListRootsCommand").sc(schemas_0.ListRoots$).build() {
|
|
29289
29289
|
};
|
|
29290
|
-
var
|
|
29290
|
+
var ListTagsForResourceCommand2 = class extends client.Command.classBuilder().ep(commonParams5).m(function(Command2, cs, config2, o3) {
|
|
29291
29291
|
return [endpoints.getEndpointPlugin(config2, Command2.getEndpointParameterInstructions())];
|
|
29292
29292
|
}).s("AWSOrganizationsV20161128", "ListTagsForResource", {}).n("OrganizationsClient", "ListTagsForResourceCommand").sc(schemas_0.ListTagsForResource$).build() {
|
|
29293
29293
|
};
|
|
@@ -29351,7 +29351,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
29351
29351
|
var paginateListPoliciesForTarget = core.createPaginator(OrganizationsClient2, ListPoliciesForTargetCommand, "NextToken", "NextToken", "MaxResults");
|
|
29352
29352
|
var paginateListPolicies = core.createPaginator(OrganizationsClient2, ListPoliciesCommand, "NextToken", "NextToken", "MaxResults");
|
|
29353
29353
|
var paginateListRoots = core.createPaginator(OrganizationsClient2, ListRootsCommand, "NextToken", "NextToken", "MaxResults");
|
|
29354
|
-
var paginateListTagsForResource = core.createPaginator(OrganizationsClient2,
|
|
29354
|
+
var paginateListTagsForResource = core.createPaginator(OrganizationsClient2, ListTagsForResourceCommand2, "NextToken", "NextToken", "");
|
|
29355
29355
|
var paginateListTargetsForPolicy = core.createPaginator(OrganizationsClient2, ListTargetsForPolicyCommand, "NextToken", "NextToken", "MaxResults");
|
|
29356
29356
|
var commands5 = {
|
|
29357
29357
|
AcceptHandshakeCommand,
|
|
@@ -29405,7 +29405,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
29405
29405
|
ListPoliciesCommand,
|
|
29406
29406
|
ListPoliciesForTargetCommand,
|
|
29407
29407
|
ListRootsCommand,
|
|
29408
|
-
ListTagsForResourceCommand,
|
|
29408
|
+
ListTagsForResourceCommand: ListTagsForResourceCommand2,
|
|
29409
29409
|
ListTargetsForPolicyCommand,
|
|
29410
29410
|
MoveAccountCommand,
|
|
29411
29411
|
PutResourcePolicyCommand,
|
|
@@ -29758,7 +29758,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
29758
29758
|
exports2.ListPoliciesCommand = ListPoliciesCommand;
|
|
29759
29759
|
exports2.ListPoliciesForTargetCommand = ListPoliciesForTargetCommand;
|
|
29760
29760
|
exports2.ListRootsCommand = ListRootsCommand;
|
|
29761
|
-
exports2.ListTagsForResourceCommand =
|
|
29761
|
+
exports2.ListTagsForResourceCommand = ListTagsForResourceCommand2;
|
|
29762
29762
|
exports2.ListTargetsForPolicyCommand = ListTargetsForPolicyCommand;
|
|
29763
29763
|
exports2.MoveAccountCommand = MoveAccountCommand;
|
|
29764
29764
|
exports2.OrganizationFeatureSet = OrganizationFeatureSet;
|
|
@@ -32320,7 +32320,7 @@ var require_dist_cjs17 = __commonJS({
|
|
|
32320
32320
|
};
|
|
32321
32321
|
var ListSubscriptionsCommand = class extends command5(_ep05, _mw05, "ListSubscriptions", ListSubscriptions$) {
|
|
32322
32322
|
};
|
|
32323
|
-
var
|
|
32323
|
+
var ListTagsForResourceCommand2 = class extends command5(_ep05, _mw05, "ListTagsForResource", ListTagsForResource$) {
|
|
32324
32324
|
};
|
|
32325
32325
|
var ListTopicsCommand = class extends command5(_ep05, _mw05, "ListTopics", ListTopics$) {
|
|
32326
32326
|
};
|
|
@@ -32388,7 +32388,7 @@ var require_dist_cjs17 = __commonJS({
|
|
|
32388
32388
|
ListSMSSandboxPhoneNumbersCommand,
|
|
32389
32389
|
ListSubscriptionsCommand,
|
|
32390
32390
|
ListSubscriptionsByTopicCommand,
|
|
32391
|
-
ListTagsForResourceCommand,
|
|
32391
|
+
ListTagsForResourceCommand: ListTagsForResourceCommand2,
|
|
32392
32392
|
ListTopicsCommand,
|
|
32393
32393
|
OptInPhoneNumberCommand,
|
|
32394
32394
|
PublishCommand: PublishCommand2,
|
|
@@ -32586,7 +32586,7 @@ var require_dist_cjs17 = __commonJS({
|
|
|
32586
32586
|
exports2.ListSubscriptionsInput$ = ListSubscriptionsInput$;
|
|
32587
32587
|
exports2.ListSubscriptionsResponse$ = ListSubscriptionsResponse$;
|
|
32588
32588
|
exports2.ListTagsForResource$ = ListTagsForResource$;
|
|
32589
|
-
exports2.ListTagsForResourceCommand =
|
|
32589
|
+
exports2.ListTagsForResourceCommand = ListTagsForResourceCommand2;
|
|
32590
32590
|
exports2.ListTagsForResourceRequest$ = ListTagsForResourceRequest$;
|
|
32591
32591
|
exports2.ListTagsForResourceResponse$ = ListTagsForResourceResponse$;
|
|
32592
32592
|
exports2.ListTopics$ = ListTopics$;
|
|
@@ -32714,35 +32714,62 @@ var import_client_organizations = __toESM(require_dist_cjs16());
|
|
|
32714
32714
|
var import_client_sns = __toESM(require_dist_cjs17());
|
|
32715
32715
|
var org = new import_client_organizations.OrganizationsClient({});
|
|
32716
32716
|
var sns = new import_client_sns.SNSClient({});
|
|
32717
|
-
var
|
|
32718
|
-
async function
|
|
32719
|
-
if (
|
|
32720
|
-
return
|
|
32717
|
+
var infoCache = {};
|
|
32718
|
+
async function accountInfo(accountId) {
|
|
32719
|
+
if (infoCache[accountId]) {
|
|
32720
|
+
return infoCache[accountId];
|
|
32721
32721
|
}
|
|
32722
|
+
let name = accountId;
|
|
32723
|
+
let slackId;
|
|
32722
32724
|
try {
|
|
32723
32725
|
const res = await org.send(new import_client_organizations.DescribeAccountCommand({ AccountId: accountId }));
|
|
32724
|
-
|
|
32725
|
-
nameCache[accountId] = name;
|
|
32726
|
-
return name;
|
|
32726
|
+
name = res.Account?.Name ?? accountId;
|
|
32727
32727
|
} catch {
|
|
32728
|
-
return accountId;
|
|
32729
32728
|
}
|
|
32729
|
+
try {
|
|
32730
|
+
const res = await org.send(new import_client_organizations.ListTagsForResourceCommand({ ResourceId: accountId }));
|
|
32731
|
+
slackId = res.Tags?.find((t) => t.Key === "SlackId")?.Value || void 0;
|
|
32732
|
+
} catch {
|
|
32733
|
+
}
|
|
32734
|
+
const info = { accountName: name, slackId };
|
|
32735
|
+
infoCache[accountId] = info;
|
|
32736
|
+
return info;
|
|
32737
|
+
}
|
|
32738
|
+
function slackMention(slackId) {
|
|
32739
|
+
if (!slackId) {
|
|
32740
|
+
return void 0;
|
|
32741
|
+
}
|
|
32742
|
+
return slackId.startsWith("S") ? `<!subteam^${slackId}>` : `<@${slackId}>`;
|
|
32730
32743
|
}
|
|
32731
32744
|
async function handler(event) {
|
|
32732
32745
|
const id = event.account;
|
|
32733
|
-
const
|
|
32734
|
-
const
|
|
32735
|
-
const
|
|
32736
|
-
|
|
32737
|
-
|
|
32738
|
-
|
|
32739
|
-
|
|
32746
|
+
const { accountName, slackId } = await accountInfo(id);
|
|
32747
|
+
const detail = event.detail ?? {};
|
|
32748
|
+
const resourceType = detail.resourceType ?? "unknown";
|
|
32749
|
+
const resourceId = detail.resourceId ?? "unknown";
|
|
32750
|
+
const mention = slackMention(slackId);
|
|
32751
|
+
const lines = [
|
|
32752
|
+
`- Account: **${accountName}** (${id})`,
|
|
32753
|
+
`- Resource Type: ${resourceType}`,
|
|
32754
|
+
`- Resource ID: **${resourceId}**`,
|
|
32755
|
+
`- Region: ${event.region}`
|
|
32756
|
+
];
|
|
32757
|
+
if (mention) {
|
|
32758
|
+
lines.push(`- Owner: ${mention}`);
|
|
32759
|
+
}
|
|
32760
|
+
lines.push("", "This resource is missing mandatory tags. Please tag it.");
|
|
32740
32761
|
const message = JSON.stringify({
|
|
32741
32762
|
version: "1.0",
|
|
32742
32763
|
source: "custom",
|
|
32743
|
-
content: {
|
|
32764
|
+
content: {
|
|
32765
|
+
textType: "client-markdown",
|
|
32766
|
+
title: `\u26A0\uFE0F Untagged resource in ${accountName}`,
|
|
32767
|
+
description: lines.join("\n")
|
|
32768
|
+
}
|
|
32744
32769
|
});
|
|
32745
|
-
await sns.send(
|
|
32770
|
+
await sns.send(
|
|
32771
|
+
new import_client_sns.PublishCommand({ TopicArn: process.env.TOPIC_ARN, Message: message })
|
|
32772
|
+
);
|
|
32746
32773
|
}
|
|
32747
32774
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32748
32775
|
0 && (module.exports = {
|