aws-data-landing-zone 0.6.1 → 0.6.3
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/.compatignore +26 -0
- package/.jsii +653 -260
- package/API.md +395 -1
- package/docs/src/components/ClarityTracking.astro +42 -0
- package/docs/src/components/CookieConsent.astro +165 -0
- package/docs/src/components/Footer.astro +7 -0
- package/docs/src/content/docs/reference/api.md +395 -1
- package/docs/src/pages/index.astro +7 -0
- 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.d.ts +52 -0
- package/lib/constructs/dlz-tag-compliance-alert/index.js +125 -0
- 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/index.d.ts +1 -0
- package/lib/constructs/index.js +2 -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.d.ts +18 -2
- package/lib/constructs/organization-policies/scp-presets/deny-resource-creation-without-standard-tags.js +18 -11
- 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-types.d.ts +12 -1
- package/lib/data-landing-zone-types.js +1 -1
- package/lib/data-landing-zone.js +1 -1
- package/lib/defaults.js +1 -1
- package/lib/lib/report/index.d.ts +2 -1
- package/lib/lib/report/index.js +3 -2
- 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.d.ts +7 -0
- package/lib/stacks/organization/management/management-global-stack.js +23 -2
- 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/base/shared.js +13 -3
- 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/API.md
CHANGED
|
@@ -21590,6 +21590,7 @@ const dataLandingZoneProps: DataLandingZoneProps = { ... }
|
|
|
21590
21590
|
| <code><a href="#aws-data-landing-zone.DataLandingZoneProps.property.saveReport">saveReport</a></code> | <code>boolean</code> | Save the raw report items and the reports grouped by account to a `./.dlz-reports` folder. |
|
|
21591
21591
|
| <code><a href="#aws-data-landing-zone.DataLandingZoneProps.property.scpBaselineStatements">scpBaselineStatements</a></code> | <code>aws-cdk-lib.aws_iam.PolicyStatement[]</code> | Replaces the deny-services portion of the org SCP baseline applied to every workload account. |
|
|
21592
21592
|
| <code><a href="#aws-data-landing-zone.DataLandingZoneProps.property.scpStatementsByAccountType">scpStatementsByAccountType</a></code> | <code><a href="#aws-data-landing-zone.ScpStatementsByAccountType">ScpStatementsByAccountType</a></code> | Per-`DlzAccountType` SCP statements layered between the org baseline and per-account extras. |
|
|
21593
|
+
| <code><a href="#aws-data-landing-zone.DataLandingZoneProps.property.tagComplianceCentralAlert">tagComplianceCentralAlert</a></code> | <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers">DlzTagComplianceCentralAlertSubscribers</a></code> | Centralized, org-wide alerting for AWS Config tag non-compliance. |
|
|
21593
21594
|
|
|
21594
21595
|
---
|
|
21595
21596
|
|
|
@@ -21853,6 +21854,27 @@ Additive only.
|
|
|
21853
21854
|
|
|
21854
21855
|
---
|
|
21855
21856
|
|
|
21857
|
+
##### `tagComplianceCentralAlert`<sup>Optional</sup> <a name="tagComplianceCentralAlert" id="aws-data-landing-zone.DataLandingZoneProps.property.tagComplianceCentralAlert"></a>
|
|
21858
|
+
|
|
21859
|
+
```typescript
|
|
21860
|
+
public readonly tagComplianceCentralAlert: DlzTagComplianceCentralAlertSubscribers;
|
|
21861
|
+
```
|
|
21862
|
+
|
|
21863
|
+
- *Type:* <a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers">DlzTagComplianceCentralAlertSubscribers</a>
|
|
21864
|
+
- *Default:* no centralized tag-compliance alert
|
|
21865
|
+
|
|
21866
|
+
Centralized, org-wide alerting for AWS Config tag non-compliance.
|
|
21867
|
+
|
|
21868
|
+
When set, every workload
|
|
21869
|
+
account × region forwards its NON_COMPLIANT findings to a single EventBridge bus in the
|
|
21870
|
+
management account, which fans out to Slack (via Chatbot) and/or email — one topic, one place,
|
|
21871
|
+
modeled on budget alerts.
|
|
21872
|
+
|
|
21873
|
+
The Config required-tags rule still runs per account × region (detection is local); only the
|
|
21874
|
+
alerting is centralized.
|
|
21875
|
+
|
|
21876
|
+
---
|
|
21877
|
+
|
|
21856
21878
|
### DeploymentPlatform <a name="DeploymentPlatform" id="aws-data-landing-zone.DeploymentPlatform"></a>
|
|
21857
21879
|
|
|
21858
21880
|
#### Initializer <a name="Initializer" id="aws-data-landing-zone.DeploymentPlatform.Initializer"></a>
|
|
@@ -25662,6 +25684,158 @@ Specifying an empty array or undefined still enforces the tag presence but does
|
|
|
25662
25684
|
|
|
25663
25685
|
---
|
|
25664
25686
|
|
|
25687
|
+
### DlzTagComplianceCentralAlertProps <a name="DlzTagComplianceCentralAlertProps" id="aws-data-landing-zone.DlzTagComplianceCentralAlertProps"></a>
|
|
25688
|
+
|
|
25689
|
+
#### Initializer <a name="Initializer" id="aws-data-landing-zone.DlzTagComplianceCentralAlertProps.Initializer"></a>
|
|
25690
|
+
|
|
25691
|
+
```typescript
|
|
25692
|
+
import { DlzTagComplianceCentralAlertProps } from 'aws-data-landing-zone'
|
|
25693
|
+
|
|
25694
|
+
const dlzTagComplianceCentralAlertProps: DlzTagComplianceCentralAlertProps = { ... }
|
|
25695
|
+
```
|
|
25696
|
+
|
|
25697
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
25698
|
+
|
|
25699
|
+
| **Name** | **Type** | **Description** |
|
|
25700
|
+
| --- | --- | --- |
|
|
25701
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertProps.property.emails">emails</a></code> | <code>string[]</code> | Emails that receive an alert when any workload account has a resource missing mandatory tags. |
|
|
25702
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertProps.property.slacks">slacks</a></code> | <code><a href="#aws-data-landing-zone.SlackChannel">SlackChannel</a>[]</code> | Slack channels that receive the alert (notify-only). |
|
|
25703
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertProps.property.organizationId">organizationId</a></code> | <code>string</code> | The AWS Organizations id (e.g. `o-xxxxxxxxxx`). Scopes the central bus resource policy so that any account in the organization — and only those accounts — may forward events to the bus. |
|
|
25704
|
+
|
|
25705
|
+
---
|
|
25706
|
+
|
|
25707
|
+
##### `emails`<sup>Optional</sup> <a name="emails" id="aws-data-landing-zone.DlzTagComplianceCentralAlertProps.property.emails"></a>
|
|
25708
|
+
|
|
25709
|
+
```typescript
|
|
25710
|
+
public readonly emails: string[];
|
|
25711
|
+
```
|
|
25712
|
+
|
|
25713
|
+
- *Type:* string[]
|
|
25714
|
+
|
|
25715
|
+
Emails that receive an alert when any workload account has a resource missing mandatory tags.
|
|
25716
|
+
|
|
25717
|
+
---
|
|
25718
|
+
|
|
25719
|
+
##### `slacks`<sup>Optional</sup> <a name="slacks" id="aws-data-landing-zone.DlzTagComplianceCentralAlertProps.property.slacks"></a>
|
|
25720
|
+
|
|
25721
|
+
```typescript
|
|
25722
|
+
public readonly slacks: SlackChannel[];
|
|
25723
|
+
```
|
|
25724
|
+
|
|
25725
|
+
- *Type:* <a href="#aws-data-landing-zone.SlackChannel">SlackChannel</a>[]
|
|
25726
|
+
|
|
25727
|
+
Slack channels that receive the alert (notify-only).
|
|
25728
|
+
|
|
25729
|
+
Uses Chatbot in the management account.
|
|
25730
|
+
|
|
25731
|
+
---
|
|
25732
|
+
|
|
25733
|
+
##### `organizationId`<sup>Required</sup> <a name="organizationId" id="aws-data-landing-zone.DlzTagComplianceCentralAlertProps.property.organizationId"></a>
|
|
25734
|
+
|
|
25735
|
+
```typescript
|
|
25736
|
+
public readonly organizationId: string;
|
|
25737
|
+
```
|
|
25738
|
+
|
|
25739
|
+
- *Type:* string
|
|
25740
|
+
|
|
25741
|
+
The AWS Organizations id (e.g. `o-xxxxxxxxxx`). Scopes the central bus resource policy so that any account in the organization — and only those accounts — may forward events to the bus.
|
|
25742
|
+
|
|
25743
|
+
---
|
|
25744
|
+
|
|
25745
|
+
### DlzTagComplianceCentralAlertSubscribers <a name="DlzTagComplianceCentralAlertSubscribers" id="aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers"></a>
|
|
25746
|
+
|
|
25747
|
+
Where the centralized tag-compliance alert is sent.
|
|
25748
|
+
|
|
25749
|
+
Consumer-facing prop on `DataLandingZoneProps`.
|
|
25750
|
+
|
|
25751
|
+
#### Initializer <a name="Initializer" id="aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers.Initializer"></a>
|
|
25752
|
+
|
|
25753
|
+
```typescript
|
|
25754
|
+
import { DlzTagComplianceCentralAlertSubscribers } from 'aws-data-landing-zone'
|
|
25755
|
+
|
|
25756
|
+
const dlzTagComplianceCentralAlertSubscribers: DlzTagComplianceCentralAlertSubscribers = { ... }
|
|
25757
|
+
```
|
|
25758
|
+
|
|
25759
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
25760
|
+
|
|
25761
|
+
| **Name** | **Type** | **Description** |
|
|
25762
|
+
| --- | --- | --- |
|
|
25763
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers.property.emails">emails</a></code> | <code>string[]</code> | Emails that receive an alert when any workload account has a resource missing mandatory tags. |
|
|
25764
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers.property.slacks">slacks</a></code> | <code><a href="#aws-data-landing-zone.SlackChannel">SlackChannel</a>[]</code> | Slack channels that receive the alert (notify-only). |
|
|
25765
|
+
|
|
25766
|
+
---
|
|
25767
|
+
|
|
25768
|
+
##### `emails`<sup>Optional</sup> <a name="emails" id="aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers.property.emails"></a>
|
|
25769
|
+
|
|
25770
|
+
```typescript
|
|
25771
|
+
public readonly emails: string[];
|
|
25772
|
+
```
|
|
25773
|
+
|
|
25774
|
+
- *Type:* string[]
|
|
25775
|
+
|
|
25776
|
+
Emails that receive an alert when any workload account has a resource missing mandatory tags.
|
|
25777
|
+
|
|
25778
|
+
---
|
|
25779
|
+
|
|
25780
|
+
##### `slacks`<sup>Optional</sup> <a name="slacks" id="aws-data-landing-zone.DlzTagComplianceCentralAlertSubscribers.property.slacks"></a>
|
|
25781
|
+
|
|
25782
|
+
```typescript
|
|
25783
|
+
public readonly slacks: SlackChannel[];
|
|
25784
|
+
```
|
|
25785
|
+
|
|
25786
|
+
- *Type:* <a href="#aws-data-landing-zone.SlackChannel">SlackChannel</a>[]
|
|
25787
|
+
|
|
25788
|
+
Slack channels that receive the alert (notify-only).
|
|
25789
|
+
|
|
25790
|
+
Uses Chatbot in the management account.
|
|
25791
|
+
|
|
25792
|
+
---
|
|
25793
|
+
|
|
25794
|
+
### DlzTagComplianceForwardingRuleProps <a name="DlzTagComplianceForwardingRuleProps" id="aws-data-landing-zone.DlzTagComplianceForwardingRuleProps"></a>
|
|
25795
|
+
|
|
25796
|
+
#### Initializer <a name="Initializer" id="aws-data-landing-zone.DlzTagComplianceForwardingRuleProps.Initializer"></a>
|
|
25797
|
+
|
|
25798
|
+
```typescript
|
|
25799
|
+
import { DlzTagComplianceForwardingRuleProps } from 'aws-data-landing-zone'
|
|
25800
|
+
|
|
25801
|
+
const dlzTagComplianceForwardingRuleProps: DlzTagComplianceForwardingRuleProps = { ... }
|
|
25802
|
+
```
|
|
25803
|
+
|
|
25804
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
25805
|
+
|
|
25806
|
+
| **Name** | **Type** | **Description** |
|
|
25807
|
+
| --- | --- | --- |
|
|
25808
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceForwardingRuleProps.property.centralBusArn">centralBusArn</a></code> | <code>string</code> | ARN of the central event bus in the management account (see `DlzTagComplianceCentralAlert.busArn`). |
|
|
25809
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceForwardingRuleProps.property.configRuleNames">configRuleNames</a></code> | <code>string[]</code> | AWS Config rule names to watch. |
|
|
25810
|
+
|
|
25811
|
+
---
|
|
25812
|
+
|
|
25813
|
+
##### `centralBusArn`<sup>Required</sup> <a name="centralBusArn" id="aws-data-landing-zone.DlzTagComplianceForwardingRuleProps.property.centralBusArn"></a>
|
|
25814
|
+
|
|
25815
|
+
```typescript
|
|
25816
|
+
public readonly centralBusArn: string;
|
|
25817
|
+
```
|
|
25818
|
+
|
|
25819
|
+
- *Type:* string
|
|
25820
|
+
|
|
25821
|
+
ARN of the central event bus in the management account (see `DlzTagComplianceCentralAlert.busArn`).
|
|
25822
|
+
|
|
25823
|
+
---
|
|
25824
|
+
|
|
25825
|
+
##### `configRuleNames`<sup>Required</sup> <a name="configRuleNames" id="aws-data-landing-zone.DlzTagComplianceForwardingRuleProps.property.configRuleNames"></a>
|
|
25826
|
+
|
|
25827
|
+
```typescript
|
|
25828
|
+
public readonly configRuleNames: string[];
|
|
25829
|
+
```
|
|
25830
|
+
|
|
25831
|
+
- *Type:* string[]
|
|
25832
|
+
|
|
25833
|
+
AWS Config rule names to watch.
|
|
25834
|
+
|
|
25835
|
+
A resource turning NON_COMPLIANT on any of them is forwarded.
|
|
25836
|
+
|
|
25837
|
+
---
|
|
25838
|
+
|
|
25665
25839
|
### DlzTagPolicyProps <a name="DlzTagPolicyProps" id="aws-data-landing-zone.DlzTagPolicyProps"></a>
|
|
25666
25840
|
|
|
25667
25841
|
#### Initializer <a name="Initializer" id="aws-data-landing-zone.DlzTagPolicyProps.Initializer"></a>
|
|
@@ -28973,6 +29147,36 @@ Control Tower Controls applied to all the OUs in the organization.
|
|
|
28973
29147
|
|
|
28974
29148
|
---
|
|
28975
29149
|
|
|
29150
|
+
### ScpDenyResourceCreationTagOptions <a name="ScpDenyResourceCreationTagOptions" id="aws-data-landing-zone.ScpDenyResourceCreationTagOptions"></a>
|
|
29151
|
+
|
|
29152
|
+
#### Initializer <a name="Initializer" id="aws-data-landing-zone.ScpDenyResourceCreationTagOptions.Initializer"></a>
|
|
29153
|
+
|
|
29154
|
+
```typescript
|
|
29155
|
+
import { ScpDenyResourceCreationTagOptions } from 'aws-data-landing-zone'
|
|
29156
|
+
|
|
29157
|
+
const scpDenyResourceCreationTagOptions: ScpDenyResourceCreationTagOptions = { ... }
|
|
29158
|
+
```
|
|
29159
|
+
|
|
29160
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
29161
|
+
|
|
29162
|
+
| **Name** | **Type** | **Description** |
|
|
29163
|
+
| --- | --- | --- |
|
|
29164
|
+
| <code><a href="#aws-data-landing-zone.ScpDenyResourceCreationTagOptions.property.exemptAwsServiceCalls">exemptAwsServiceCalls</a></code> | <code>boolean</code> | Exempt creates that an AWS service makes on your behalf with *forwarded credentials* (e.g. CloudFormation) by adding `aws:ViaAWSService` to each Deny — so only direct console/CLI/SDK/IaC creates are blocked. |
|
|
29165
|
+
|
|
29166
|
+
---
|
|
29167
|
+
|
|
29168
|
+
##### `exemptAwsServiceCalls`<sup>Optional</sup> <a name="exemptAwsServiceCalls" id="aws-data-landing-zone.ScpDenyResourceCreationTagOptions.property.exemptAwsServiceCalls"></a>
|
|
29169
|
+
|
|
29170
|
+
```typescript
|
|
29171
|
+
public readonly exemptAwsServiceCalls: boolean;
|
|
29172
|
+
```
|
|
29173
|
+
|
|
29174
|
+
- *Type:* boolean
|
|
29175
|
+
|
|
29176
|
+
Exempt creates that an AWS service makes on your behalf with *forwarded credentials* (e.g. CloudFormation) by adding `aws:ViaAWSService` to each Deny — so only direct console/CLI/SDK/IaC creates are blocked.
|
|
29177
|
+
|
|
29178
|
+
---
|
|
29179
|
+
|
|
28976
29180
|
### ScpFinOpsAccountBaselineOptions <a name="ScpFinOpsAccountBaselineOptions" id="aws-data-landing-zone.ScpFinOpsAccountBaselineOptions"></a>
|
|
28977
29181
|
|
|
28978
29182
|
#### Initializer <a name="Initializer" id="aws-data-landing-zone.ScpFinOpsAccountBaselineOptions.Initializer"></a>
|
|
@@ -30784,6 +30988,178 @@ produce a CDK diff every time.
|
|
|
30784
30988
|
|
|
30785
30989
|
|
|
30786
30990
|
|
|
30991
|
+
### DlzTagComplianceCentralAlert <a name="DlzTagComplianceCentralAlert" id="aws-data-landing-zone.DlzTagComplianceCentralAlert"></a>
|
|
30992
|
+
|
|
30993
|
+
Central, org-wide sink for AWS Config tag non-compliance, created once in the management account.
|
|
30994
|
+
|
|
30995
|
+
Owns a dedicated EventBridge event bus that every workload account forwards its NON_COMPLIANT
|
|
30996
|
+
findings to (see `DlzTagComplianceForwardingRule`), plus one SNS topic and the Slack/email fan-out.
|
|
30997
|
+
Modeled on budget alerts: a single account, a single topic, Chatbot for Slack. One topic and one
|
|
30998
|
+
Slack config for the whole org, instead of one per workload account × region.
|
|
30999
|
+
|
|
31000
|
+
#### Initializers <a name="Initializers" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer"></a>
|
|
31001
|
+
|
|
31002
|
+
```typescript
|
|
31003
|
+
import { DlzTagComplianceCentralAlert } from 'aws-data-landing-zone'
|
|
31004
|
+
|
|
31005
|
+
new DlzTagComplianceCentralAlert(scope: Construct, id: string, props: DlzTagComplianceCentralAlertProps)
|
|
31006
|
+
```
|
|
31007
|
+
|
|
31008
|
+
| **Name** | **Type** | **Description** |
|
|
31009
|
+
| --- | --- | --- |
|
|
31010
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
31011
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
31012
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer.parameter.props">props</a></code> | <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertProps">DlzTagComplianceCentralAlertProps</a></code> | *No description.* |
|
|
31013
|
+
|
|
31014
|
+
---
|
|
31015
|
+
|
|
31016
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer.parameter.scope"></a>
|
|
31017
|
+
|
|
31018
|
+
- *Type:* constructs.Construct
|
|
31019
|
+
|
|
31020
|
+
---
|
|
31021
|
+
|
|
31022
|
+
##### `id`<sup>Required</sup> <a name="id" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer.parameter.id"></a>
|
|
31023
|
+
|
|
31024
|
+
- *Type:* string
|
|
31025
|
+
|
|
31026
|
+
---
|
|
31027
|
+
|
|
31028
|
+
##### `props`<sup>Required</sup> <a name="props" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.Initializer.parameter.props"></a>
|
|
31029
|
+
|
|
31030
|
+
- *Type:* <a href="#aws-data-landing-zone.DlzTagComplianceCentralAlertProps">DlzTagComplianceCentralAlertProps</a>
|
|
31031
|
+
|
|
31032
|
+
---
|
|
31033
|
+
|
|
31034
|
+
|
|
31035
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
31036
|
+
|
|
31037
|
+
| **Name** | **Description** |
|
|
31038
|
+
| --- | --- |
|
|
31039
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.busArn">busArn</a></code> | ARN of the central bus, derived from the management account id and the global region. |
|
|
31040
|
+
|
|
31041
|
+
---
|
|
31042
|
+
|
|
31043
|
+
##### `busArn` <a name="busArn" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.busArn"></a>
|
|
31044
|
+
|
|
31045
|
+
```typescript
|
|
31046
|
+
import { DlzTagComplianceCentralAlert } from 'aws-data-landing-zone'
|
|
31047
|
+
|
|
31048
|
+
DlzTagComplianceCentralAlert.busArn(managementAccountId: string, globalRegion: string)
|
|
31049
|
+
```
|
|
31050
|
+
|
|
31051
|
+
ARN of the central bus, derived from the management account id and the global region.
|
|
31052
|
+
|
|
31053
|
+
###### `managementAccountId`<sup>Required</sup> <a name="managementAccountId" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.busArn.parameter.managementAccountId"></a>
|
|
31054
|
+
|
|
31055
|
+
- *Type:* string
|
|
31056
|
+
|
|
31057
|
+
---
|
|
31058
|
+
|
|
31059
|
+
###### `globalRegion`<sup>Required</sup> <a name="globalRegion" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.busArn.parameter.globalRegion"></a>
|
|
31060
|
+
|
|
31061
|
+
- *Type:* string
|
|
31062
|
+
|
|
31063
|
+
---
|
|
31064
|
+
|
|
31065
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
31066
|
+
|
|
31067
|
+
| **Name** | **Type** | **Description** |
|
|
31068
|
+
| --- | --- | --- |
|
|
31069
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.property.bus">bus</a></code> | <code>aws-cdk-lib.aws_events.EventBus</code> | *No description.* |
|
|
31070
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.property.topic">topic</a></code> | <code>aws-cdk-lib.aws_sns.Topic</code> | *No description.* |
|
|
31071
|
+
|
|
31072
|
+
---
|
|
31073
|
+
|
|
31074
|
+
##### `bus`<sup>Required</sup> <a name="bus" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.property.bus"></a>
|
|
31075
|
+
|
|
31076
|
+
```typescript
|
|
31077
|
+
public readonly bus: EventBus;
|
|
31078
|
+
```
|
|
31079
|
+
|
|
31080
|
+
- *Type:* aws-cdk-lib.aws_events.EventBus
|
|
31081
|
+
|
|
31082
|
+
---
|
|
31083
|
+
|
|
31084
|
+
##### `topic`<sup>Required</sup> <a name="topic" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.property.topic"></a>
|
|
31085
|
+
|
|
31086
|
+
```typescript
|
|
31087
|
+
public readonly topic: Topic;
|
|
31088
|
+
```
|
|
31089
|
+
|
|
31090
|
+
- *Type:* aws-cdk-lib.aws_sns.Topic
|
|
31091
|
+
|
|
31092
|
+
---
|
|
31093
|
+
|
|
31094
|
+
#### Constants <a name="Constants" id="Constants"></a>
|
|
31095
|
+
|
|
31096
|
+
| **Name** | **Type** | **Description** |
|
|
31097
|
+
| --- | --- | --- |
|
|
31098
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceCentralAlert.property.BUS_NAME">BUS_NAME</a></code> | <code>string</code> | Fixed name of the central event bus. |
|
|
31099
|
+
|
|
31100
|
+
---
|
|
31101
|
+
|
|
31102
|
+
##### `BUS_NAME`<sup>Required</sup> <a name="BUS_NAME" id="aws-data-landing-zone.DlzTagComplianceCentralAlert.property.BUS_NAME"></a>
|
|
31103
|
+
|
|
31104
|
+
```typescript
|
|
31105
|
+
public readonly BUS_NAME: string;
|
|
31106
|
+
```
|
|
31107
|
+
|
|
31108
|
+
- *Type:* string
|
|
31109
|
+
|
|
31110
|
+
Fixed name of the central event bus.
|
|
31111
|
+
|
|
31112
|
+
Single-sourced so the workload-side forwarding rules can
|
|
31113
|
+
build the bus ARN (via `busArn`) without a cross-stack reference.
|
|
31114
|
+
|
|
31115
|
+
---
|
|
31116
|
+
|
|
31117
|
+
### DlzTagComplianceForwardingRule <a name="DlzTagComplianceForwardingRule" id="aws-data-landing-zone.DlzTagComplianceForwardingRule"></a>
|
|
31118
|
+
|
|
31119
|
+
Workload-side half of the centralized alert.
|
|
31120
|
+
|
|
31121
|
+
Created per account × region: an EventBridge rule
|
|
31122
|
+
that matches this region's NON_COMPLIANT tag findings and forwards them to the central event bus
|
|
31123
|
+
in the management account (cross-account, cross-region — a single hop). No local SNS/Chatbot.
|
|
31124
|
+
|
|
31125
|
+
#### Initializers <a name="Initializers" id="aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer"></a>
|
|
31126
|
+
|
|
31127
|
+
```typescript
|
|
31128
|
+
import { DlzTagComplianceForwardingRule } from 'aws-data-landing-zone'
|
|
31129
|
+
|
|
31130
|
+
new DlzTagComplianceForwardingRule(scope: Construct, id: string, props: DlzTagComplianceForwardingRuleProps)
|
|
31131
|
+
```
|
|
31132
|
+
|
|
31133
|
+
| **Name** | **Type** | **Description** |
|
|
31134
|
+
| --- | --- | --- |
|
|
31135
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
31136
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
31137
|
+
| <code><a href="#aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer.parameter.props">props</a></code> | <code><a href="#aws-data-landing-zone.DlzTagComplianceForwardingRuleProps">DlzTagComplianceForwardingRuleProps</a></code> | *No description.* |
|
|
31138
|
+
|
|
31139
|
+
---
|
|
31140
|
+
|
|
31141
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer.parameter.scope"></a>
|
|
31142
|
+
|
|
31143
|
+
- *Type:* constructs.Construct
|
|
31144
|
+
|
|
31145
|
+
---
|
|
31146
|
+
|
|
31147
|
+
##### `id`<sup>Required</sup> <a name="id" id="aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer.parameter.id"></a>
|
|
31148
|
+
|
|
31149
|
+
- *Type:* string
|
|
31150
|
+
|
|
31151
|
+
---
|
|
31152
|
+
|
|
31153
|
+
##### `props`<sup>Required</sup> <a name="props" id="aws-data-landing-zone.DlzTagComplianceForwardingRule.Initializer.parameter.props"></a>
|
|
31154
|
+
|
|
31155
|
+
- *Type:* <a href="#aws-data-landing-zone.DlzTagComplianceForwardingRuleProps">DlzTagComplianceForwardingRuleProps</a>
|
|
31156
|
+
|
|
31157
|
+
---
|
|
31158
|
+
|
|
31159
|
+
|
|
31160
|
+
|
|
31161
|
+
|
|
31162
|
+
|
|
30787
31163
|
### DlzTagPolicy <a name="DlzTagPolicy" id="aws-data-landing-zone.DlzTagPolicy"></a>
|
|
30788
31164
|
|
|
30789
31165
|
- *Implements:* <a href="#aws-data-landing-zone.IReportResource">IReportResource</a>
|
|
@@ -31811,7 +32187,7 @@ new ScpDenyResourceCreationWithoutStandardTags()
|
|
|
31811
32187
|
```typescript
|
|
31812
32188
|
import { ScpDenyResourceCreationWithoutStandardTags } from 'aws-data-landing-zone'
|
|
31813
32189
|
|
|
31814
|
-
ScpDenyResourceCreationWithoutStandardTags.statements(actions: string[], tagKeys?: string[])
|
|
32190
|
+
ScpDenyResourceCreationWithoutStandardTags.statements(actions: string[], tagKeys?: string[], options?: ScpDenyResourceCreationTagOptions)
|
|
31815
32191
|
```
|
|
31816
32192
|
|
|
31817
32193
|
One Deny per tag key over `actions`.
|
|
@@ -31830,6 +32206,12 @@ Tag keys default to {@link DEFAULT_TAG_KEYS}.
|
|
|
31830
32206
|
|
|
31831
32207
|
---
|
|
31832
32208
|
|
|
32209
|
+
###### `options`<sup>Optional</sup> <a name="options" id="aws-data-landing-zone.ScpDenyResourceCreationWithoutStandardTags.statements.parameter.options"></a>
|
|
32210
|
+
|
|
32211
|
+
- *Type:* <a href="#aws-data-landing-zone.ScpDenyResourceCreationTagOptions">ScpDenyResourceCreationTagOptions</a>
|
|
32212
|
+
|
|
32213
|
+
---
|
|
32214
|
+
|
|
31833
32215
|
|
|
31834
32216
|
#### Constants <a name="Constants" id="Constants"></a>
|
|
31835
32217
|
|
|
@@ -31903,6 +32285,12 @@ public readonly INFRA_TAG_ON_CREATE_ACTIONS: string[];
|
|
|
31903
32285
|
|
|
31904
32286
|
Networking, storage, and compute create actions.
|
|
31905
32287
|
|
|
32288
|
+
Deliberately excludes resources that AWS services auto-create, untagged, at runtime
|
|
32289
|
+
(CloudWatch log groups, EBS/RDS snapshots, default/managed security groups, EIPs,
|
|
32290
|
+
auto-scaling groups). Those calls carry no `aws:RequestTag`, so gating them can't be
|
|
32291
|
+
satisfied and only breaks normal operation (e.g. Lambda logging, backups, EKS scaling).
|
|
32292
|
+
Catch tag gaps on those with AWS Config instead of an SCP.
|
|
32293
|
+
|
|
31906
32294
|
---
|
|
31907
32295
|
|
|
31908
32296
|
### ScpDenyRootCredentialsManagementInMemberAccounts <a name="ScpDenyRootCredentialsManagementInMemberAccounts" id="aws-data-landing-zone.ScpDenyRootCredentialsManagementInMemberAccounts"></a>
|
|
@@ -33208,6 +33596,7 @@ Hyderabad No Control Tower SecurityHub Standard support.
|
|
|
33208
33596
|
| <code><a href="#aws-data-landing-zone.ReportType.GUARDDUTY">GUARDDUTY</a></code> | *No description.* |
|
|
33209
33597
|
| <code><a href="#aws-data-landing-zone.ReportType.MACIE_DELEGATED_ADMIN">MACIE_DELEGATED_ADMIN</a></code> | *No description.* |
|
|
33210
33598
|
| <code><a href="#aws-data-landing-zone.ReportType.MACIE">MACIE</a></code> | *No description.* |
|
|
33599
|
+
| <code><a href="#aws-data-landing-zone.ReportType.TAG_COMPLIANCE_ALERT">TAG_COMPLIANCE_ALERT</a></code> | *No description.* |
|
|
33211
33600
|
|
|
33212
33601
|
---
|
|
33213
33602
|
|
|
@@ -33291,6 +33680,11 @@ Hyderabad No Control Tower SecurityHub Standard support.
|
|
|
33291
33680
|
---
|
|
33292
33681
|
|
|
33293
33682
|
|
|
33683
|
+
##### `TAG_COMPLIANCE_ALERT` <a name="TAG_COMPLIANCE_ALERT" id="aws-data-landing-zone.ReportType.TAG_COMPLIANCE_ALERT"></a>
|
|
33684
|
+
|
|
33685
|
+
---
|
|
33686
|
+
|
|
33687
|
+
|
|
33294
33688
|
### SecurityHubNotificationSeverity <a name="SecurityHubNotificationSeverity" id="aws-data-landing-zone.SecurityHubNotificationSeverity"></a>
|
|
33295
33689
|
|
|
33296
33690
|
https://docs.aws.amazon.com/securityhub/1.0/APIReference/API_Severity.html.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
<script is:inline>
|
|
5
|
+
(() => {
|
|
6
|
+
// Microsoft Clarity - only fires once the visitor has accepted cookies (EU/GDPR requirement).
|
|
7
|
+
let clarityLoaded = false;
|
|
8
|
+
const loadClarity = () => {
|
|
9
|
+
if (clarityLoaded) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
clarityLoaded = true;
|
|
13
|
+
|
|
14
|
+
(function (c, l, a, r, i) {
|
|
15
|
+
c[a] =
|
|
16
|
+
c[a] ||
|
|
17
|
+
function (...args) {
|
|
18
|
+
(c[a].q = c[a].q || []).push(args);
|
|
19
|
+
};
|
|
20
|
+
const t = l.createElement(r);
|
|
21
|
+
t.async = 1;
|
|
22
|
+
t.src = 'https://www.clarity.ms/tag/' + i;
|
|
23
|
+
const y = l.getElementsByTagName(r)[0];
|
|
24
|
+
y.parentNode.insertBefore(t, y);
|
|
25
|
+
})(window, document, 'clarity', 'script', 'xqzfjts4xt');
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
if (window.localStorage.getItem('dc_cookie_consent') === 'accepted') {
|
|
30
|
+
loadClarity();
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// localStorage unavailable - wait for the consent event instead.
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
window.addEventListener('dc-cookie-consent', (event) => {
|
|
37
|
+
if (event.detail && event.detail.status === 'accepted') {
|
|
38
|
+
loadClarity();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
})();
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
<div id="cookie-consent-banner" style="display: none;">
|
|
5
|
+
<div class="cookie-consent-inner">
|
|
6
|
+
<p class="cookie-consent-text">
|
|
7
|
+
We use cookies to understand how you use our site and improve your experience. By clicking "Accept", you
|
|
8
|
+
consent to our use of analytics cookies.
|
|
9
|
+
</p>
|
|
10
|
+
<div class="cookie-consent-actions">
|
|
11
|
+
<button id="cookie-consent-reject" type="button" class="cookie-consent-btn cookie-consent-btn--secondary">
|
|
12
|
+
Reject
|
|
13
|
+
</button>
|
|
14
|
+
<button id="cookie-consent-accept" type="button" class="cookie-consent-btn cookie-consent-btn--primary">
|
|
15
|
+
Accept
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
#cookie-consent-banner {
|
|
23
|
+
position: fixed;
|
|
24
|
+
left: 0;
|
|
25
|
+
right: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
z-index: 100000;
|
|
28
|
+
background: oklch(1 0 0);
|
|
29
|
+
color: oklch(0.222 0.034 261.473);
|
|
30
|
+
box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
|
|
31
|
+
padding: 18px 8px;
|
|
32
|
+
font-family: 'Poppins', system-ui, sans-serif;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:global([data-theme='dark']) #cookie-consent-banner,
|
|
36
|
+
:global(.dark) #cookie-consent-banner {
|
|
37
|
+
background: oklch(0.235 0.031 262.556);
|
|
38
|
+
color: oklch(0.978 0.007 260.732);
|
|
39
|
+
box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.4);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cookie-consent-inner {
|
|
43
|
+
max-width: 1220px;
|
|
44
|
+
margin: 0 auto;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
column-gap: 40px;
|
|
49
|
+
row-gap: 10px;
|
|
50
|
+
flex-wrap: nowrap;
|
|
51
|
+
text-align: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.cookie-consent-text {
|
|
55
|
+
margin: 0;
|
|
56
|
+
flex: 1 1 auto;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
font-size: 14px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.cookie-consent-actions {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
gap: 10px;
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cookie-consent-btn {
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
padding: 6px 16px;
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
font-family: inherit;
|
|
76
|
+
transition:
|
|
77
|
+
background-color 0.2s ease,
|
|
78
|
+
opacity 0.15s;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.cookie-consent-btn--primary {
|
|
82
|
+
background: oklch(0.833 0.156 78.07);
|
|
83
|
+
color: oklch(0.222 0.034 261.473);
|
|
84
|
+
border: 1px solid oklch(0.833 0.156 78.07);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cookie-consent-btn--primary:hover {
|
|
88
|
+
opacity: 0.9;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.cookie-consent-btn--secondary {
|
|
92
|
+
background: transparent;
|
|
93
|
+
color: inherit;
|
|
94
|
+
border: 1px solid oklch(0.683 0.033 275.367 / 0.5);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.cookie-consent-btn--secondary:hover {
|
|
98
|
+
background: oklch(0.5 0 0 / 0.08);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@media (max-width: 640px) {
|
|
102
|
+
.cookie-consent-inner {
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
flex-wrap: wrap;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
108
|
+
|
|
109
|
+
<script is:inline>
|
|
110
|
+
(() => {
|
|
111
|
+
const CONSENT_KEY = 'dc_cookie_consent';
|
|
112
|
+
|
|
113
|
+
const getConsent = () => {
|
|
114
|
+
try {
|
|
115
|
+
return window.localStorage.getItem(CONSENT_KEY);
|
|
116
|
+
} catch {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const setConsent = (status) => {
|
|
122
|
+
try {
|
|
123
|
+
window.localStorage.setItem(CONSENT_KEY, status);
|
|
124
|
+
} catch {
|
|
125
|
+
// localStorage unavailable (e.g. private browsing) - consent will be asked again next visit.
|
|
126
|
+
}
|
|
127
|
+
window.dispatchEvent(new CustomEvent('dc-cookie-consent', { detail: { status } }));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const init = () => {
|
|
131
|
+
const banner = document.getElementById('cookie-consent-banner');
|
|
132
|
+
const acceptBtn = document.getElementById('cookie-consent-accept');
|
|
133
|
+
const rejectBtn = document.getElementById('cookie-consent-reject');
|
|
134
|
+
|
|
135
|
+
if (!banner || !acceptBtn || !rejectBtn) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const existingConsent = getConsent();
|
|
140
|
+
if (existingConsent === 'accepted' || existingConsent === 'rejected') {
|
|
141
|
+
// Consent already recorded - notify listeners (e.g. Clarity) without showing the banner again.
|
|
142
|
+
window.dispatchEvent(new CustomEvent('dc-cookie-consent', { detail: { status: existingConsent } }));
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
banner.style.display = 'block';
|
|
147
|
+
|
|
148
|
+
acceptBtn.addEventListener('click', () => {
|
|
149
|
+
banner.style.display = 'none';
|
|
150
|
+
setConsent('accepted');
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
rejectBtn.addEventListener('click', () => {
|
|
154
|
+
banner.style.display = 'none';
|
|
155
|
+
setConsent('rejected');
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
if (document.readyState === 'loading') {
|
|
160
|
+
document.addEventListener('DOMContentLoaded', init);
|
|
161
|
+
} else {
|
|
162
|
+
init();
|
|
163
|
+
}
|
|
164
|
+
})();
|
|
165
|
+
</script>
|