aws-data-landing-zone 0.0.50 → 0.0.52

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.
Files changed (50) hide show
  1. package/.jsii +114 -107
  2. package/API.md +15 -4
  3. package/docs/src/content/docs/components/account-management/tagging.mdx +13 -5
  4. package/docs/src/content/docs/reference/api.md +15 -4
  5. package/internal/extract-tag-policy-enforcement-resources.ts +57 -0
  6. package/internal/package-lock.json +2333 -0
  7. package/internal/package.json +23 -0
  8. package/internal/tsconfig.json +30 -0
  9. package/lib/constructs/account-chatbots/index.js +1 -1
  10. package/lib/constructs/dlz-budget/index.js +1 -1
  11. package/lib/constructs/dlz-control-tower-control/control-tower-control.js +1 -1
  12. package/lib/constructs/dlz-lake-formation/dlz-lake-formation.js +1 -1
  13. package/lib/constructs/dlz-ssm-reader/dlz-ssm-reader-stack-cache.js +1 -1
  14. package/lib/constructs/dlz-ssm-reader/dlz-ssm-reader.js +1 -1
  15. package/lib/constructs/dlz-stack/index.js +1 -1
  16. package/lib/constructs/dlz-vpc/dlz-account-networks.js +1 -1
  17. package/lib/constructs/dlz-vpc/dlz-vpc.js +1 -1
  18. package/lib/constructs/dlz-vpc/network-address.js +1 -1
  19. package/lib/constructs/iam/iam-account-alias.js +1 -1
  20. package/lib/constructs/iam/iam-password-policy.js +1 -1
  21. package/lib/constructs/iam-identity-center/iam-identity-center-group.js +1 -1
  22. package/lib/constructs/iam-identity-center/iam-identity-center.js +1 -1
  23. package/lib/constructs/iam-identity-center/identity-store-user.js +1 -1
  24. package/lib/constructs/organization-policies/service-control-policy.js +1 -1
  25. package/lib/constructs/organization-policies/tag-policy-enforced-service-actions.d.ts +8 -0
  26. package/lib/constructs/organization-policies/tag-policy-enforced-service-actions.js +66 -0
  27. package/lib/constructs/organization-policies/tag-policy.d.ts +3 -0
  28. package/lib/constructs/organization-policies/tag-policy.js +6 -2
  29. package/lib/data-landing-zone-client.js +1 -1
  30. package/lib/data-landing-zone-types.d.ts +9 -6
  31. package/lib/data-landing-zone-types.js +1 -1
  32. package/lib/data-landing-zone.js +1 -1
  33. package/lib/defaults.js +8 -8
  34. package/lib/lib/report/index.js +1 -1
  35. package/lib/scripts/index.js +1 -1
  36. package/lib/stacks/organization/management-stack.js +8 -2
  37. package/lib/stacks/organization/security/audit/global-stack.js +1 -1
  38. package/lib/stacks/organization/security/audit/regional-stack.js +1 -1
  39. package/lib/stacks/organization/security/log/global-stack.js +1 -1
  40. package/lib/stacks/organization/security/log/regional-stack.js +1 -1
  41. package/lib/stacks/organization/workloads/base/global-stack.js +1 -1
  42. package/lib/stacks/organization/workloads/base/regional-stack.js +1 -1
  43. package/lib/stacks/organization/workloads/data-services-phase-1-stack/global-stack.js +1 -1
  44. package/lib/stacks/organization/workloads/data-services-phase-1-stack/regional-stack.js +1 -1
  45. package/lib/stacks/organization/workloads/network-connections-phase-1-stack/global-stack.js +1 -1
  46. package/lib/stacks/organization/workloads/network-connections-phase-2-stack/global-stack.js +1 -1
  47. package/lib/stacks/organization/workloads/network-connections-phase-2-stack/regional-stack.js +1 -1
  48. package/lib/stacks/organization/workloads/network-connections-phase-3-stack/global-stack.js +1 -1
  49. package/lib/stacks/organization/workloads/network-connections-phase-3-stack/regional-stack.js +1 -1
  50. package/package.json +1 -1
