@jjrawlins/cdk-ami-builder 0.0.53 → 0.0.54
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 +11 -11
- package/cdk-ami-builder/go.mod +1 -1
- package/cdk-ami-builder/jsii/jsii.go +2 -2
- package/cdk-ami-builder/version +1 -1
- package/lib/ImagePipeline/ImagePipeline.js +1 -1
- package/lib/Lambdas/CheckStateMachineStatus/CheckStateMachineStatus-function.js +1 -1
- package/lib/Lambdas/StartStateMachine/StartStateMachine-function.js +1 -1
- package/node_modules/@aws-sdk/client-ec2/README.md +8 -0
- package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +175 -78
- package/node_modules/@aws-sdk/client-ec2/dist-es/EC2.js +2 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/CopyVolumesCommand.js +22 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/commands/index.js +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/models_1.js +22 -9
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/models_2.js +0 -20
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/models_3.js +7 -4
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/models_4.js +4 -4
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/models_5.js +5 -5
- package/node_modules/@aws-sdk/client-ec2/dist-es/models/models_6.js +5 -0
- package/node_modules/@aws-sdk/client-ec2/dist-es/protocols/Aws_ec2.js +113 -36
- package/node_modules/@aws-sdk/client-ec2/dist-types/EC2.d.ts +7 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/EC2Client.d.ts +3 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CopyVolumesCommand.d.ts +137 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/CreateVolumeCommand.d.ts +3 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeCapacityReservationBillingRequestsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeVolumeStatusCommand.d.ts +3 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/DescribeVolumesCommand.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetManagedPrefixListEntriesCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/GetNetworkInsightsAccessScopeAnalysisFindingsCommand.d.ts +1 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/ProvisionIpamByoasnCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/commands/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_1.d.ts +309 -115
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_2.d.ts +104 -227
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_3.d.ts +45 -83
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_4.d.ts +83 -30
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_5.d.ts +37 -32
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_6.d.ts +32 -46
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_7.d.ts +52 -43
- package/node_modules/@aws-sdk/client-ec2/dist-types/models/models_8.d.ts +44 -7
- package/node_modules/@aws-sdk/client-ec2/dist-types/protocols/Aws_ec2.d.ts +9 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2.d.ts +17 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/EC2Client.d.ts +6 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/CopyVolumesCommand.d.ts +47 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/CreateVolumeCommand.d.ts +2 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DescribeCapacityReservationBillingRequestsCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/DescribeVolumeStatusCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetManagedPrefixListEntriesCommand.d.ts +2 -4
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/GetNetworkInsightsAccessScopeAnalysisFindingsCommand.d.ts +4 -2
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/ProvisionIpamByoasnCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_1.d.ts +67 -31
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_2.d.ts +18 -57
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_3.d.ts +14 -15
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_4.d.ts +13 -10
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_5.d.ts +13 -14
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_6.d.ts +13 -12
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_7.d.ts +12 -11
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/models/models_8.d.ts +12 -1
- package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/protocols/Aws_ec2.d.ts +12 -0
- package/node_modules/@aws-sdk/client-ec2/package.json +35 -35
- package/node_modules/@aws-sdk/client-ecs/package.json +34 -34
- package/node_modules/@aws-sdk/client-kms/dist-types/models/models_0.d.ts +3 -3
- package/node_modules/@aws-sdk/client-kms/package.json +33 -33
- package/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +4 -4
- package/node_modules/@aws-sdk/client-s3/package.json +50 -50
- package/node_modules/@aws-sdk/client-secrets-manager/package.json +33 -33
- package/node_modules/@aws-sdk/client-sfn/package.json +33 -33
- package/node_modules/@aws-sdk/client-sns/package.json +33 -33
- package/node_modules/@aws-sdk/client-sqs/dist-types/models/models_0.d.ts +1 -1
- package/node_modules/@aws-sdk/client-sqs/package.json +35 -35
- package/node_modules/@aws-sdk/client-ssm/package.json +34 -34
- package/node_modules/@aws-sdk/client-sso/package.json +32 -32
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +5 -5
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +5 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ProtocolLib.d.ts +4 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +7 -7
- package/node_modules/@aws-sdk/core/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
- package/node_modules/@aws-sdk/middleware-bucket-endpoint/dist-cjs/index.js +334 -450
- package/node_modules/@aws-sdk/middleware-bucket-endpoint/package.json +5 -5
- package/node_modules/@aws-sdk/middleware-expect-continue/dist-cjs/index.js +30 -60
- package/node_modules/@aws-sdk/middleware-expect-continue/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +9 -9
- package/node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js +35 -63
- package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-location-constraint/dist-cjs/index.js +26 -57
- package/node_modules/@aws-sdk/middleware-location-constraint/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js +44 -75
- package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js +19 -48
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +8 -8
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +11 -11
- package/node_modules/@aws-sdk/middleware-sdk-sqs/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-ssec/dist-cjs/index.js +65 -92
- package/node_modules/@aws-sdk/middleware-ssec/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
- package/node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js +59 -95
- package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +6 -6
- package/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/types/dist-cjs/index.js +18 -290
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +395 -469
- package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
- package/node_modules/@aws-sdk/util-format-url/dist-cjs/index.js +30 -58
- package/node_modules/@aws-sdk/util-format-url/package.json +4 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +106 -160
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +74 -61
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +16 -9
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +0 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/SimpleSchema.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +1 -2
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/SimpleSchema.d.ts +5 -0
- package/node_modules/@smithy/core/package.json +7 -7
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/eventstream-codec/package.json +2 -2
- package/node_modules/@smithy/eventstream-serde-browser/package.json +3 -3
- package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +2 -2
- package/node_modules/@smithy/eventstream-serde-node/package.json +3 -3
- package/node_modules/@smithy/eventstream-serde-universal/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-blob-browser/package.json +2 -2
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/hash-stream-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/md5-js/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/package.json +8 -8
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +4 -4
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +1 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +2 -2
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/package.json +4 -4
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/package.json +13 -13
|
@@ -1,468 +1,352 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
20
2
|
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS: () => NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS,
|
|
25
|
-
NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME: () => NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME,
|
|
26
|
-
NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME: () => NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME,
|
|
27
|
-
NODE_USE_ARN_REGION_CONFIG_OPTIONS: () => NODE_USE_ARN_REGION_CONFIG_OPTIONS,
|
|
28
|
-
NODE_USE_ARN_REGION_ENV_NAME: () => NODE_USE_ARN_REGION_ENV_NAME,
|
|
29
|
-
NODE_USE_ARN_REGION_INI_NAME: () => NODE_USE_ARN_REGION_INI_NAME,
|
|
30
|
-
bucketEndpointMiddleware: () => bucketEndpointMiddleware,
|
|
31
|
-
bucketEndpointMiddlewareOptions: () => bucketEndpointMiddlewareOptions,
|
|
32
|
-
bucketHostname: () => bucketHostname,
|
|
33
|
-
getArnResources: () => getArnResources,
|
|
34
|
-
getBucketEndpointPlugin: () => getBucketEndpointPlugin,
|
|
35
|
-
getSuffixForArnEndpoint: () => getSuffixForArnEndpoint,
|
|
36
|
-
resolveBucketEndpointConfig: () => resolveBucketEndpointConfig,
|
|
37
|
-
validateAccountId: () => validateAccountId,
|
|
38
|
-
validateDNSHostLabel: () => validateDNSHostLabel,
|
|
39
|
-
validateNoDualstack: () => validateNoDualstack,
|
|
40
|
-
validateNoFIPS: () => validateNoFIPS,
|
|
41
|
-
validateOutpostService: () => validateOutpostService,
|
|
42
|
-
validatePartition: () => validatePartition,
|
|
43
|
-
validateRegion: () => validateRegion
|
|
44
|
-
});
|
|
45
|
-
module.exports = __toCommonJS(index_exports);
|
|
3
|
+
var utilConfigProvider = require('@smithy/util-config-provider');
|
|
4
|
+
var utilArnParser = require('@aws-sdk/util-arn-parser');
|
|
5
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
46
6
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
configFileSelector: /* @__PURE__ */ __name((profile) => (0, import_util_config_provider.booleanSelector)(profile, NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME, import_util_config_provider.SelectorType.CONFIG), "configFileSelector"),
|
|
54
|
-
default: false
|
|
7
|
+
const NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS";
|
|
8
|
+
const NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = "s3_disable_multiregion_access_points";
|
|
9
|
+
const NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = {
|
|
10
|
+
environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME, utilConfigProvider.SelectorType.ENV),
|
|
11
|
+
configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME, utilConfigProvider.SelectorType.CONFIG),
|
|
12
|
+
default: false,
|
|
55
13
|
};
|
|
56
14
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
configFileSelector: /* @__PURE__ */ __name((profile) => (0, import_util_config_provider.booleanSelector)(profile, NODE_USE_ARN_REGION_INI_NAME, import_util_config_provider.SelectorType.CONFIG), "configFileSelector"),
|
|
64
|
-
/**
|
|
65
|
-
* useArnRegion has specific behavior when undefined instead of false.
|
|
66
|
-
* We therefore use undefined as the default value instead of false.
|
|
67
|
-
*/
|
|
68
|
-
default: void 0
|
|
15
|
+
const NODE_USE_ARN_REGION_ENV_NAME = "AWS_S3_USE_ARN_REGION";
|
|
16
|
+
const NODE_USE_ARN_REGION_INI_NAME = "s3_use_arn_region";
|
|
17
|
+
const NODE_USE_ARN_REGION_CONFIG_OPTIONS = {
|
|
18
|
+
environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_USE_ARN_REGION_ENV_NAME, utilConfigProvider.SelectorType.ENV),
|
|
19
|
+
configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_USE_ARN_REGION_INI_NAME, utilConfigProvider.SelectorType.CONFIG),
|
|
20
|
+
default: undefined,
|
|
69
21
|
};
|
|
70
22
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var validateArnEndpointOptions = /* @__PURE__ */ __name((options) => {
|
|
92
|
-
if (options.pathStyleEndpoint) {
|
|
93
|
-
throw new Error("Path-style S3 endpoint is not supported when bucket is an ARN");
|
|
94
|
-
}
|
|
95
|
-
if (options.accelerateEndpoint) {
|
|
96
|
-
throw new Error("Accelerate endpoint is not supported when bucket is an ARN");
|
|
97
|
-
}
|
|
98
|
-
if (!options.tlsCompatible) {
|
|
99
|
-
throw new Error("HTTPS is required when bucket is an ARN");
|
|
100
|
-
}
|
|
101
|
-
}, "validateArnEndpointOptions");
|
|
102
|
-
var validateService = /* @__PURE__ */ __name((service) => {
|
|
103
|
-
if (service !== "s3" && service !== "s3-outposts" && service !== "s3-object-lambda") {
|
|
104
|
-
throw new Error("Expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component");
|
|
105
|
-
}
|
|
106
|
-
}, "validateService");
|
|
107
|
-
var validateS3Service = /* @__PURE__ */ __name((service) => {
|
|
108
|
-
if (service !== "s3") {
|
|
109
|
-
throw new Error("Expect 's3' in Accesspoint ARN service component");
|
|
110
|
-
}
|
|
111
|
-
}, "validateS3Service");
|
|
112
|
-
var validateOutpostService = /* @__PURE__ */ __name((service) => {
|
|
113
|
-
if (service !== "s3-outposts") {
|
|
114
|
-
throw new Error("Expect 's3-posts' in Outpost ARN service component");
|
|
115
|
-
}
|
|
116
|
-
}, "validateOutpostService");
|
|
117
|
-
var validatePartition = /* @__PURE__ */ __name((partition, options) => {
|
|
118
|
-
if (partition !== options.clientPartition) {
|
|
119
|
-
throw new Error(`Partition in ARN is incompatible, got "${partition}" but expected "${options.clientPartition}"`);
|
|
120
|
-
}
|
|
121
|
-
}, "validatePartition");
|
|
122
|
-
var validateRegion = /* @__PURE__ */ __name((region, options) => {
|
|
123
|
-
}, "validateRegion");
|
|
124
|
-
var validateRegionalClient = /* @__PURE__ */ __name((region) => {
|
|
125
|
-
if (["s3-external-1", "aws-global"].includes(region)) {
|
|
126
|
-
throw new Error(`Client region ${region} is not regional`);
|
|
127
|
-
}
|
|
128
|
-
}, "validateRegionalClient");
|
|
129
|
-
var validateAccountId = /* @__PURE__ */ __name((accountId) => {
|
|
130
|
-
if (!/[0-9]{12}/.exec(accountId)) {
|
|
131
|
-
throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'");
|
|
132
|
-
}
|
|
133
|
-
}, "validateAccountId");
|
|
134
|
-
var validateDNSHostLabel = /* @__PURE__ */ __name((label, options = { tlsCompatible: true }) => {
|
|
135
|
-
if (label.length >= 64 || !/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(label) || /(\d+\.){3}\d+/.test(label) || /[.-]{2}/.test(label) || options?.tlsCompatible && DOT_PATTERN.test(label)) {
|
|
136
|
-
throw new Error(`Invalid DNS label ${label}`);
|
|
137
|
-
}
|
|
138
|
-
}, "validateDNSHostLabel");
|
|
139
|
-
var validateCustomEndpoint = /* @__PURE__ */ __name((options) => {
|
|
140
|
-
if (options.isCustomEndpoint) {
|
|
141
|
-
if (options.dualstackEndpoint) throw new Error("Dualstack endpoint is not supported with custom endpoint");
|
|
142
|
-
if (options.accelerateEndpoint) throw new Error("Accelerate endpoint is not supported with custom endpoint");
|
|
143
|
-
}
|
|
144
|
-
}, "validateCustomEndpoint");
|
|
145
|
-
var getArnResources = /* @__PURE__ */ __name((resource) => {
|
|
146
|
-
const delimiter = resource.includes(":") ? ":" : "/";
|
|
147
|
-
const [resourceType, ...rest] = resource.split(delimiter);
|
|
148
|
-
if (resourceType === "accesspoint") {
|
|
149
|
-
if (rest.length !== 1 || rest[0] === "") {
|
|
150
|
-
throw new Error(`Access Point ARN should have one resource accesspoint${delimiter}{accesspointname}`);
|
|
23
|
+
const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
|
|
24
|
+
const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
|
|
25
|
+
const DOTS_PATTERN = /\.\./;
|
|
26
|
+
const DOT_PATTERN = /\./;
|
|
27
|
+
const S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./;
|
|
28
|
+
const S3_US_EAST_1_ALTNAME_PATTERN = /^s3(-external-1)?\.amazonaws\.com$/;
|
|
29
|
+
const AWS_PARTITION_SUFFIX = "amazonaws.com";
|
|
30
|
+
const isBucketNameOptions = (options) => typeof options.bucketName === "string";
|
|
31
|
+
const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
|
|
32
|
+
const getRegionalSuffix = (hostname) => {
|
|
33
|
+
const parts = hostname.match(S3_HOSTNAME_PATTERN);
|
|
34
|
+
return [parts[4], hostname.replace(new RegExp(`^${parts[0]}`), "")];
|
|
35
|
+
};
|
|
36
|
+
const getSuffix = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname) ? ["us-east-1", AWS_PARTITION_SUFFIX] : getRegionalSuffix(hostname);
|
|
37
|
+
const getSuffixForArnEndpoint = (hostname) => S3_US_EAST_1_ALTNAME_PATTERN.test(hostname)
|
|
38
|
+
? [hostname.replace(`.${AWS_PARTITION_SUFFIX}`, ""), AWS_PARTITION_SUFFIX]
|
|
39
|
+
: getRegionalSuffix(hostname);
|
|
40
|
+
const validateArnEndpointOptions = (options) => {
|
|
41
|
+
if (options.pathStyleEndpoint) {
|
|
42
|
+
throw new Error("Path-style S3 endpoint is not supported when bucket is an ARN");
|
|
151
43
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (!rest[0] || rest[1] !== "accesspoint" || !rest[2] || rest.length !== 3) {
|
|
155
|
-
throw new Error(
|
|
156
|
-
`Outpost ARN should have resource outpost${delimiter}{outpostId}${delimiter}accesspoint${delimiter}{accesspointName}`
|
|
157
|
-
);
|
|
44
|
+
if (options.accelerateEndpoint) {
|
|
45
|
+
throw new Error("Accelerate endpoint is not supported when bucket is an ARN");
|
|
158
46
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
47
|
+
if (!options.tlsCompatible) {
|
|
48
|
+
throw new Error("HTTPS is required when bucket is an ARN");
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const validateService = (service) => {
|
|
52
|
+
if (service !== "s3" && service !== "s3-outposts" && service !== "s3-object-lambda") {
|
|
53
|
+
throw new Error("Expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component");
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const validateS3Service = (service) => {
|
|
57
|
+
if (service !== "s3") {
|
|
58
|
+
throw new Error("Expect 's3' in Accesspoint ARN service component");
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const validateOutpostService = (service) => {
|
|
62
|
+
if (service !== "s3-outposts") {
|
|
63
|
+
throw new Error("Expect 's3-posts' in Outpost ARN service component");
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const validatePartition = (partition, options) => {
|
|
67
|
+
if (partition !== options.clientPartition) {
|
|
68
|
+
throw new Error(`Partition in ARN is incompatible, got "${partition}" but expected "${options.clientPartition}"`);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const validateRegion = (region, options) => { };
|
|
72
|
+
const validateRegionalClient = (region) => {
|
|
73
|
+
if (["s3-external-1", "aws-global"].includes(region)) {
|
|
74
|
+
throw new Error(`Client region ${region} is not regional`);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const validateAccountId = (accountId) => {
|
|
78
|
+
if (!/[0-9]{12}/.exec(accountId)) {
|
|
79
|
+
throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'");
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const validateDNSHostLabel = (label, options = { tlsCompatible: true }) => {
|
|
83
|
+
if (label.length >= 64 ||
|
|
84
|
+
!/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(label) ||
|
|
85
|
+
/(\d+\.){3}\d+/.test(label) ||
|
|
86
|
+
/[.-]{2}/.test(label) ||
|
|
87
|
+
(options?.tlsCompatible && DOT_PATTERN.test(label))) {
|
|
88
|
+
throw new Error(`Invalid DNS label ${label}`);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const validateCustomEndpoint = (options) => {
|
|
92
|
+
if (options.isCustomEndpoint) {
|
|
93
|
+
if (options.dualstackEndpoint)
|
|
94
|
+
throw new Error("Dualstack endpoint is not supported with custom endpoint");
|
|
95
|
+
if (options.accelerateEndpoint)
|
|
96
|
+
throw new Error("Accelerate endpoint is not supported with custom endpoint");
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const getArnResources = (resource) => {
|
|
100
|
+
const delimiter = resource.includes(":") ? ":" : "/";
|
|
101
|
+
const [resourceType, ...rest] = resource.split(delimiter);
|
|
102
|
+
if (resourceType === "accesspoint") {
|
|
103
|
+
if (rest.length !== 1 || rest[0] === "") {
|
|
104
|
+
throw new Error(`Access Point ARN should have one resource accesspoint${delimiter}{accesspointname}`);
|
|
105
|
+
}
|
|
106
|
+
return { accesspointName: rest[0] };
|
|
107
|
+
}
|
|
108
|
+
else if (resourceType === "outpost") {
|
|
109
|
+
if (!rest[0] || rest[1] !== "accesspoint" || !rest[2] || rest.length !== 3) {
|
|
110
|
+
throw new Error(`Outpost ARN should have resource outpost${delimiter}{outpostId}${delimiter}accesspoint${delimiter}{accesspointName}`);
|
|
111
|
+
}
|
|
112
|
+
const [outpostId, _, accesspointName] = rest;
|
|
113
|
+
return { outpostId, accesspointName };
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
throw new Error(`ARN resource should begin with 'accesspoint${delimiter}' or 'outpost${delimiter}'`);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const validateNoDualstack = (dualstackEndpoint) => { };
|
|
120
|
+
const validateNoFIPS = (useFipsEndpoint) => {
|
|
121
|
+
if (useFipsEndpoint)
|
|
122
|
+
throw new Error(`FIPS region is not supported with Outpost.`);
|
|
123
|
+
};
|
|
124
|
+
const validateMrapAlias = (name) => {
|
|
125
|
+
try {
|
|
126
|
+
name.split(".").forEach((label) => {
|
|
127
|
+
validateDNSHostLabel(label);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
throw new Error(`"${name}" is not a DNS compatible name.`);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
179
134
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
const [clientRegion, hostnameSuffix] = isCustomEndpoint ? [region, baseHostname] : getSuffix(baseHostname);
|
|
203
|
-
if (pathStyleEndpoint || !isDnsCompatibleBucketName(bucketName) || tlsCompatible && DOT_PATTERN.test(bucketName)) {
|
|
135
|
+
const bucketHostname = (options) => {
|
|
136
|
+
validateCustomEndpoint(options);
|
|
137
|
+
return isBucketNameOptions(options)
|
|
138
|
+
?
|
|
139
|
+
getEndpointFromBucketName(options)
|
|
140
|
+
:
|
|
141
|
+
getEndpointFromArn(options);
|
|
142
|
+
};
|
|
143
|
+
const getEndpointFromBucketName = ({ accelerateEndpoint = false, clientRegion: region, baseHostname, bucketName, dualstackEndpoint = false, fipsEndpoint = false, pathStyleEndpoint = false, tlsCompatible = true, isCustomEndpoint = false, }) => {
|
|
144
|
+
const [clientRegion, hostnameSuffix] = isCustomEndpoint ? [region, baseHostname] : getSuffix(baseHostname);
|
|
145
|
+
if (pathStyleEndpoint || !isDnsCompatibleBucketName(bucketName) || (tlsCompatible && DOT_PATTERN.test(bucketName))) {
|
|
146
|
+
return {
|
|
147
|
+
bucketEndpoint: false,
|
|
148
|
+
hostname: dualstackEndpoint ? `s3.dualstack.${clientRegion}.${hostnameSuffix}` : baseHostname,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (accelerateEndpoint) {
|
|
152
|
+
baseHostname = `s3-accelerate${dualstackEndpoint ? ".dualstack" : ""}.${hostnameSuffix}`;
|
|
153
|
+
}
|
|
154
|
+
else if (dualstackEndpoint) {
|
|
155
|
+
baseHostname = `s3.dualstack.${clientRegion}.${hostnameSuffix}`;
|
|
156
|
+
}
|
|
204
157
|
return {
|
|
205
|
-
|
|
206
|
-
|
|
158
|
+
bucketEndpoint: true,
|
|
159
|
+
hostname: `${bucketName}.${baseHostname}`,
|
|
207
160
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const hostnameSuffix = isCustomEndpoint ? baseHostname : getSuffixForArnEndpoint(baseHostname)[1];
|
|
222
|
-
const {
|
|
223
|
-
pathStyleEndpoint,
|
|
224
|
-
accelerateEndpoint = false,
|
|
225
|
-
fipsEndpoint = false,
|
|
226
|
-
tlsCompatible = true,
|
|
227
|
-
bucketName,
|
|
228
|
-
clientPartition = "aws"
|
|
229
|
-
} = options;
|
|
230
|
-
validateArnEndpointOptions({ pathStyleEndpoint, accelerateEndpoint, tlsCompatible });
|
|
231
|
-
const { service, partition, accountId, region, resource } = bucketName;
|
|
232
|
-
validateService(service);
|
|
233
|
-
validatePartition(partition, { clientPartition });
|
|
234
|
-
validateAccountId(accountId);
|
|
235
|
-
const { accesspointName, outpostId } = getArnResources(resource);
|
|
236
|
-
if (service === "s3-object-lambda") {
|
|
237
|
-
return getEndpointFromObjectLambdaArn({ ...options, tlsCompatible, bucketName, accesspointName, hostnameSuffix });
|
|
238
|
-
}
|
|
239
|
-
if (region === "") {
|
|
240
|
-
return getEndpointFromMRAPArn({ ...options, clientRegion, mrapAlias: accesspointName, hostnameSuffix });
|
|
241
|
-
}
|
|
242
|
-
if (outpostId) {
|
|
243
|
-
return getEndpointFromOutpostArn({ ...options, clientRegion, outpostId, accesspointName, hostnameSuffix });
|
|
244
|
-
}
|
|
245
|
-
return getEndpointFromAccessPointArn({ ...options, clientRegion, accesspointName, hostnameSuffix });
|
|
246
|
-
}, "getEndpointFromArn");
|
|
247
|
-
var getEndpointFromObjectLambdaArn = /* @__PURE__ */ __name(({
|
|
248
|
-
dualstackEndpoint = false,
|
|
249
|
-
fipsEndpoint = false,
|
|
250
|
-
tlsCompatible = true,
|
|
251
|
-
useArnRegion,
|
|
252
|
-
clientRegion,
|
|
253
|
-
clientSigningRegion = clientRegion,
|
|
254
|
-
accesspointName,
|
|
255
|
-
bucketName,
|
|
256
|
-
hostnameSuffix
|
|
257
|
-
}) => {
|
|
258
|
-
const { accountId, region, service } = bucketName;
|
|
259
|
-
validateRegionalClient(clientRegion);
|
|
260
|
-
const DNSHostLabel = `${accesspointName}-${accountId}`;
|
|
261
|
-
validateDNSHostLabel(DNSHostLabel, { tlsCompatible });
|
|
262
|
-
const endpointRegion = useArnRegion ? region : clientRegion;
|
|
263
|
-
const signingRegion = useArnRegion ? region : clientSigningRegion;
|
|
264
|
-
return {
|
|
265
|
-
bucketEndpoint: true,
|
|
266
|
-
hostname: `${DNSHostLabel}.${service}${fipsEndpoint ? "-fips" : ""}.${endpointRegion}.${hostnameSuffix}`,
|
|
267
|
-
signingRegion,
|
|
268
|
-
signingService: service
|
|
269
|
-
};
|
|
270
|
-
}, "getEndpointFromObjectLambdaArn");
|
|
271
|
-
var getEndpointFromMRAPArn = /* @__PURE__ */ __name(({
|
|
272
|
-
disableMultiregionAccessPoints,
|
|
273
|
-
dualstackEndpoint = false,
|
|
274
|
-
isCustomEndpoint,
|
|
275
|
-
mrapAlias,
|
|
276
|
-
hostnameSuffix
|
|
277
|
-
}) => {
|
|
278
|
-
if (disableMultiregionAccessPoints === true) {
|
|
279
|
-
throw new Error("SDK is attempting to use a MRAP ARN. Please enable to feature.");
|
|
280
|
-
}
|
|
281
|
-
validateMrapAlias(mrapAlias);
|
|
282
|
-
return {
|
|
283
|
-
bucketEndpoint: true,
|
|
284
|
-
hostname: `${mrapAlias}${isCustomEndpoint ? "" : `.accesspoint.s3-global`}.${hostnameSuffix}`,
|
|
285
|
-
signingRegion: "*"
|
|
286
|
-
};
|
|
287
|
-
}, "getEndpointFromMRAPArn");
|
|
288
|
-
var getEndpointFromOutpostArn = /* @__PURE__ */ __name(({
|
|
289
|
-
useArnRegion,
|
|
290
|
-
clientRegion,
|
|
291
|
-
clientSigningRegion = clientRegion,
|
|
292
|
-
bucketName,
|
|
293
|
-
outpostId,
|
|
294
|
-
dualstackEndpoint = false,
|
|
295
|
-
fipsEndpoint = false,
|
|
296
|
-
tlsCompatible = true,
|
|
297
|
-
accesspointName,
|
|
298
|
-
isCustomEndpoint,
|
|
299
|
-
hostnameSuffix
|
|
300
|
-
}) => {
|
|
301
|
-
validateRegionalClient(clientRegion);
|
|
302
|
-
const DNSHostLabel = `${accesspointName}-${bucketName.accountId}`;
|
|
303
|
-
validateDNSHostLabel(DNSHostLabel, { tlsCompatible });
|
|
304
|
-
const endpointRegion = useArnRegion ? bucketName.region : clientRegion;
|
|
305
|
-
const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion;
|
|
306
|
-
validateOutpostService(bucketName.service);
|
|
307
|
-
validateDNSHostLabel(outpostId, { tlsCompatible });
|
|
308
|
-
validateNoFIPS(fipsEndpoint);
|
|
309
|
-
const hostnamePrefix = `${DNSHostLabel}.${outpostId}`;
|
|
310
|
-
return {
|
|
311
|
-
bucketEndpoint: true,
|
|
312
|
-
hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-outposts.${endpointRegion}`}.${hostnameSuffix}`,
|
|
313
|
-
signingRegion,
|
|
314
|
-
signingService: "s3-outposts"
|
|
315
|
-
};
|
|
316
|
-
}, "getEndpointFromOutpostArn");
|
|
317
|
-
var getEndpointFromAccessPointArn = /* @__PURE__ */ __name(({
|
|
318
|
-
useArnRegion,
|
|
319
|
-
clientRegion,
|
|
320
|
-
clientSigningRegion = clientRegion,
|
|
321
|
-
bucketName,
|
|
322
|
-
dualstackEndpoint = false,
|
|
323
|
-
fipsEndpoint = false,
|
|
324
|
-
tlsCompatible = true,
|
|
325
|
-
accesspointName,
|
|
326
|
-
isCustomEndpoint,
|
|
327
|
-
hostnameSuffix
|
|
328
|
-
}) => {
|
|
329
|
-
validateRegionalClient(clientRegion);
|
|
330
|
-
const hostnamePrefix = `${accesspointName}-${bucketName.accountId}`;
|
|
331
|
-
validateDNSHostLabel(hostnamePrefix, { tlsCompatible });
|
|
332
|
-
const endpointRegion = useArnRegion ? bucketName.region : clientRegion;
|
|
333
|
-
const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion;
|
|
334
|
-
validateS3Service(bucketName.service);
|
|
335
|
-
return {
|
|
336
|
-
bucketEndpoint: true,
|
|
337
|
-
hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-accesspoint${fipsEndpoint ? "-fips" : ""}${dualstackEndpoint ? ".dualstack" : ""}.${endpointRegion}`}.${hostnameSuffix}`,
|
|
338
|
-
signingRegion
|
|
339
|
-
};
|
|
340
|
-
}, "getEndpointFromAccessPointArn");
|
|
341
|
-
|
|
342
|
-
// src/bucketEndpointMiddleware.ts
|
|
343
|
-
var bucketEndpointMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
|
|
344
|
-
const { Bucket: bucketName } = args.input;
|
|
345
|
-
let replaceBucketInPath = options.bucketEndpoint;
|
|
346
|
-
const request = args.request;
|
|
347
|
-
if (import_protocol_http.HttpRequest.isInstance(request)) {
|
|
348
|
-
if (options.bucketEndpoint) {
|
|
349
|
-
request.hostname = bucketName;
|
|
350
|
-
} else if ((0, import_util_arn_parser.validate)(bucketName)) {
|
|
351
|
-
const bucketArn = (0, import_util_arn_parser.parse)(bucketName);
|
|
352
|
-
const clientRegion = await options.region();
|
|
353
|
-
const useDualstackEndpoint = await options.useDualstackEndpoint();
|
|
354
|
-
const useFipsEndpoint = await options.useFipsEndpoint();
|
|
355
|
-
const { partition, signingRegion = clientRegion } = await options.regionInfoProvider(clientRegion, { useDualstackEndpoint, useFipsEndpoint }) || {};
|
|
356
|
-
const useArnRegion = await options.useArnRegion();
|
|
357
|
-
const {
|
|
358
|
-
hostname,
|
|
359
|
-
bucketEndpoint,
|
|
360
|
-
signingRegion: modifiedSigningRegion,
|
|
361
|
-
signingService
|
|
362
|
-
} = bucketHostname({
|
|
363
|
-
bucketName: bucketArn,
|
|
364
|
-
baseHostname: request.hostname,
|
|
365
|
-
accelerateEndpoint: options.useAccelerateEndpoint,
|
|
366
|
-
dualstackEndpoint: useDualstackEndpoint,
|
|
367
|
-
fipsEndpoint: useFipsEndpoint,
|
|
368
|
-
pathStyleEndpoint: options.forcePathStyle,
|
|
369
|
-
tlsCompatible: request.protocol === "https:",
|
|
370
|
-
useArnRegion,
|
|
371
|
-
clientPartition: partition,
|
|
372
|
-
clientSigningRegion: signingRegion,
|
|
373
|
-
clientRegion,
|
|
374
|
-
isCustomEndpoint: options.isCustomEndpoint,
|
|
375
|
-
disableMultiregionAccessPoints: await options.disableMultiregionAccessPoints()
|
|
376
|
-
});
|
|
377
|
-
if (modifiedSigningRegion && modifiedSigningRegion !== signingRegion) {
|
|
378
|
-
context["signing_region"] = modifiedSigningRegion;
|
|
379
|
-
}
|
|
380
|
-
if (signingService && signingService !== "s3") {
|
|
381
|
-
context["signing_service"] = signingService;
|
|
382
|
-
}
|
|
383
|
-
request.hostname = hostname;
|
|
384
|
-
replaceBucketInPath = bucketEndpoint;
|
|
385
|
-
} else {
|
|
386
|
-
const clientRegion = await options.region();
|
|
387
|
-
const dualstackEndpoint = await options.useDualstackEndpoint();
|
|
388
|
-
const fipsEndpoint = await options.useFipsEndpoint();
|
|
389
|
-
const { hostname, bucketEndpoint } = bucketHostname({
|
|
390
|
-
bucketName,
|
|
391
|
-
clientRegion,
|
|
392
|
-
baseHostname: request.hostname,
|
|
393
|
-
accelerateEndpoint: options.useAccelerateEndpoint,
|
|
394
|
-
dualstackEndpoint,
|
|
395
|
-
fipsEndpoint,
|
|
396
|
-
pathStyleEndpoint: options.forcePathStyle,
|
|
397
|
-
tlsCompatible: request.protocol === "https:",
|
|
398
|
-
isCustomEndpoint: options.isCustomEndpoint
|
|
399
|
-
});
|
|
400
|
-
request.hostname = hostname;
|
|
401
|
-
replaceBucketInPath = bucketEndpoint;
|
|
161
|
+
};
|
|
162
|
+
const getEndpointFromArn = (options) => {
|
|
163
|
+
const { isCustomEndpoint, baseHostname, clientRegion } = options;
|
|
164
|
+
const hostnameSuffix = isCustomEndpoint ? baseHostname : getSuffixForArnEndpoint(baseHostname)[1];
|
|
165
|
+
const { pathStyleEndpoint, accelerateEndpoint = false, fipsEndpoint = false, tlsCompatible = true, bucketName, clientPartition = "aws", } = options;
|
|
166
|
+
validateArnEndpointOptions({ pathStyleEndpoint, accelerateEndpoint, tlsCompatible });
|
|
167
|
+
const { service, partition, accountId, region, resource } = bucketName;
|
|
168
|
+
validateService(service);
|
|
169
|
+
validatePartition(partition, { clientPartition });
|
|
170
|
+
validateAccountId(accountId);
|
|
171
|
+
const { accesspointName, outpostId } = getArnResources(resource);
|
|
172
|
+
if (service === "s3-object-lambda") {
|
|
173
|
+
return getEndpointFromObjectLambdaArn({ ...options, tlsCompatible, bucketName, accesspointName, hostnameSuffix });
|
|
402
174
|
}
|
|
403
|
-
if (
|
|
404
|
-
|
|
405
|
-
if (request.path === "") {
|
|
406
|
-
request.path = "/";
|
|
407
|
-
}
|
|
175
|
+
if (region === "") {
|
|
176
|
+
return getEndpointFromMRAPArn({ ...options, mrapAlias: accesspointName, hostnameSuffix });
|
|
408
177
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
178
|
+
if (outpostId) {
|
|
179
|
+
return getEndpointFromOutpostArn({ ...options, clientRegion, outpostId, accesspointName, hostnameSuffix });
|
|
180
|
+
}
|
|
181
|
+
return getEndpointFromAccessPointArn({ ...options, clientRegion, accesspointName, hostnameSuffix });
|
|
182
|
+
};
|
|
183
|
+
const getEndpointFromObjectLambdaArn = ({ dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, useArnRegion, clientRegion, clientSigningRegion = clientRegion, accesspointName, bucketName, hostnameSuffix, }) => {
|
|
184
|
+
const { accountId, region, service } = bucketName;
|
|
185
|
+
validateRegionalClient(clientRegion);
|
|
186
|
+
const DNSHostLabel = `${accesspointName}-${accountId}`;
|
|
187
|
+
validateDNSHostLabel(DNSHostLabel, { tlsCompatible });
|
|
188
|
+
const endpointRegion = useArnRegion ? region : clientRegion;
|
|
189
|
+
const signingRegion = useArnRegion ? region : clientSigningRegion;
|
|
190
|
+
return {
|
|
191
|
+
bucketEndpoint: true,
|
|
192
|
+
hostname: `${DNSHostLabel}.${service}${fipsEndpoint ? "-fips" : ""}.${endpointRegion}.${hostnameSuffix}`,
|
|
193
|
+
signingRegion,
|
|
194
|
+
signingService: service,
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
const getEndpointFromMRAPArn = ({ disableMultiregionAccessPoints, dualstackEndpoint = false, isCustomEndpoint, mrapAlias, hostnameSuffix, }) => {
|
|
198
|
+
if (disableMultiregionAccessPoints === true) {
|
|
199
|
+
throw new Error("SDK is attempting to use a MRAP ARN. Please enable to feature.");
|
|
200
|
+
}
|
|
201
|
+
validateMrapAlias(mrapAlias);
|
|
202
|
+
return {
|
|
203
|
+
bucketEndpoint: true,
|
|
204
|
+
hostname: `${mrapAlias}${isCustomEndpoint ? "" : `.accesspoint.s3-global`}.${hostnameSuffix}`,
|
|
205
|
+
signingRegion: "*",
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
const getEndpointFromOutpostArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, outpostId, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix, }) => {
|
|
209
|
+
validateRegionalClient(clientRegion);
|
|
210
|
+
const DNSHostLabel = `${accesspointName}-${bucketName.accountId}`;
|
|
211
|
+
validateDNSHostLabel(DNSHostLabel, { tlsCompatible });
|
|
212
|
+
const endpointRegion = useArnRegion ? bucketName.region : clientRegion;
|
|
213
|
+
const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion;
|
|
214
|
+
validateOutpostService(bucketName.service);
|
|
215
|
+
validateDNSHostLabel(outpostId, { tlsCompatible });
|
|
216
|
+
validateNoFIPS(fipsEndpoint);
|
|
217
|
+
const hostnamePrefix = `${DNSHostLabel}.${outpostId}`;
|
|
218
|
+
return {
|
|
219
|
+
bucketEndpoint: true,
|
|
220
|
+
hostname: `${hostnamePrefix}${isCustomEndpoint ? "" : `.s3-outposts.${endpointRegion}`}.${hostnameSuffix}`,
|
|
221
|
+
signingRegion,
|
|
222
|
+
signingService: "s3-outposts",
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
const getEndpointFromAccessPointArn = ({ useArnRegion, clientRegion, clientSigningRegion = clientRegion, bucketName, dualstackEndpoint = false, fipsEndpoint = false, tlsCompatible = true, accesspointName, isCustomEndpoint, hostnameSuffix, }) => {
|
|
226
|
+
validateRegionalClient(clientRegion);
|
|
227
|
+
const hostnamePrefix = `${accesspointName}-${bucketName.accountId}`;
|
|
228
|
+
validateDNSHostLabel(hostnamePrefix, { tlsCompatible });
|
|
229
|
+
const endpointRegion = useArnRegion ? bucketName.region : clientRegion;
|
|
230
|
+
const signingRegion = useArnRegion ? bucketName.region : clientSigningRegion;
|
|
231
|
+
validateS3Service(bucketName.service);
|
|
232
|
+
return {
|
|
233
|
+
bucketEndpoint: true,
|
|
234
|
+
hostname: `${hostnamePrefix}${isCustomEndpoint
|
|
235
|
+
? ""
|
|
236
|
+
: `.s3-accesspoint${fipsEndpoint ? "-fips" : ""}${dualstackEndpoint ? ".dualstack" : ""}.${endpointRegion}`}.${hostnameSuffix}`,
|
|
237
|
+
signingRegion,
|
|
238
|
+
};
|
|
418
239
|
};
|
|
419
|
-
var getBucketEndpointPlugin = /* @__PURE__ */ __name((options) => ({
|
|
420
|
-
applyToStack: /* @__PURE__ */ __name((clientStack) => {
|
|
421
|
-
clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
|
|
422
|
-
}, "applyToStack")
|
|
423
|
-
}), "getBucketEndpointPlugin");
|
|
424
240
|
|
|
425
|
-
|
|
241
|
+
const bucketEndpointMiddleware = (options) => (next, context) => async (args) => {
|
|
242
|
+
const { Bucket: bucketName } = args.input;
|
|
243
|
+
let replaceBucketInPath = options.bucketEndpoint;
|
|
244
|
+
const request = args.request;
|
|
245
|
+
if (protocolHttp.HttpRequest.isInstance(request)) {
|
|
246
|
+
if (options.bucketEndpoint) {
|
|
247
|
+
request.hostname = bucketName;
|
|
248
|
+
}
|
|
249
|
+
else if (utilArnParser.validate(bucketName)) {
|
|
250
|
+
const bucketArn = utilArnParser.parse(bucketName);
|
|
251
|
+
const clientRegion = await options.region();
|
|
252
|
+
const useDualstackEndpoint = await options.useDualstackEndpoint();
|
|
253
|
+
const useFipsEndpoint = await options.useFipsEndpoint();
|
|
254
|
+
const { partition, signingRegion = clientRegion } = (await options.regionInfoProvider(clientRegion, { useDualstackEndpoint, useFipsEndpoint })) || {};
|
|
255
|
+
const useArnRegion = await options.useArnRegion();
|
|
256
|
+
const { hostname, bucketEndpoint, signingRegion: modifiedSigningRegion, signingService, } = bucketHostname({
|
|
257
|
+
bucketName: bucketArn,
|
|
258
|
+
baseHostname: request.hostname,
|
|
259
|
+
accelerateEndpoint: options.useAccelerateEndpoint,
|
|
260
|
+
dualstackEndpoint: useDualstackEndpoint,
|
|
261
|
+
fipsEndpoint: useFipsEndpoint,
|
|
262
|
+
pathStyleEndpoint: options.forcePathStyle,
|
|
263
|
+
tlsCompatible: request.protocol === "https:",
|
|
264
|
+
useArnRegion,
|
|
265
|
+
clientPartition: partition,
|
|
266
|
+
clientSigningRegion: signingRegion,
|
|
267
|
+
clientRegion: clientRegion,
|
|
268
|
+
isCustomEndpoint: options.isCustomEndpoint,
|
|
269
|
+
disableMultiregionAccessPoints: await options.disableMultiregionAccessPoints(),
|
|
270
|
+
});
|
|
271
|
+
if (modifiedSigningRegion && modifiedSigningRegion !== signingRegion) {
|
|
272
|
+
context["signing_region"] = modifiedSigningRegion;
|
|
273
|
+
}
|
|
274
|
+
if (signingService && signingService !== "s3") {
|
|
275
|
+
context["signing_service"] = signingService;
|
|
276
|
+
}
|
|
277
|
+
request.hostname = hostname;
|
|
278
|
+
replaceBucketInPath = bucketEndpoint;
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
const clientRegion = await options.region();
|
|
282
|
+
const dualstackEndpoint = await options.useDualstackEndpoint();
|
|
283
|
+
const fipsEndpoint = await options.useFipsEndpoint();
|
|
284
|
+
const { hostname, bucketEndpoint } = bucketHostname({
|
|
285
|
+
bucketName,
|
|
286
|
+
clientRegion,
|
|
287
|
+
baseHostname: request.hostname,
|
|
288
|
+
accelerateEndpoint: options.useAccelerateEndpoint,
|
|
289
|
+
dualstackEndpoint,
|
|
290
|
+
fipsEndpoint,
|
|
291
|
+
pathStyleEndpoint: options.forcePathStyle,
|
|
292
|
+
tlsCompatible: request.protocol === "https:",
|
|
293
|
+
isCustomEndpoint: options.isCustomEndpoint,
|
|
294
|
+
});
|
|
295
|
+
request.hostname = hostname;
|
|
296
|
+
replaceBucketInPath = bucketEndpoint;
|
|
297
|
+
}
|
|
298
|
+
if (replaceBucketInPath) {
|
|
299
|
+
request.path = request.path.replace(/^(\/)?[^\/]+/, "");
|
|
300
|
+
if (request.path === "") {
|
|
301
|
+
request.path = "/";
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return next({ ...args, request });
|
|
306
|
+
};
|
|
307
|
+
const bucketEndpointMiddlewareOptions = {
|
|
308
|
+
tags: ["BUCKET_ENDPOINT"],
|
|
309
|
+
name: "bucketEndpointMiddleware",
|
|
310
|
+
relation: "before",
|
|
311
|
+
toMiddleware: "hostHeaderMiddleware",
|
|
312
|
+
override: true,
|
|
313
|
+
};
|
|
314
|
+
const getBucketEndpointPlugin = (options) => ({
|
|
315
|
+
applyToStack: (clientStack) => {
|
|
316
|
+
clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
|
|
317
|
+
},
|
|
318
|
+
});
|
|
319
|
+
|
|
426
320
|
function resolveBucketEndpointConfig(input) {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
forcePathStyle,
|
|
438
|
-
useAccelerateEndpoint,
|
|
439
|
-
useArnRegion: typeof useArnRegion === "function" ? useArnRegion : () => Promise.resolve(useArnRegion),
|
|
440
|
-
disableMultiregionAccessPoints: typeof disableMultiregionAccessPoints === "function" ? disableMultiregionAccessPoints : () => Promise.resolve(disableMultiregionAccessPoints)
|
|
441
|
-
});
|
|
321
|
+
const { bucketEndpoint = false, forcePathStyle = false, useAccelerateEndpoint = false, useArnRegion, disableMultiregionAccessPoints = false, } = input;
|
|
322
|
+
return Object.assign(input, {
|
|
323
|
+
bucketEndpoint,
|
|
324
|
+
forcePathStyle,
|
|
325
|
+
useAccelerateEndpoint,
|
|
326
|
+
useArnRegion: typeof useArnRegion === "function" ? useArnRegion : () => Promise.resolve(useArnRegion),
|
|
327
|
+
disableMultiregionAccessPoints: typeof disableMultiregionAccessPoints === "function"
|
|
328
|
+
? disableMultiregionAccessPoints
|
|
329
|
+
: () => Promise.resolve(disableMultiregionAccessPoints),
|
|
330
|
+
});
|
|
442
331
|
}
|
|
443
|
-
__name(resolveBucketEndpointConfig, "resolveBucketEndpointConfig");
|
|
444
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
445
|
-
|
|
446
|
-
0 && (module.exports = {
|
|
447
|
-
getArnResources,
|
|
448
|
-
getSuffixForArnEndpoint,
|
|
449
|
-
validateOutpostService,
|
|
450
|
-
validatePartition,
|
|
451
|
-
validateAccountId,
|
|
452
|
-
validateRegion,
|
|
453
|
-
validateDNSHostLabel,
|
|
454
|
-
validateNoDualstack,
|
|
455
|
-
validateNoFIPS,
|
|
456
|
-
NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME,
|
|
457
|
-
NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME,
|
|
458
|
-
NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS,
|
|
459
|
-
NODE_USE_ARN_REGION_ENV_NAME,
|
|
460
|
-
NODE_USE_ARN_REGION_INI_NAME,
|
|
461
|
-
NODE_USE_ARN_REGION_CONFIG_OPTIONS,
|
|
462
|
-
bucketEndpointMiddleware,
|
|
463
|
-
bucketEndpointMiddlewareOptions,
|
|
464
|
-
getBucketEndpointPlugin,
|
|
465
|
-
bucketHostname,
|
|
466
|
-
resolveBucketEndpointConfig
|
|
467
|
-
});
|
|
468
332
|
|
|
333
|
+
exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS = NODE_DISABLE_MULTIREGION_ACCESS_POINT_CONFIG_OPTIONS;
|
|
334
|
+
exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME = NODE_DISABLE_MULTIREGION_ACCESS_POINT_ENV_NAME;
|
|
335
|
+
exports.NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME = NODE_DISABLE_MULTIREGION_ACCESS_POINT_INI_NAME;
|
|
336
|
+
exports.NODE_USE_ARN_REGION_CONFIG_OPTIONS = NODE_USE_ARN_REGION_CONFIG_OPTIONS;
|
|
337
|
+
exports.NODE_USE_ARN_REGION_ENV_NAME = NODE_USE_ARN_REGION_ENV_NAME;
|
|
338
|
+
exports.NODE_USE_ARN_REGION_INI_NAME = NODE_USE_ARN_REGION_INI_NAME;
|
|
339
|
+
exports.bucketEndpointMiddleware = bucketEndpointMiddleware;
|
|
340
|
+
exports.bucketEndpointMiddlewareOptions = bucketEndpointMiddlewareOptions;
|
|
341
|
+
exports.bucketHostname = bucketHostname;
|
|
342
|
+
exports.getArnResources = getArnResources;
|
|
343
|
+
exports.getBucketEndpointPlugin = getBucketEndpointPlugin;
|
|
344
|
+
exports.getSuffixForArnEndpoint = getSuffixForArnEndpoint;
|
|
345
|
+
exports.resolveBucketEndpointConfig = resolveBucketEndpointConfig;
|
|
346
|
+
exports.validateAccountId = validateAccountId;
|
|
347
|
+
exports.validateDNSHostLabel = validateDNSHostLabel;
|
|
348
|
+
exports.validateNoDualstack = validateNoDualstack;
|
|
349
|
+
exports.validateNoFIPS = validateNoFIPS;
|
|
350
|
+
exports.validateOutpostService = validateOutpostService;
|
|
351
|
+
exports.validatePartition = validatePartition;
|
|
352
|
+
exports.validateRegion = validateRegion;
|