@beesolve/aws-accounts 1.0.0
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/LICENSE +21 -0
- package/README.md +189 -0
- package/dist/accountCreation.js +135 -0
- package/dist/applyLogic.js +1203 -0
- package/dist/awsClientConfig.js +26 -0
- package/dist/awsConfig.js +1365 -0
- package/dist/cli.js +201 -0
- package/dist/commands/graveyard.js +46 -0
- package/dist/commands/regenerate.js +17 -0
- package/dist/commands/remote.js +925 -0
- package/dist/diff.js +1012 -0
- package/dist/error.js +66 -0
- package/dist/helpers.js +21 -0
- package/dist/lambda/handler.js +375 -0
- package/dist/lambdaClient.js +220 -0
- package/dist/logger.js +26 -0
- package/dist/operations.js +218 -0
- package/dist/remoteStateCache.js +38 -0
- package/dist/reservedOuDeletion.js +46 -0
- package/dist/scanLogic.js +456 -0
- package/dist/state.js +618 -0
- package/dist/tags.js +14 -0
- package/dist-lambda/handler.mjs +3558 -0
- package/dist-lambda/lambda.zip +0 -0
- package/package.json +59 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { fromIni } from "@aws-sdk/credential-providers";
|
|
2
|
+
function resolveAwsProfile(props) {
|
|
3
|
+
const profile = props.profileArg ?? process.env.AWS_PROFILE;
|
|
4
|
+
if (profile !== void 0 && profile.trim() === "") {
|
|
5
|
+
throw new Error("Invalid profile: value cannot be empty.");
|
|
6
|
+
}
|
|
7
|
+
return profile;
|
|
8
|
+
}
|
|
9
|
+
function resolveAwsRegion(props) {
|
|
10
|
+
const region = props.regionArg ?? process.env.AWS_REGION ?? process.env.AWS_DEFAULT_REGION;
|
|
11
|
+
if (region !== void 0 && region.trim() === "") {
|
|
12
|
+
throw new Error("Invalid region: value cannot be empty.");
|
|
13
|
+
}
|
|
14
|
+
return region;
|
|
15
|
+
}
|
|
16
|
+
function buildAwsClientConfig(props) {
|
|
17
|
+
return {
|
|
18
|
+
region: props.region,
|
|
19
|
+
credentials: props.profile ? fromIni({ profile: props.profile }) : void 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
buildAwsClientConfig,
|
|
24
|
+
resolveAwsProfile,
|
|
25
|
+
resolveAwsRegion
|
|
26
|
+
};
|