package/API.md CHANGED
@@ -16630,7 +16630,7 @@ const dlzTag: DlzTag = { ... }
16630
16630
  | **Name** | **Type** | **Description** |
16631
16631
  | --- | --- | --- |
16632
16632
  | <code><a href="#aws-data-landing-zone.DlzTag.property.name">name</a></code> | <code>string</code> | *No description.* |
16633
- | <code><a href="#aws-data-landing-zone.DlzTag.property.values">values</a></code> | <code>string[]</code> | *No description.* |
16633
+ | <code><a href="#aws-data-landing-zone.DlzTag.property.values">values</a></code> | <code>string[]</code> | Specifying an empty array or undefined still enforces the tag presence but does not enforce the value. |
16634
16634
 
16635
16635
  ---
16636
16636
 
@@ -16652,6 +16652,8 @@ public readonly values: string[];
16652
16652
 
16653
16653
  - *Type:* string[]
16654
16654
 
16655
+ Specifying an empty array or undefined still enforces the tag presence but does not enforce the value.
16656
+
16655
16657
  ---
16656
16658
 
16657
16659
  ### DlzTagPolicyProps <a name="DlzTagPolicyProps" id="aws-data-landing-zone.DlzTagPolicyProps"></a>
@@ -18123,7 +18125,7 @@ const mandatoryTags: MandatoryTags = { ... }
18123
18125
 
18124
18126
  ---
18125
18127
 
18126
- ##### `environment`<sup>Required</sup> <a name="environment" id="aws-data-landing-zone.MandatoryTags.property.environment"></a>
18128
+ ##### `environment`<sup>Optional</sup> <a name="environment" id="aws-data-landing-zone.MandatoryTags.property.environment"></a>
18127
18129
 
18128
18130
  ```typescript
18129
18131
  public readonly environment: string[];
@@ -18133,9 +18135,12 @@ public readonly environment: string[];
18133
18135
 
18134
18136
  The values of the mandatory `Environment` tag that all resources must have.
18135
18137
 
18138
+ Specifying an empty array or undefined
18139
+ still enforces the tag presence but does not enforce the value.
18140
+
18136
18141
  ---
18137
18142
 
18138
- ##### `owner`<sup>Required</sup> <a name="owner" id="aws-data-landing-zone.MandatoryTags.property.owner"></a>
18143
+ ##### `owner`<sup>Optional</sup> <a name="owner" id="aws-data-landing-zone.MandatoryTags.property.owner"></a>
18139
18144
 
18140
18145
  ```typescript
18141
18146
  public readonly owner: string[];
@@ -18145,9 +18150,12 @@ public readonly owner: string[];
18145
18150
 
18146
18151
  The values of the mandatory `Owner` tag that all resources must have.
18147
18152
 
18153
+ Specifying an empty array or undefined
18154
+ still enforces the tag presence but does not enforce the value.
18155
+
18148
18156
  ---
18149
18157
 
18150
- ##### `project`<sup>Required</sup> <a name="project" id="aws-data-landing-zone.MandatoryTags.property.project"></a>
18158
+ ##### `project`<sup>Optional</sup> <a name="project" id="aws-data-landing-zone.MandatoryTags.property.project"></a>
18151
18159
 
