terruvim-core-test 0.0.1
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/dist/src/core/config.js +2 -0
- package/dist/src/core/configMerge.js +266 -0
- package/dist/src/core/configUtils.js +72 -0
- package/dist/src/core/dependencyResolver.js +17 -0
- package/dist/src/core/deployUtils.js +73 -0
- package/dist/src/core/dynamicResourceManager.js +709 -0
- package/dist/src/core/entrypoint.js +56 -0
- package/dist/src/core/generateFinalConfig.js +45 -0
- package/dist/src/core/index.js +24 -0
- package/dist/src/core/resourceMap.js +99 -0
- package/dist/src/factories/accountPermissions.js +134 -0
- package/dist/src/factories/acmFactory.js +30 -0
- package/dist/src/factories/albFactory.js +331 -0
- package/dist/src/factories/attachSecretAccessPolicy.js +56 -0
- package/dist/src/factories/auroraFactory.js +619 -0
- package/dist/src/factories/backupPolicy.js +152 -0
- package/dist/src/factories/bastionFactory.js +91 -0
- package/dist/src/factories/bedrockFactory.js +334 -0
- package/dist/src/factories/budgetFactory.js +64 -0
- package/dist/src/factories/buildAlbCloudWatchAlarmsHelper.js +79 -0
- package/dist/src/factories/buildAlbCloudWatchDashboardHelper.js +106 -0
- package/dist/src/factories/buildAlbListenerRulesHelper.js +45 -0
- package/dist/src/factories/buildAlbListenersHelper.js +64 -0
- package/dist/src/factories/buildAlbResourceHelper.js +54 -0
- package/dist/src/factories/buildAlbRoute53RecordHelper.js +49 -0
- package/dist/src/factories/buildAlbTargetGroupsHelper.js +47 -0
- package/dist/src/factories/buildAlbWafAssociationHelper.js +43 -0
- package/dist/src/factories/buildAndPushDockerImage.js +57 -0
- package/dist/src/factories/buildAwsCloudWatchAlarmsHelper.js +118 -0
- package/dist/src/factories/buildCloudFrontRoute53RecordHelper.js +49 -0
- package/dist/src/factories/buildEcsClusterArgs.js +32 -0
- package/dist/src/factories/buildEcsSecrets.js +48 -0
- package/dist/src/factories/buildForceRedeployEnv.js +8 -0
- package/dist/src/factories/buildResourceOptions.js +11 -0
- package/dist/src/factories/buildS3StaticHostingCicdHelper.js +142 -0
- package/dist/src/factories/buildS3StaticHostingCloudWatchDashboardHelper.js +122 -0
- package/dist/src/factories/cloudTrailFactory.js +22 -0
- package/dist/src/factories/cloudWatchCompositeAlarmFactory.js +91 -0
- package/dist/src/factories/cloudWatchInsightsQueryFactory.js +83 -0
- package/dist/src/factories/cloudWatchLogGroupFactory.js +84 -0
- package/dist/src/factories/cloudfrontCodePipelineFactory.js +357 -0
- package/dist/src/factories/cloudwatchAlarmsFactory.js +121 -0
- package/dist/src/factories/codePipelineNotificationFactory.js +193 -0
- package/dist/src/factories/codePipelineNotificationRulesFactory.js +117 -0
- package/dist/src/factories/codeStarConnectionFactory.js +56 -0
- package/dist/src/factories/collectSecretKeys.js +18 -0
- package/dist/src/factories/comprehensiveNotificationFactory.js +250 -0
- package/dist/src/factories/costAndUsageReportFactory.js +32 -0
- package/dist/src/factories/createAwsAcmCertificate.js +40 -0
- package/dist/src/factories/createAwsBudget.js +40 -0
- package/dist/src/factories/createAwsCloudTrail.js +59 -0
- package/dist/src/factories/createAwsCloudwatchDashboard.js +59 -0
- package/dist/src/factories/createAwsEc2Instance.js +40 -0
- package/dist/src/factories/createAwsEventBridgeEventBus.js +40 -0
- package/dist/src/factories/createAwsGuardDutyDetector.js +40 -0
- package/dist/src/factories/createAwsGuardDutyDetectorFeature.js +45 -0
- package/dist/src/factories/createAwsGuardDutyFilter.js +46 -0
- package/dist/src/factories/createAwsGuardDutyPublishingDestination.js +50 -0
- package/dist/src/factories/createAwsHostedZone.js +40 -0
- package/dist/src/factories/createAwsIamRole.js +49 -0
- package/dist/src/factories/createAwsIamRoleInlinePolicies.js +48 -0
- package/dist/src/factories/createAwsIdentitystoreGroup.js +44 -0
- package/dist/src/factories/createAwsIdentitystoreGroupMembership.js +56 -0
- package/dist/src/factories/createAwsIdentitystoreUser.js +47 -0
- package/dist/src/factories/createAwsInspectorAssessmentTarget.js +47 -0
- package/dist/src/factories/createAwsInspectorDelegatedAdminAccount.js +47 -0
- package/dist/src/factories/createAwsInspectorEnabler.js +49 -0
- package/dist/src/factories/createAwsInspectorOrganizationConfiguration.js +55 -0
- package/dist/src/factories/createAwsKmsAliases.js +47 -0
- package/dist/src/factories/createAwsKmsKey.js +51 -0
- package/dist/src/factories/createAwsMacieAccount.js +45 -0
- package/dist/src/factories/createAwsMacieClassificationJob.js +53 -0
- package/dist/src/factories/createAwsMacieMember.js +49 -0
- package/dist/src/factories/createAwsMacieOrganizationConfiguration.js +44 -0
- package/dist/src/factories/createAwsRdsCluster.js +40 -0
- package/dist/src/factories/createAwsRdsClusterInstance.js +40 -0
- package/dist/src/factories/createAwsRdsInstance.js +40 -0
- package/dist/src/factories/createAwsRdsSubnetGroup.js +40 -0
- package/dist/src/factories/createAwsRoute53Record.js +40 -0
- package/dist/src/factories/createAwsSecret.js +40 -0
- package/dist/src/factories/createAwsSecretRotation.js +40 -0
- package/dist/src/factories/createAwsSecretVersion.js +40 -0
- package/dist/src/factories/createAwsSecurityGroup.js +40 -0
- package/dist/src/factories/createAwsSecurityGroupRule.js +40 -0
- package/dist/src/factories/createAwsSecurityHubAccount.js +40 -0
- package/dist/src/factories/createAwsSecurityHubAutomationRule.js +48 -0
- package/dist/src/factories/createAwsSecurityHubStandardsControl.js +44 -0
- package/dist/src/factories/createAwsSecurityHubStandardsSubscription.js +42 -0
- package/dist/src/factories/createAwsSesDomainDkim.js +40 -0
- package/dist/src/factories/createAwsSesDomainIdentity.js +40 -0
- package/dist/src/factories/createAwsSesEmailIdentity.js +40 -0
- package/dist/src/factories/createAwsSnsSubscription.js +62 -0
- package/dist/src/factories/createAwsSnsTopic.js +41 -0
- package/dist/src/factories/createAwsSqsQueue.js +40 -0
- package/dist/src/factories/createAwsSsmParameters.js +66 -0
- package/dist/src/factories/createAwsSsoAccountAssignment.js +66 -0
- package/dist/src/factories/createAwsSsoPermissionSet.js +64 -0
- package/dist/src/factories/createAwsStepFunctionsStateMachine.js +40 -0
- package/dist/src/factories/createBudget.js +56 -0
- package/dist/src/factories/createBudgetWithSnsAlert.js +79 -0
- package/dist/src/factories/createCostAndUsageReport.js +40 -0
- package/dist/src/factories/createEcrRepo.js +69 -0
- package/dist/src/factories/createEcsRolesAndPolicies.js +84 -0
- package/dist/src/factories/createEcsService.js +71 -0
- package/dist/src/factories/createEnvSecret.js +60 -0
- package/dist/src/factories/createGithubCodeStarConnection.js +44 -0
- package/dist/src/factories/createIamUserWithAccessKey.js +44 -0
- package/dist/src/factories/createLambdaFunction.js +89 -0
- package/dist/src/factories/createLambdaPermission.js +57 -0
- package/dist/src/factories/createListenerRule.js +68 -0
- package/dist/src/factories/createLogGroup.js +44 -0
- package/dist/src/factories/createSlackChannelConfiguration.js +49 -0
- package/dist/src/factories/createTargetGroup.js +50 -0
- package/dist/src/factories/createTaskDefinition.js +49 -0
- package/dist/src/factories/createVpcEndpoint.js +49 -0
- package/dist/src/factories/dashboardFactory.js +94 -0
- package/dist/src/factories/dataProtectionPolicyBuilder.js +103 -0
- package/dist/src/factories/ec2Factory.js +67 -0
- package/dist/src/factories/ecsClusterFactory.js +90 -0
- package/dist/src/factories/ecsCodePipelineFactory.js +308 -0
- package/dist/src/factories/ecsServiceFactory.js +350 -0
- package/dist/src/factories/enhancedCloudFrontCodePipelineFactory.js +205 -0
- package/dist/src/factories/enhancedEcsCodePipelineFactory.js +189 -0
- package/dist/src/factories/eventBridgeBusFactory.js +84 -0
- package/dist/src/factories/eventBridgeFactory.js +26 -0
- package/dist/src/factories/eventBridgeRuleFactory.js +114 -0
- package/dist/src/factories/fetchAllSecrets.js +51 -0
- package/dist/src/factories/getDeterministicPriority.js +13 -0
- package/dist/src/factories/getOrCreateSshKeyPair.js +57 -0
- package/dist/src/factories/guardDutyFactory.js +151 -0
- package/dist/src/factories/hostedZoneFactory.js +30 -0
- package/dist/src/factories/iamRoleFactory.js +29 -0
- package/dist/src/factories/inspectorFactory.js +109 -0
- package/dist/src/factories/kmsKeyFactory.js +32 -0
- package/dist/src/factories/lambdaFactory.js +133 -0
- package/dist/src/factories/lambdaPermissionFactory.js +32 -0
- package/dist/src/factories/logDataProtectionPolicyFactory.js +81 -0
- package/dist/src/factories/macieFactory.js +85 -0
- package/dist/src/factories/networkingFactory.js +429 -0
- package/dist/src/factories/opensearchCollectionFactory.js +109 -0
- package/dist/src/factories/organizationFactory.js +221 -0
- package/dist/src/factories/processReservedInstances.js +6 -0
- package/dist/src/factories/processSavingsPlans.js +43 -0
- package/dist/src/factories/rdsFactory.js +40 -0
- package/dist/src/factories/recordFactory.js +36 -0
- package/dist/src/factories/resolveEnvSecrets.js +14 -0
- package/dist/src/factories/resourceFactory.js +12 -0
- package/dist/src/factories/s3Factory.js +262 -0
- package/dist/src/factories/s3StaticHostingFactory.backup.js +424 -0
- package/dist/src/factories/s3StaticHostingFactory.js +348 -0
- package/dist/src/factories/s3StaticHostingFactory.refactored.js +334 -0
- package/dist/src/factories/savingsPlanFactory.js +26 -0
- package/dist/src/factories/secretsManagerFactory.js +107 -0
- package/dist/src/factories/securityGroupFactory.js +28 -0
- package/dist/src/factories/securityGroupRuleFactory.js +43 -0
- package/dist/src/factories/securityHubFactory.js +96 -0
- package/dist/src/factories/sesDomainDkimFactory.js +25 -0
- package/dist/src/factories/sesFactory.js +25 -0
- package/dist/src/factories/sesIdentitiesFactory.js +134 -0
- package/dist/src/factories/simpleNotificationFactory.js +112 -0
- package/dist/src/factories/smtpUserFactory.js +108 -0
- package/dist/src/factories/snsFactory.js +87 -0
- package/dist/src/factories/sqsFactory.js +41 -0
- package/dist/src/factories/ssmParameterFactory.js +67 -0
- package/dist/src/factories/ssoFactory.js +32 -0
- package/dist/src/factories/ssoGroupFactory.js +41 -0
- package/dist/src/factories/ssoPermissionSetFactory.js +29 -0
- package/dist/src/factories/ssoUserFactory.js +30 -0
- package/dist/src/factories/stepFunctionsFactory.js +32 -0
- package/dist/src/factories/tagPolicies.js +99 -0
- package/dist/src/factories/transformBudgetCostFilters.js +8 -0
- package/dist/src/factories/transformBudgetNotifications.js +12 -0
- package/dist/src/factories/transformBudgetPlannedLimits.js +8 -0
- package/dist/src/factories/types.js +2 -0
- package/dist/src/factories/validateAcmConfig.js +26 -0
- package/dist/src/factories/validateAuroraConfig.js +8 -0
- package/dist/src/factories/validateBedrockConfig.js +124 -0
- package/dist/src/factories/validateDashboardConfig.js +28 -0
- package/dist/src/factories/validateEventBridgeConfig.js +14 -0
- package/dist/src/factories/validateHostedZoneConfig.js +26 -0
- package/dist/src/factories/validateIamRoleConfig.js +8 -0
- package/dist/src/factories/validateKmsKeyConfig.js +8 -0
- package/dist/src/factories/validateRdsConfig.js +17 -0
- package/dist/src/factories/validateRoute53RecordConfig.js +41 -0
- package/dist/src/factories/validateS3Config.js +8 -0
- package/dist/src/factories/validateSecretsManagerConfig.js +8 -0
- package/dist/src/factories/validateSecurityGroupConfig.js +8 -0
- package/dist/src/factories/validateSecurityGroupRuleConfig.js +8 -0
- package/dist/src/factories/validateSesDomainDkimConfig.js +8 -0
- package/dist/src/factories/validateSesDomainIdentityConfig.js +8 -0
- package/dist/src/factories/validateSesIdentitiesConfig.js +40 -0
- package/dist/src/factories/validateSnsConfig.js +11 -0
- package/dist/src/factories/validateSqsConfig.js +11 -0
- package/dist/src/factories/validateSsmParameterFactoryConfig.js +9 -0
- package/dist/src/factories/validateStepFunctionsConfig.js +8 -0
- package/dist/src/factories/vpcEndpointFactory.js +98 -0
- package/dist/src/factories/wafFactory.js +499 -0
- package/package.json +71 -0
- package/scripts/copy-assets.js +136 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SmtpUserFactory = void 0;
|
|
37
|
+
const aws = __importStar(require("@pulumi/aws"));
|
|
38
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
39
|
+
const createIamUserWithAccessKey_1 = require("./createIamUserWithAccessKey");
|
|
40
|
+
class SmtpUserFactory extends resourceFactory_1.ResourceFactory {
|
|
41
|
+
accessKey;
|
|
42
|
+
currentConfig;
|
|
43
|
+
validateConfig(config) {
|
|
44
|
+
if (!config.configuration?.userName) {
|
|
45
|
+
throw new Error("userName is required");
|
|
46
|
+
}
|
|
47
|
+
if (!config.configuration?.sesRegion) {
|
|
48
|
+
throw new Error("sesRegion is required");
|
|
49
|
+
}
|
|
50
|
+
if (!config.configuration?.permissions?.sesActions?.length) {
|
|
51
|
+
throw new Error("permissions.sesActions is required");
|
|
52
|
+
}
|
|
53
|
+
if (!config.configuration?.permissions?.sesResources?.length) {
|
|
54
|
+
throw new Error("permissions.sesResources is required");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async createResource(config) {
|
|
58
|
+
this.validateConfig(config);
|
|
59
|
+
this.currentConfig = config;
|
|
60
|
+
const cfg = config.configuration;
|
|
61
|
+
const { user, accessKey } = (0, createIamUserWithAccessKey_1.createIamUserWithAccessKey)({
|
|
62
|
+
name: cfg.userName
|
|
63
|
+
});
|
|
64
|
+
this.accessKey = accessKey;
|
|
65
|
+
const policy = new aws.iam.UserPolicy(`${cfg.userName}-ses-policy`, {
|
|
66
|
+
name: `${cfg.userName}-ses-policy`,
|
|
67
|
+
user: user.name,
|
|
68
|
+
policy: JSON.stringify({
|
|
69
|
+
Version: "2012-10-17",
|
|
70
|
+
Statement: [{
|
|
71
|
+
Effect: "Allow",
|
|
72
|
+
Action: cfg.permissions.sesActions,
|
|
73
|
+
Resource: cfg.permissions.sesResources
|
|
74
|
+
}]
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
return user;
|
|
78
|
+
}
|
|
79
|
+
generateSmtpPassword(secretAccessKey, region) {
|
|
80
|
+
return secretAccessKey.apply(secret => {
|
|
81
|
+
const crypto = require("crypto");
|
|
82
|
+
const version = Buffer.from([0x04]);
|
|
83
|
+
const message = Buffer.from("SendRawEmail", "utf8");
|
|
84
|
+
const hmac = crypto.createHmac("sha256", secret);
|
|
85
|
+
hmac.update(message);
|
|
86
|
+
const signature = hmac.digest();
|
|
87
|
+
const smtpPassword = Buffer.concat([version, signature]).toString("base64");
|
|
88
|
+
return smtpPassword;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getOutputs(resource) {
|
|
92
|
+
if (!this.accessKey) {
|
|
93
|
+
throw new Error("Access key not created. Set createAccessKey to true.");
|
|
94
|
+
}
|
|
95
|
+
if (!this.currentConfig) {
|
|
96
|
+
throw new Error("Configuration not available.");
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
userArn: resource.arn,
|
|
100
|
+
userName: resource.name,
|
|
101
|
+
accessKeyId: this.accessKey.id,
|
|
102
|
+
secretAccessKey: this.accessKey.secret,
|
|
103
|
+
smtpPassword: this.generateSmtpPassword(this.accessKey.secret, this.currentConfig.configuration.sesRegion),
|
|
104
|
+
smtpUsername: this.accessKey.id
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.SmtpUserFactory = SmtpUserFactory;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SnsFactory = void 0;
|
|
37
|
+
const aws = __importStar(require("@pulumi/aws"));
|
|
38
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
39
|
+
const validateSnsConfig_1 = require("./validateSnsConfig");
|
|
40
|
+
const createAwsSnsTopic_1 = require("./createAwsSnsTopic");
|
|
41
|
+
class SnsFactory extends resourceFactory_1.ResourceFactory {
|
|
42
|
+
async createResource(config) {
|
|
43
|
+
(0, validateSnsConfig_1.validateSnsConfig)(config);
|
|
44
|
+
const topic = (0, createAwsSnsTopic_1.createAwsSnsTopic)(config.configuration.name, {
|
|
45
|
+
name: config.configuration.name,
|
|
46
|
+
displayName: config.configuration.displayName,
|
|
47
|
+
fifoTopic: config.configuration.fifoTopic,
|
|
48
|
+
contentBasedDeduplication: config.configuration.contentBasedDeduplication,
|
|
49
|
+
kmsMasterKeyId: config.configuration.kmsMasterKeyId,
|
|
50
|
+
deliveryPolicy: config.configuration.deliveryPolicy ? JSON.stringify(config.configuration.deliveryPolicy) : undefined,
|
|
51
|
+
policy: config.configuration.policy ? JSON.stringify(config.configuration.policy) : undefined,
|
|
52
|
+
tags: config.configuration.tags,
|
|
53
|
+
signatureVersion: config.configuration.signatureVersion,
|
|
54
|
+
applicationSuccessFeedbackRoleArn: config.configuration.applicationSuccessFeedbackRoleArn,
|
|
55
|
+
applicationSuccessFeedbackSampleRate: config.configuration.applicationSuccessFeedbackSampleRate,
|
|
56
|
+
applicationFailureFeedbackRoleArn: config.configuration.applicationFailureFeedbackRoleArn,
|
|
57
|
+
httpSuccessFeedbackRoleArn: config.configuration.httpSuccessFeedbackRoleArn,
|
|
58
|
+
httpSuccessFeedbackSampleRate: config.configuration.httpSuccessFeedbackSampleRate,
|
|
59
|
+
httpFailureFeedbackRoleArn: config.configuration.httpFailureFeedbackRoleArn,
|
|
60
|
+
lambdaSuccessFeedbackRoleArn: config.configuration.lambdaSuccessFeedbackRoleArn,
|
|
61
|
+
lambdaSuccessFeedbackSampleRate: config.configuration.lambdaSuccessFeedbackSampleRate,
|
|
62
|
+
lambdaFailureFeedbackRoleArn: config.configuration.lambdaFailureFeedbackRoleArn,
|
|
63
|
+
sqsSuccessFeedbackRoleArn: config.configuration.sqsSuccessFeedbackRoleArn,
|
|
64
|
+
sqsSuccessFeedbackSampleRate: config.configuration.sqsSuccessFeedbackSampleRate,
|
|
65
|
+
sqsFailureFeedbackRoleArn: config.configuration.sqsFailureFeedbackRoleArn,
|
|
66
|
+
tracingConfig: config.configuration.tracingConfig,
|
|
67
|
+
});
|
|
68
|
+
if (config.configuration.email) {
|
|
69
|
+
new aws.sns.TopicSubscription(`${config.configuration.name}-email-subscription`, {
|
|
70
|
+
topic: topic.arn,
|
|
71
|
+
protocol: "email",
|
|
72
|
+
endpoint: config.configuration.email,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return topic;
|
|
76
|
+
}
|
|
77
|
+
getOutputs(resource) {
|
|
78
|
+
return {
|
|
79
|
+
arn: resource.arn,
|
|
80
|
+
name: resource.name,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
validateConfig(config) {
|
|
84
|
+
(0, validateSnsConfig_1.validateSnsConfig)(config);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.SnsFactory = SnsFactory;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SqsFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const validateSqsConfig_1 = require("./validateSqsConfig");
|
|
6
|
+
const createAwsSqsQueue_1 = require("./createAwsSqsQueue");
|
|
7
|
+
class SqsFactory extends resourceFactory_1.ResourceFactory {
|
|
8
|
+
async createResource(config) {
|
|
9
|
+
(0, validateSqsConfig_1.validateSqsConfig)(config);
|
|
10
|
+
return (0, createAwsSqsQueue_1.createAwsSqsQueue)(config.configuration.name, {
|
|
11
|
+
name: config.configuration.name,
|
|
12
|
+
fifoQueue: config.configuration.fifoQueue,
|
|
13
|
+
contentBasedDeduplication: config.configuration.contentBasedDeduplication,
|
|
14
|
+
delaySeconds: config.configuration.delaySeconds,
|
|
15
|
+
maxMessageSize: config.configuration.maximumMessageSize,
|
|
16
|
+
messageRetentionSeconds: config.configuration.messageRetentionSeconds,
|
|
17
|
+
receiveWaitTimeSeconds: config.configuration.receiveWaitTimeSeconds,
|
|
18
|
+
visibilityTimeoutSeconds: config.configuration.visibilityTimeoutSeconds,
|
|
19
|
+
kmsMasterKeyId: config.configuration.kmsMasterKeyId,
|
|
20
|
+
kmsDataKeyReusePeriodSeconds: config.configuration.kmsDataKeyReusePeriodSeconds,
|
|
21
|
+
redrivePolicy: config.configuration.redrivePolicy,
|
|
22
|
+
policy: config.configuration.policy,
|
|
23
|
+
tags: config.configuration.tags,
|
|
24
|
+
sqsManagedSseEnabled: config.configuration.sqsManagedSseEnabled,
|
|
25
|
+
deduplicationScope: config.configuration.deduplicationScope,
|
|
26
|
+
fifoThroughputLimit: config.configuration.fifoThroughputLimit,
|
|
27
|
+
redriveAllowPolicy: config.configuration.redriveAllowPolicy,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
getOutputs(resource) {
|
|
31
|
+
return {
|
|
32
|
+
arn: resource.arn,
|
|
33
|
+
name: resource.name,
|
|
34
|
+
url: resource.url,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
validateConfig(config) {
|
|
38
|
+
(0, validateSqsConfig_1.validateSqsConfig)(config);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.SqsFactory = SqsFactory;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SSMParameterFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const validateSsmParameterFactoryConfig_1 = require("./validateSsmParameterFactoryConfig");
|
|
6
|
+
const createAwsSsmParameters_1 = require("./createAwsSsmParameters");
|
|
7
|
+
class SSMParameterFactory extends resourceFactory_1.ResourceFactory {
|
|
8
|
+
async createResource(config) {
|
|
9
|
+
function getProp(key) {
|
|
10
|
+
if (!config)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (key in config)
|
|
13
|
+
return config[key];
|
|
14
|
+
if (config.configuration && key in config.configuration)
|
|
15
|
+
return config.configuration[key];
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const configParams = getProp("parameters");
|
|
19
|
+
if (!configParams) {
|
|
20
|
+
const singleParamConfig = {
|
|
21
|
+
id: getProp("id"),
|
|
22
|
+
configuration: {
|
|
23
|
+
parameters: [{
|
|
24
|
+
name: getProp("name"),
|
|
25
|
+
type: getProp("type"),
|
|
26
|
+
value: getProp("value"),
|
|
27
|
+
description: getProp("description"),
|
|
28
|
+
keyId: getProp("keyId"),
|
|
29
|
+
overwrite: getProp("overwrite"),
|
|
30
|
+
tags: getProp("tags")
|
|
31
|
+
}],
|
|
32
|
+
tags: getProp("tags")
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
(0, validateSsmParameterFactoryConfig_1.validateSsmParameterFactoryConfig)(singleParamConfig);
|
|
36
|
+
return await (0, createAwsSsmParameters_1.createAwsSsmParameters)(singleParamConfig);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
(0, validateSsmParameterFactoryConfig_1.validateSsmParameterFactoryConfig)(config);
|
|
40
|
+
return await (0, createAwsSsmParameters_1.createAwsSsmParameters)(config);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
getOutputs(resource) {
|
|
44
|
+
return resource;
|
|
45
|
+
}
|
|
46
|
+
validateConfig(config) {
|
|
47
|
+
function getProp(key) {
|
|
48
|
+
if (!config)
|
|
49
|
+
return undefined;
|
|
50
|
+
if (key in config)
|
|
51
|
+
return config[key];
|
|
52
|
+
if (config.configuration && key in config.configuration)
|
|
53
|
+
return config.configuration[key];
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const configParams = getProp("parameters");
|
|
57
|
+
if (!configParams) {
|
|
58
|
+
if (!getProp("id") || !getProp("name") || !getProp("type") || !getProp("value")) {
|
|
59
|
+
throw new Error("SSM Parameter must have id, name, type, and value");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
(0, validateSsmParameterFactoryConfig_1.validateSsmParameterFactoryConfig)(config);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.SSMParameterFactory = SSMParameterFactory;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SSOFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const createAwsSsoAccountAssignment_1 = require("./createAwsSsoAccountAssignment");
|
|
6
|
+
class SSOFactory extends resourceFactory_1.ResourceFactory {
|
|
7
|
+
async createResource(config) {
|
|
8
|
+
if (config.hooks?.beforeCreateResources)
|
|
9
|
+
await config.hooks.beforeCreateResources(config);
|
|
10
|
+
const resources = {};
|
|
11
|
+
if (config.configuration.instances) {
|
|
12
|
+
resources.instances = config.configuration.instances.map(inst => ({
|
|
13
|
+
...inst,
|
|
14
|
+
kind: "SsoInstance"
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
if (config.configuration.assignments) {
|
|
18
|
+
resources.assignments = config.configuration.assignments.map(a => (0, createAwsSsoAccountAssignment_1.createAwsSsoAccountAssignment)(a));
|
|
19
|
+
}
|
|
20
|
+
if (config.hooks?.afterCreateResources)
|
|
21
|
+
await config.hooks.afterCreateResources(resources, config);
|
|
22
|
+
return resources;
|
|
23
|
+
}
|
|
24
|
+
getOutputs(resource) {
|
|
25
|
+
return resource;
|
|
26
|
+
}
|
|
27
|
+
validateConfig(config) {
|
|
28
|
+
if (!config.id)
|
|
29
|
+
throw new Error("SsoFactoryConfig must include id");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.SSOFactory = SSOFactory;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SsoGroupFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const createAwsIdentitystoreGroup_1 = require("./createAwsIdentitystoreGroup");
|
|
6
|
+
const createAwsIdentitystoreGroupMembership_1 = require("./createAwsIdentitystoreGroupMembership");
|
|
7
|
+
class SsoGroupFactory extends resourceFactory_1.ResourceFactory {
|
|
8
|
+
async createResource(config) {
|
|
9
|
+
if (config.hooks?.beforeCreateResources)
|
|
10
|
+
await config.hooks.beforeCreateResources(config);
|
|
11
|
+
const group = (0, createAwsIdentitystoreGroup_1.createAwsIdentitystoreGroup)(config.configuration);
|
|
12
|
+
let memberships = [];
|
|
13
|
+
if (config.configuration.members && config.configuration.members.length > 0) {
|
|
14
|
+
memberships = config.configuration.members.map((userId, idx) => group.id.apply(groupId => {
|
|
15
|
+
const groupName = config.configuration.displayName.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
16
|
+
const membershipName = `${groupName}-membership-${idx}`;
|
|
17
|
+
return (0, createAwsIdentitystoreGroupMembership_1.createAwsIdentitystoreGroupMembership)(config.configuration.identityStoreId, groupId, userId, membershipName);
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
const resources = { group, memberships };
|
|
21
|
+
if (config.hooks?.afterCreateResources)
|
|
22
|
+
await config.hooks.afterCreateResources(resources, config);
|
|
23
|
+
return resources;
|
|
24
|
+
}
|
|
25
|
+
getOutputs(resource) {
|
|
26
|
+
return {
|
|
27
|
+
id: resource.group.id,
|
|
28
|
+
arn: resource.group.arn,
|
|
29
|
+
memberships: resource.memberships
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
validateConfig(config) {
|
|
33
|
+
if (!config.id)
|
|
34
|
+
throw new Error("SsoGroupFactoryConfig must include id");
|
|
35
|
+
if (!config.configuration.displayName)
|
|
36
|
+
throw new Error("Group must have displayName");
|
|
37
|
+
if (!config.configuration.identityStoreId)
|
|
38
|
+
throw new Error("Group must have identityStoreId");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.SsoGroupFactory = SsoGroupFactory;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SSOPermissionSetFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const createAwsSsoPermissionSet_1 = require("./createAwsSsoPermissionSet");
|
|
6
|
+
class SSOPermissionSetFactory extends resourceFactory_1.ResourceFactory {
|
|
7
|
+
async createResource(config) {
|
|
8
|
+
const arr = Array.isArray(config.configuration) ? config.configuration : [config.configuration];
|
|
9
|
+
const resources = arr.map(ps => (0, createAwsSsoPermissionSet_1.createAwsSsoPermissionSet)(ps));
|
|
10
|
+
return resources;
|
|
11
|
+
}
|
|
12
|
+
getOutputs(resources) {
|
|
13
|
+
const out = {
|
|
14
|
+
arns: resources.map(r => r.arn),
|
|
15
|
+
permissionSets: resources
|
|
16
|
+
};
|
|
17
|
+
if (resources.length === 1) {
|
|
18
|
+
out.arn = resources[0].arn;
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
validateConfig(config) {
|
|
23
|
+
if (!config.id)
|
|
24
|
+
throw new Error("SsoPermissionSetFactoryConfig must include id");
|
|
25
|
+
if (!config.configuration || (typeof config.configuration !== 'object'))
|
|
26
|
+
throw new Error("configuration must be an object or array");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SSOPermissionSetFactory = SSOPermissionSetFactory;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SsoUserFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const createAwsIdentitystoreUser_1 = require("./createAwsIdentitystoreUser");
|
|
6
|
+
class SsoUserFactory extends resourceFactory_1.ResourceFactory {
|
|
7
|
+
async createResource(config) {
|
|
8
|
+
if (config.hooks?.beforeCreateResources)
|
|
9
|
+
await config.hooks.beforeCreateResources(config);
|
|
10
|
+
const user = (0, createAwsIdentitystoreUser_1.createAwsIdentitystoreUser)(config.configuration);
|
|
11
|
+
if (config.hooks?.afterCreateResources)
|
|
12
|
+
await config.hooks.afterCreateResources(user, config);
|
|
13
|
+
return user;
|
|
14
|
+
}
|
|
15
|
+
getOutputs(resource) {
|
|
16
|
+
return {
|
|
17
|
+
id: resource.id,
|
|
18
|
+
arn: resource.arn
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
validateConfig(config) {
|
|
22
|
+
if (!config.id)
|
|
23
|
+
throw new Error("SsoUserFactoryConfig must include id");
|
|
24
|
+
if (!config.configuration.userName)
|
|
25
|
+
throw new Error("User must have userName");
|
|
26
|
+
if (!config.configuration.identityStoreId)
|
|
27
|
+
throw new Error("User must have identityStoreId");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.SsoUserFactory = SsoUserFactory;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StepFunctionsFactory = void 0;
|
|
4
|
+
const resourceFactory_1 = require("./resourceFactory");
|
|
5
|
+
const validateStepFunctionsConfig_1 = require("./validateStepFunctionsConfig");
|
|
6
|
+
const createAwsStepFunctionsStateMachine_1 = require("./createAwsStepFunctionsStateMachine");
|
|
7
|
+
class StepFunctionsFactory extends resourceFactory_1.ResourceFactory {
|
|
8
|
+
async createResource(config) {
|
|
9
|
+
(0, validateStepFunctionsConfig_1.validateStepFunctionsConfig)(config);
|
|
10
|
+
return (0, createAwsStepFunctionsStateMachine_1.createAwsStepFunctionsStateMachine)(config.configuration.name, {
|
|
11
|
+
name: config.configuration.name,
|
|
12
|
+
definition: JSON.stringify(config.configuration.definition),
|
|
13
|
+
roleArn: config.configuration.roleArn,
|
|
14
|
+
type: config.configuration.type || config.configuration.stateMachineType,
|
|
15
|
+
loggingConfiguration: config.configuration.loggingConfiguration,
|
|
16
|
+
tracingConfiguration: config.configuration.tracingConfiguration,
|
|
17
|
+
tags: config.configuration.tags,
|
|
18
|
+
publish: config.configuration.publish,
|
|
19
|
+
encryptionConfiguration: config.configuration.encryptionConfiguration,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
getOutputs(resource) {
|
|
23
|
+
return {
|
|
24
|
+
arn: resource.arn,
|
|
25
|
+
name: resource.name,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
validateConfig(config) {
|
|
29
|
+
(0, validateStepFunctionsConfig_1.validateStepFunctionsConfig)(config);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.StepFunctionsFactory = StepFunctionsFactory;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TagPolicies = void 0;
|
|
37
|
+
const aws = __importStar(require("@pulumi/aws"));
|
|
38
|
+
const pulumi = __importStar(require("@pulumi/pulumi"));
|
|
39
|
+
class TagPolicies extends pulumi.ComponentResource {
|
|
40
|
+
orgId;
|
|
41
|
+
costCenters;
|
|
42
|
+
constructor(name, args, opts) {
|
|
43
|
+
super("acme:policies:TagPolicy", name, undefined, opts);
|
|
44
|
+
this.orgId = args.orgId;
|
|
45
|
+
this.costCenters = args.costCenters;
|
|
46
|
+
this.createOrgTagPolicy();
|
|
47
|
+
this.createTagPolicyForOrgUnits();
|
|
48
|
+
super.registerOutputs();
|
|
49
|
+
}
|
|
50
|
+
createOrgTagPolicy() {
|
|
51
|
+
const orgTagPolicy = new aws.organizations.Policy("orgTagPolicy", {
|
|
52
|
+
type: "TAG_POLICY",
|
|
53
|
+
content: JSON.stringify({
|
|
54
|
+
tags: {
|
|
55
|
+
CostCenter: {
|
|
56
|
+
tag_key: {
|
|
57
|
+
"@@assign": "CostCenter",
|
|
58
|
+
"@@operators_allowed_for_child_policies": ["@@none"],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
}, { parent: this });
|
|
64
|
+
const attachment = new aws.organizations.PolicyAttachment("orgTagPolicyAttachment", {
|
|
65
|
+
policyId: orgTagPolicy.id,
|
|
66
|
+
targetId: this.orgId,
|
|
67
|
+
}, { parent: this });
|
|
68
|
+
}
|
|
69
|
+
createTagPolicyForOrgUnits() {
|
|
70
|
+
this.costCenters.forEach(this.createOrgUnitTagPolicy.bind(this));
|
|
71
|
+
}
|
|
72
|
+
createOrgUnitTagPolicy(costCenter) {
|
|
73
|
+
costCenter.ou.name.apply((name) => {
|
|
74
|
+
const orgTagPolicy = new aws.organizations.Policy(`${name}TagPolicy`, {
|
|
75
|
+
type: "TAG_POLICY",
|
|
76
|
+
content: JSON.stringify({
|
|
77
|
+
tags: {
|
|
78
|
+
CostCenter: {
|
|
79
|
+
tag_value: {
|
|
80
|
+
"@@assign": costCenter.allowedCostCenters,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
Owner: {
|
|
84
|
+
tag_key: {
|
|
85
|
+
"@@assign": "Owner",
|
|
86
|
+
"@@operators_allowed_for_child_policies": ["@@none"],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
}, { parent: this });
|
|
92
|
+
const attachment = new aws.organizations.PolicyAttachment(`${name}TagPolicyAttachment`, {
|
|
93
|
+
policyId: orgTagPolicy.id,
|
|
94
|
+
targetId: costCenter.ou.id,
|
|
95
|
+
}, { parent: this });
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.TagPolicies = TagPolicies;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformBudgetCostFilters = transformBudgetCostFilters;
|
|
4
|
+
function transformBudgetCostFilters(costFilters) {
|
|
5
|
+
if (!costFilters)
|
|
6
|
+
return undefined;
|
|
7
|
+
return Object.entries(costFilters).map(([name, values]) => ({ name, values }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformBudgetNotifications = transformBudgetNotifications;
|
|
4
|
+
function transformBudgetNotifications(notifications) {
|
|
5
|
+
return notifications?.map((n) => ({
|
|
6
|
+
notificationType: n.type,
|
|
7
|
+
threshold: n.threshold,
|
|
8
|
+
thresholdType: n.thresholdType,
|
|
9
|
+
comparisonOperator: n.comparisonOperator,
|
|
10
|
+
subscriberEmailAddresses: n.emailAddresses,
|
|
11
|
+
})) ?? undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformBudgetPlannedLimits = transformBudgetPlannedLimits;
|
|
4
|
+
function transformBudgetPlannedLimits(plannedLimits) {
|
|
5
|
+
if (!plannedLimits)
|
|
6
|
+
return undefined;
|
|
7
|
+
return plannedLimits.map(l => ({ startTime: l.startTime, amount: l.amount, unit: l.unit }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateAcmConfig = validateAcmConfig;
|
|
4
|
+
function validateAcmConfig(config) {
|
|
5
|
+
if (!config.configuration || !config.configuration.domainName) {
|
|
6
|
+
throw new Error("ACM config must include configuration with domainName");
|
|
7
|
+
}
|
|
8
|
+
if (config.configuration.validationMethod && typeof config.configuration.validationMethod !== "string") {
|
|
9
|
+
throw new Error("validationMethod must be a string");
|
|
10
|
+
}
|
|
11
|
+
if (config.configuration.subjectAlternativeNames && !Array.isArray(config.configuration.subjectAlternativeNames)) {
|
|
12
|
+
throw new Error("subjectAlternativeNames must be an array");
|
|
13
|
+
}
|
|
14
|
+
if (config.configuration.tags && typeof config.configuration.tags !== "object") {
|
|
15
|
+
throw new Error("tags must be an object");
|
|
16
|
+
}
|
|
17
|
+
if (config.configuration.options && typeof config.configuration.options !== "object") {
|
|
18
|
+
throw new Error("options must be an object");
|
|
19
|
+
}
|
|
20
|
+
if (config.configuration.domainValidationOptions && !Array.isArray(config.configuration.domainValidationOptions)) {
|
|
21
|
+
throw new Error("domainValidationOptions must be an array");
|
|
22
|
+
}
|
|
23
|
+
if (config.configuration.keyAlgorithm && typeof config.configuration.keyAlgorithm !== "string") {
|
|
24
|
+
throw new Error("keyAlgorithm must be a string");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateAuroraConfig = validateAuroraConfig;
|
|
4
|
+
function validateAuroraConfig(config) {
|
|
5
|
+
if (!config.configuration || !config.configuration.engine) {
|
|
6
|
+
throw new Error("Aurora config must include configuration with engine");
|
|
7
|
+
}
|
|
8
|
+
}
|