@aws/nx-plugin 1.0.0-rc.83 → 1.0.0-rc.84
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/migrations.json +26 -1
- package/package.json +1 -1
- package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +51 -2
- package/src/agentcore-harness/__snapshots__/generator.spec.ts.snap +4 -5
- package/src/agentcore-harness/files/project/README.md.template +4 -5
- package/src/migrations/latest/agentcore-harness-no-tools-by-default/__snapshots__/migration.spec.ts.snap +79 -0
- package/src/migrations/latest/agentcore-harness-no-tools-by-default/metadata.json +3 -0
- package/src/migrations/latest/agentcore-harness-no-tools-by-default/migration.d.ts +6 -0
- package/src/migrations/latest/agentcore-harness-no-tools-by-default/migration.js +87 -0
- package/src/migrations/latest/agentcore-harness-no-tools-by-default/migration.js.map +1 -0
- package/src/migrations/latest/rdb-terraform-aurora-app-module-defaults/__snapshots__/migration.spec.ts.snap +54 -0
- package/src/migrations/latest/rdb-terraform-aurora-app-module-defaults/metadata.json +3 -0
- package/src/migrations/latest/rdb-terraform-aurora-app-module-defaults/migration.d.ts +6 -0
- package/src/migrations/latest/rdb-terraform-aurora-app-module-defaults/migration.js +86 -0
- package/src/migrations/latest/rdb-terraform-aurora-app-module-defaults/migration.js.map +1 -0
- package/src/migrations/latest/terraform-declare-used-providers/metadata.json +3 -0
- package/src/migrations/latest/terraform-declare-used-providers/migration.d.ts +6 -0
- package/src/migrations/latest/terraform-declare-used-providers/migration.js +147 -0
- package/src/migrations/latest/terraform-declare-used-providers/migration.js.map +1 -0
- package/src/migrations/latest/terraform-harness-vpc-role-and-memory-grant/__snapshots__/migration.spec.ts.snap +521 -0
- package/src/migrations/latest/terraform-harness-vpc-role-and-memory-grant/metadata.json +3 -0
- package/src/migrations/latest/terraform-harness-vpc-role-and-memory-grant/migration.d.ts +6 -0
- package/src/migrations/latest/terraform-harness-vpc-role-and-memory-grant/migration.js +504 -0
- package/src/migrations/latest/terraform-harness-vpc-role-and-memory-grant/migration.js.map +1 -0
- package/src/migrations/latest/waf-log-group-cmk-encryption/__snapshots__/migration.spec.ts.snap +286 -0
- package/src/migrations/latest/waf-log-group-cmk-encryption/metadata.json +3 -0
- package/src/migrations/latest/waf-log-group-cmk-encryption/migration.d.ts +6 -0
- package/src/migrations/latest/waf-log-group-cmk-encryption/migration.js +238 -0
- package/src/migrations/latest/waf-log-group-cmk-encryption/migration.js.map +1 -0
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +12 -0
- package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +231 -24
- package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +8 -0
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +31 -2
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +216 -25
- package/src/terraform/project/files/application/bootstrap/providers.tf.template +9 -0
- package/src/terraform/project/files/application/src/providers.tf.template +4 -0
- package/src/terraform/project/files/library/src/main.tf.template +9 -0
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +231 -24
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +8 -0
- package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +8 -0
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +62 -4
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +4 -0
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +35 -8
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +4 -0
- package/src/utils/agent-core-constructs/files/cdk/app/agentcore-harness/__nameKebabCase__/__nameKebabCase__.ts.template +39 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agent-core/__nameKebabCase__/__nameKebabCase__.tf.template +8 -1
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +57 -2
- package/src/utils/agent-core-constructs/files/terraform/app/agentcore-harness/__nameKebabCase__/__nameKebabCase__.tf.template +258 -24
- package/src/utils/agent-core-constructs/files/terraform/core/agent-core/runtime.tf.template +4 -0
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +8 -0
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +9 -1
- package/src/utils/api-constructs/files/terraform/core/api/rest/rest-api/rest-api.tf.template +60 -7
- package/src/utils/dcr-proxy-constructs/files/terraform/app/dcr-proxies/__nameKebabCase__/__nameKebabCase__.tf.template +4 -0
- package/src/utils/files/terraform/src/metrics/providers.tf.template +12 -0
- package/src/utils/function-constructs/files/terraform/app/lambda-functions/__nameKebabCase__/__nameKebabCase__.tf.template +4 -0
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +33 -8
- package/src/utils/identity-constructs/files/terraform/core/user-identity/add-callback-url/add-callback-url.tf.template +4 -0
- package/src/utils/identity-constructs/files/terraform/core/user-identity/identity/identity.tf.template +51 -2
- package/src/utils/rdb-constructs/files/cdk/core/rdb/aurora.ts.template +18 -0
- package/src/utils/rdb-constructs/files/terraform/app/dbs/__nameKebabCase__/__nameKebabCase__.tf.template +15 -4
- package/src/utils/rdb-constructs/files/terraform/core/rdb/aurora/aurora.tf.template +2 -2
- package/src/utils/rdb-constructs/rdb-constructs.d.ts +12 -0
- package/src/utils/rdb-constructs/rdb-constructs.js +24 -3
- package/src/utils/rdb-constructs/rdb-constructs.js.map +1 -1
- package/src/utils/website-constructs/files/terraform/core/static-website/static-website.tf.template +4 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/ import { joinPathFragments, visitNotIgnoredFiles } from "@nx/devkit";
|
|
5
|
+
import { captureAllGritQL, GRIT_INSERT_PLACEHOLDER, insertViaGritQL, matchGritQL } from "../../../utils/ast.js";
|
|
6
|
+
import { formatFilesInSubtree } from "../../../utils/format.js";
|
|
7
|
+
import { PACKAGES_DIR, SHARED_TERRAFORM_DIR } from "../../../utils/shared-constructs-constants.js";
|
|
8
|
+
import { TERRAFORM_VERSIONS } from "../../../utils/versions.js";
|
|
9
|
+
/**
|
|
10
|
+
* Declare every provider each vended Terraform module uses in its own
|
|
11
|
+
* `required_providers`.
|
|
12
|
+
*
|
|
13
|
+
* A provider a module uses but never declares is resolved by implicit
|
|
14
|
+
* inheritance from the root module, unpinned — so `terraform init` on that
|
|
15
|
+
* module takes whatever the registry serves, bypassing the version pinning the
|
|
16
|
+
* generators vend. Several vended modules referenced `random`, `archive`,
|
|
17
|
+
* `null`, `external` and `aws` without declaring them.
|
|
18
|
+
*
|
|
19
|
+
* These files are generated with `KeepExisting`, so an upgraded workspace keeps
|
|
20
|
+
* the unpinned shape until this runs. Each missing provider is added to the
|
|
21
|
+
* module's existing `required_providers`; a module with no `terraform` block at
|
|
22
|
+
* all is reported via `nextSteps` rather than having one inserted, since where
|
|
23
|
+
* it belongs depends on how the user has arranged the file.
|
|
24
|
+
*/ const TERRAFORM_SRC = joinPathFragments(PACKAGES_DIR, SHARED_TERRAFORM_DIR, 'src');
|
|
25
|
+
const hcl = (pattern)=>`language hcl\n${pattern}`;
|
|
26
|
+
/** Providers built in to Terraform, which have no entry and no version. */ const BUILTIN_TYPES = new Set([
|
|
27
|
+
'terraform_data',
|
|
28
|
+
'terraform_remote_state'
|
|
29
|
+
]);
|
|
30
|
+
/**
|
|
31
|
+
* The provider a resource or data source type resolves to. Terraform derives
|
|
32
|
+
* this from the type's first underscore-delimited word; a type it can't
|
|
33
|
+
* attribute to a provider the plugin vends is not this migration's to touch.
|
|
34
|
+
*/ const providerOf = (type)=>{
|
|
35
|
+
// `null_resource` and `external` are the whole type, not a prefixed one.
|
|
36
|
+
if (type === 'null_resource') {
|
|
37
|
+
return 'null';
|
|
38
|
+
}
|
|
39
|
+
if (type === 'external') {
|
|
40
|
+
return 'external';
|
|
41
|
+
}
|
|
42
|
+
const [prefix] = type.split('_');
|
|
43
|
+
return prefix in TERRAFORM_VERSIONS ? prefix : undefined;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The providers a module requires, read from its `resource` and `data` blocks.
|
|
47
|
+
*
|
|
48
|
+
* Only declarations are read, because Terraform resolves a resource reference
|
|
49
|
+
* within the module that declares it — so a provider a module references is one
|
|
50
|
+
* it also declares a block for, and the blocks alone are complete. Matching the
|
|
51
|
+
* syntax tree also means a type named in a comment, in string prose or inside a
|
|
52
|
+
* `local-exec` heredoc's embedded Python is not a use, since none of those parse
|
|
53
|
+
* as a block.
|
|
54
|
+
*/ const usedProviders = async (tree, filePath)=>{
|
|
55
|
+
const used = new Set();
|
|
56
|
+
for (const kind of [
|
|
57
|
+
'resource',
|
|
58
|
+
'data'
|
|
59
|
+
]){
|
|
60
|
+
for (const block of (await captureAllGritQL(tree, filePath, hcl(`\`${kind} $type $name { $_ }\``)))){
|
|
61
|
+
// The block's own type, e.g. `resource "random_string" "suffix" {`.
|
|
62
|
+
const type = /"([A-Za-z0-9_]+)"/.exec(block)?.[1];
|
|
63
|
+
if (!type || BUILTIN_TYPES.has(type)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const provider = providerOf(type);
|
|
67
|
+
if (provider) {
|
|
68
|
+
used.add(provider);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return used;
|
|
73
|
+
};
|
|
74
|
+
/** Every `.tf` file in the workspace's shared terraform library, by directory. */ const terraformModules = (tree)=>{
|
|
75
|
+
const modules = new Map();
|
|
76
|
+
if (!tree.exists(TERRAFORM_SRC)) {
|
|
77
|
+
return modules;
|
|
78
|
+
}
|
|
79
|
+
visitNotIgnoredFiles(tree, TERRAFORM_SRC, (filePath)=>{
|
|
80
|
+
if (!filePath.endsWith('.tf')) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const dir = filePath.slice(0, filePath.lastIndexOf('/'));
|
|
84
|
+
modules.set(dir, [
|
|
85
|
+
...modules.get(dir) ?? [],
|
|
86
|
+
filePath
|
|
87
|
+
]);
|
|
88
|
+
});
|
|
89
|
+
return modules;
|
|
90
|
+
};
|
|
91
|
+
/** The provider entry to vend, at the version this release pins. */ const providerEntry = (provider)=>[
|
|
92
|
+
`${provider} = {`,
|
|
93
|
+
` source = "hashicorp/${provider}"`,
|
|
94
|
+
` version = "${TERRAFORM_VERSIONS[provider]}"`,
|
|
95
|
+
'}'
|
|
96
|
+
].join('\n');
|
|
97
|
+
/**
|
|
98
|
+
* Add a provider to a file's `required_providers`. Appended after the block's
|
|
99
|
+
* existing body, so an entry the user has customised is left as it is.
|
|
100
|
+
*/ const declareProvider = (tree, filePath, provider)=>insertViaGritQL(tree, filePath, hcl(`\`required_providers { $body }\` => \`required_providers {\n $body\n\n ${GRIT_INSERT_PLACEHOLDER}\n}\`` + ` where { $body <: not contains \`${provider} = { $_ }\` }`), providerEntry(provider));
|
|
101
|
+
export default async function migration(tree) {
|
|
102
|
+
const nextSteps = [];
|
|
103
|
+
for (const [dir, filePaths] of terraformModules(tree)){
|
|
104
|
+
const used = new Set();
|
|
105
|
+
// The file holding the module's `required_providers`, which is where the
|
|
106
|
+
// missing declarations are added — Terraform merges every `.tf` in a
|
|
107
|
+
// directory, so one block covers the module.
|
|
108
|
+
let blockFile;
|
|
109
|
+
const declared = new Set();
|
|
110
|
+
for (const filePath of filePaths){
|
|
111
|
+
for (const provider of (await usedProviders(tree, filePath))){
|
|
112
|
+
used.add(provider);
|
|
113
|
+
}
|
|
114
|
+
const contents = tree.read(filePath, 'utf-8') ?? '';
|
|
115
|
+
if (!contents.includes('required_providers')) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
blockFile ??= filePath;
|
|
119
|
+
for (const provider of Object.keys(TERRAFORM_VERSIONS)){
|
|
120
|
+
if (await matchGritQL(tree, filePath, hcl(`\`required_providers { $body }\` where { $body <: contains \`${provider} = { $_ }\` }`))) {
|
|
121
|
+
declared.add(provider);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const missing = [
|
|
126
|
+
...used
|
|
127
|
+
].filter((p)=>!declared.has(p)).sort();
|
|
128
|
+
if (missing.length === 0) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (!blockFile) {
|
|
132
|
+
nextSteps.push(`${dir}: has no terraform required_providers block - left untouched. Add one declaring ${missing.join(', ')}, so the module pins the providers it uses rather than inheriting them unpinned from the root module.`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
for (const provider of missing){
|
|
136
|
+
if (!await declareProvider(tree, blockFile, provider)) {
|
|
137
|
+
nextSteps.push(`${blockFile}: its required_providers block has diverged from the generated shape - left untouched. Add a ${provider} entry to it, sourced from hashicorp/${provider}.`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
await formatFilesInSubtree(tree);
|
|
142
|
+
return {
|
|
143
|
+
nextSteps
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/terraform-declare-used-providers/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n visitNotIgnoredFiles,\n} from '@nx/devkit';\nimport {\n captureAllGritQL,\n GRIT_INSERT_PLACEHOLDER,\n insertViaGritQL,\n matchGritQL,\n} from '../../../utils/ast.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport {\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n} from '../../../utils/shared-constructs-constants.js';\nimport { TERRAFORM_VERSIONS } from '../../../utils/versions.js';\n\n/**\n * Declare every provider each vended Terraform module uses in its own\n * `required_providers`.\n *\n * A provider a module uses but never declares is resolved by implicit\n * inheritance from the root module, unpinned — so `terraform init` on that\n * module takes whatever the registry serves, bypassing the version pinning the\n * generators vend. Several vended modules referenced `random`, `archive`,\n * `null`, `external` and `aws` without declaring them.\n *\n * These files are generated with `KeepExisting`, so an upgraded workspace keeps\n * the unpinned shape until this runs. Each missing provider is added to the\n * module's existing `required_providers`; a module with no `terraform` block at\n * all is reported via `nextSteps` rather than having one inserted, since where\n * it belongs depends on how the user has arranged the file.\n */\n\nconst TERRAFORM_SRC = joinPathFragments(\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n 'src',\n);\n\nconst hcl = (pattern: string) => `language hcl\\n${pattern}`;\n\n/** Providers built in to Terraform, which have no entry and no version. */\nconst BUILTIN_TYPES = new Set(['terraform_data', 'terraform_remote_state']);\n\n/**\n * The provider a resource or data source type resolves to. Terraform derives\n * this from the type's first underscore-delimited word; a type it can't\n * attribute to a provider the plugin vends is not this migration's to touch.\n */\nconst providerOf = (type: string): string | undefined => {\n // `null_resource` and `external` are the whole type, not a prefixed one.\n if (type === 'null_resource') {\n return 'null';\n }\n if (type === 'external') {\n return 'external';\n }\n const [prefix] = type.split('_');\n return prefix in TERRAFORM_VERSIONS ? prefix : undefined;\n};\n\n/**\n * The providers a module requires, read from its `resource` and `data` blocks.\n *\n * Only declarations are read, because Terraform resolves a resource reference\n * within the module that declares it — so a provider a module references is one\n * it also declares a block for, and the blocks alone are complete. Matching the\n * syntax tree also means a type named in a comment, in string prose or inside a\n * `local-exec` heredoc's embedded Python is not a use, since none of those parse\n * as a block.\n */\nconst usedProviders = async (\n tree: Tree,\n filePath: string,\n): Promise<Set<string>> => {\n const used = new Set<string>();\n for (const kind of ['resource', 'data']) {\n for (const block of await captureAllGritQL(\n tree,\n filePath,\n hcl(`\\`${kind} $type $name { $_ }\\``),\n )) {\n // The block's own type, e.g. `resource \"random_string\" \"suffix\" {`.\n const type = /\"([A-Za-z0-9_]+)\"/.exec(block)?.[1];\n if (!type || BUILTIN_TYPES.has(type)) {\n continue;\n }\n const provider = providerOf(type);\n if (provider) {\n used.add(provider);\n }\n }\n }\n return used;\n};\n\n/** Every `.tf` file in the workspace's shared terraform library, by directory. */\nconst terraformModules = (tree: Tree): Map<string, string[]> => {\n const modules = new Map<string, string[]>();\n if (!tree.exists(TERRAFORM_SRC)) {\n return modules;\n }\n visitNotIgnoredFiles(tree, TERRAFORM_SRC, (filePath) => {\n if (!filePath.endsWith('.tf')) {\n return;\n }\n const dir = filePath.slice(0, filePath.lastIndexOf('/'));\n modules.set(dir, [...(modules.get(dir) ?? []), filePath]);\n });\n return modules;\n};\n\n/** The provider entry to vend, at the version this release pins. */\nconst providerEntry = (provider: string) =>\n [\n `${provider} = {`,\n ` source = \"hashicorp/${provider}\"`,\n ` version = \"${TERRAFORM_VERSIONS[provider as keyof typeof TERRAFORM_VERSIONS]}\"`,\n '}',\n ].join('\\n');\n\n/**\n * Add a provider to a file's `required_providers`. Appended after the block's\n * existing body, so an entry the user has customised is left as it is.\n */\nconst declareProvider = (tree: Tree, filePath: string, provider: string) =>\n insertViaGritQL(\n tree,\n filePath,\n hcl(\n `\\`required_providers { $body }\\` => \\`required_providers {\\n $body\\n\\n ${GRIT_INSERT_PLACEHOLDER}\\n}\\`` +\n ` where { $body <: not contains \\`${provider} = { $_ }\\` }`,\n ),\n providerEntry(provider),\n );\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n for (const [dir, filePaths] of terraformModules(tree)) {\n const used = new Set<string>();\n // The file holding the module's `required_providers`, which is where the\n // missing declarations are added — Terraform merges every `.tf` in a\n // directory, so one block covers the module.\n let blockFile: string | undefined;\n const declared = new Set<string>();\n\n for (const filePath of filePaths) {\n for (const provider of await usedProviders(tree, filePath)) {\n used.add(provider);\n }\n const contents = tree.read(filePath, 'utf-8') ?? '';\n if (!contents.includes('required_providers')) {\n continue;\n }\n blockFile ??= filePath;\n for (const provider of Object.keys(TERRAFORM_VERSIONS)) {\n if (\n await matchGritQL(\n tree,\n filePath,\n hcl(\n `\\`required_providers { $body }\\` where { $body <: contains \\`${provider} = { $_ }\\` }`,\n ),\n )\n ) {\n declared.add(provider);\n }\n }\n }\n\n const missing = [...used].filter((p) => !declared.has(p)).sort();\n if (missing.length === 0) {\n continue;\n }\n\n if (!blockFile) {\n nextSteps.push(\n `${dir}: has no terraform required_providers block - left untouched. Add one declaring ${missing.join(', ')}, so the module pins the providers it uses rather than inheriting them unpinned from the root module.`,\n );\n continue;\n }\n\n for (const provider of missing) {\n if (!(await declareProvider(tree, blockFile, provider))) {\n nextSteps.push(\n `${blockFile}: its required_providers block has diverged from the generated shape - left untouched. Add a ${provider} entry to it, sourced from hashicorp/${provider}.`,\n );\n }\n }\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["joinPathFragments","visitNotIgnoredFiles","captureAllGritQL","GRIT_INSERT_PLACEHOLDER","insertViaGritQL","matchGritQL","formatFilesInSubtree","PACKAGES_DIR","SHARED_TERRAFORM_DIR","TERRAFORM_VERSIONS","TERRAFORM_SRC","hcl","pattern","BUILTIN_TYPES","Set","providerOf","type","prefix","split","undefined","usedProviders","tree","filePath","used","kind","block","exec","has","provider","add","terraformModules","modules","Map","exists","endsWith","dir","slice","lastIndexOf","set","get","providerEntry","join","declareProvider","migration","nextSteps","filePaths","blockFile","declared","contents","read","includes","Object","keys","missing","filter","p","sort","length","push"],"mappings":"AAAA;;;CAGC,GACD,SACEA,iBAAiB,EAGjBC,oBAAoB,QACf,aAAa;AACpB,SACEC,gBAAgB,EAChBC,uBAAuB,EACvBC,eAAe,EACfC,WAAW,QACN,wBAAwB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