18152
18160
  ```typescript
18153
18161
  public readonly project: string[];
@@ -18157,6 +18165,9 @@ public readonly project: string[];
18157
18165
 
18158
18166
  The values of the mandatory `Project` tag that all resources must have.
18159
18167
 
18168
+ Specifying an empty array or undefined
18169
+ still enforces the tag presence but does not enforce the value.
18170
+
18160
18171
  ---
18161
18172
 
18162
18173
  ### Network <a name="Network" id="aws-data-landing-zone.Network"></a>
@@ -24,7 +24,7 @@ to the resources.
24
24
 
25
25
  ## Default Mandatory Tags
26
26
 
27
- The mandatory tags all begin with a capital letter, but the underlying code property is lowercase. The mandatory tags include:
27
+ The mandatory tags all begin with a capital letter, but the underlying code property is lowercase. The mandatory tags are:
28
28
  - `Owner` - Identifies the team or individual responsible for the resource.
29
29
  - `Project` - Specifies the project to which the resource belongs.
30
30
  - `Environment` - Defines the environment of the resource, such as `development`, `staging`, or `production`.
@@ -37,6 +37,14 @@ The DLZ construct will automatically apply the following tags to all resources i
37
37
  These tag values can be customized by providing an array of values for each tag in `mandatoryTags`.
38
38
  Note that while the code property is lowercase, the tags created will follow the capitalized format outlined above.
39
39
 
40
+ Tag values are optional, but if provided, the resource will only be created if the tag value matches one of the specified
41
+ values. Specifying an empty array or `undefined` enforces the presence of the tag but does not restrict
42
+ its value.
43
+
44
+ Not all service actions are supported for enforcement by the Organization Tag Policy. To keep the policy size manageable,
45
+ we do not list every resource in the [list of supported resources](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_supported-resources-enforcement.html).
46
+ Instead, we include all `:*` actions and focus on "major" services to ensure the policy remains concise.
47
+
40
48
  <DualCode>
41
49
  <Fragment slot="ts">
42
50
  ```ts
@@ -46,8 +54,8 @@ Note that while the code property is lowercase, the tags created will follow the
46
54
  const app = new App();
47
55
  const dlz = new DataLandingZone(app, {
48
56
  mandatoryTags: {
49
- owner: ['backend'],
50
- project: ['project1'],
57
+ owner: [],
58
+ project: undefined,
51
59
  environment: ['development', 'staging', 'production'],
52
60
  },
53
61
  ...
@@ -62,8 +70,8 @@ Note that while the code property is lowercase, the tags created will follow the
62
70
  app = cdk.App()
63
71
  dlz.DataLandingZone(app,
64
72
  mandatory_tags={
65
- "owner": ["backend"],
66
- "project": ["project1"],
73
+ "owner": None,
74
+ "project": dlz.ANY_TAG_VALUE,
67
75
  "environment": ["development", "staging", "production"],
68
76
  },
69
77
  ...
@@ -16634,7 +16634,7 @@ const dlzTag: DlzTag = { ... }
16634
16634
  | **Name** | **Type** | **Description** |
16635
16635
  | --- | --- | --- |
16636
16636
  | <code><a href="#aws-data-landing-zone.DlzTag.property.name">name</a></code> | <code>string</code> | *No description.* |
16637
- | <code><a href="#aws-data-landing-zone.DlzTag.property.values">values</a></code> | <code>string[]</code> | *No description.* |
16637
+ | <code><a href="#aws-data-landing-zone.DlzTag.property.values">values</a></code> | <code>string[]</code> | Specifying an empty array or undefined still enforces the tag presence but does not enforce the value. |
16638
16638
 
16639
16639
  ---
16640
16640
 
@@ -16656,6 +16656,8 @@ public readonly values: string[];
16656
16656
 
16657
16657
  - *Type:* string[]
16658
16658
 
16659
+ Specifying an empty array or undefined still enforces the tag presence but does not enforce the value.
16660
+
16659
16661
  ---
16660
16662
 
16661
16663
  ### DlzTagPolicyProps <a name="DlzTagPolicyProps" id="aws-data-landing-zone.DlzTagPolicyProps"></a>
@@ -18127,7 +18129,7 @@ const mandatoryTags: MandatoryTags = { ... }
18127
18129
 
18128
18130
  ---
18129
18131
 
18130
- ##### `environment`<sup>Required</sup> <a name="environment" id="aws-data-landing-zone.MandatoryTags.property.environment"></a>
18132
+ ##### `environment`<sup>Optional</sup> <a name="environment" id="aws-data-landing-zone.MandatoryTags.property.environment"></a>
18131
18133
 
18132
18134
  ```typescript
18133
18135
  public readonly environment: string[];
@@ -18137,9 +18139,12 @@ public readonly environment: string[];
18137
18139
 
18138
18140
  The values of the mandatory `Environment` tag that all resources must have.
18139
18141
 
18142
+ Specifying an empty array or undefined
18143
+ still enforces the tag presence but does not enforce the value.
18144
+
18140
18145
  ---
18141
18146
 
18142
- ##### `owner`<sup>Required</sup> <a name="owner" id="aws-data-landing-zone.MandatoryTags.property.owner"></a>
18147
+ ##### `owner`<sup>Optional</sup> <a name="owner" id="aws-data-landing-zone.MandatoryTags.property.owner"></a>
18143
18148
 
18144
18149
  ```typescript
18145
18150
  public readonly owner: string[];
@@ -18149,9 +18154,12 @@ public readonly owner: string[];
18149
18154
 
18150
18155
  The values of the mandatory `Owner` tag that all resources must have.
18151
18156
 
18157
+ Specifying an empty array or undefined
18158
+ still enforces the tag presence but does not enforce the value.
18159
+
18152
18160
  ---
18153
18161
 
18154
- ##### `project`<sup>Required</sup> <a name="project" id="aws-data-landing-zone.MandatoryTags.property.project"></a>
18162
+ ##### `project`<sup>Optional</sup> <a name="project" id="aws-data-landing-zone.MandatoryTags.property.project"></a>
18155
18163
 
18156
18164
  ```typescript
18157
18165
  public readonly project: string[];
@@ -18161,6 +18169,9 @@ public readonly project: string[];
18161
18169
 
18162
18170
  The values of the mandatory `Project` tag that all resources must have.
18163
18171
 
18172
+ Specifying an empty array or undefined
18173
+ still enforces the tag presence but does not enforce the value.
18174
+
18164
18175
  ---
18165
18176
 
18166
18177
  ### Network <a name="Network" id="aws-data-landing-zone.Network"></a>
@@ -0,0 +1,57 @@
1
+ import axios from 'axios';
2
+ import * as cheerio from 'cheerio';
3
+
4
+
5
+ async function main()
6
+ {
7
+ const response = await axios.get('https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_supported-resources-enforcement.html', {
8
+ headers: {
9
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
10
+ }
11
+ });
12
+
13
+ // Load the HTML content
14
+ const $ = cheerio.load(response.data);
15
+ // const pageHtml = $('body').html();
16
+ // console.debug(pageHtml);
17
+
18
+ const jsonArray: string[] = [];
19
+ $('table tbody tr').each((index, element) => {
20
+ // Select the "JSON syntax" column (3rd <td>)
21
+ const jsonSyntax = $(element).find('td').eq(2).find('code').map((i, el) => $(el).text().slice(1,-1)).get();
22
+ jsonArray.push(...jsonSyntax);
23
+ });
24
+ // console.log(jsonArray);
25
+
26
+
27
+ const starrServiceActions = jsonArray.filter((value) => value.endsWith('*'));
28
+ const additionalMainServiceActions: string[] = [
29
+ "backup:backup-plan",
30
+ "batch:job",
31
+ "logs:log-group",
32
+ "ec2:elastic-ip",
33
+ "ec2:instance",
34
+ "ec2:vpc",
35
+ "ec2:security-group",
36
+ "ecr:repository",
37
+ "ecs:service",
38
+ "eks:cluster",
39
+ "es:domain",
40
+ "elasticmapreduce:cluster",
41
+ "elasticache:cluster",
42
+ "iam:policy",
43
+ "network-firewall:firewall",
44
+ "rds:secgrp",
45
+ "s3:bucket",
46
+ "sns:topic",
47
+ "sqs:queue",
48
+ ]
49
+ const allServiceActions = [...starrServiceActions, ...additionalMainServiceActions];
50
+ console.log(allServiceActions);
51
+ console.log(JSON.stringify(allServiceActions).length);
52
+ }
53
+
54
+ main().catch((error) => {
55
+ console.error(error);
56
+ process.exit(1);
57
+ });