@go-to-k/cdkd 0.298.8 → 0.299.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/dist/{asg-provider-B8N6UPAH.js → asg-provider-CGN1a3d3.js} +4 -4
- package/dist/{asg-provider-B8N6UPAH.js.map → asg-provider-CGN1a3d3.js.map} +1 -1
- package/dist/{aws-client-defaults-D0q0z4dG.js → aws-client-defaults-DBXBcg0J.js} +79 -3
- package/dist/aws-client-defaults-DBXBcg0J.js.map +1 -0
- package/dist/{aws-clients-CnmtbrxD.js → aws-clients-Bj7qH5Ph.js} +2 -2
- package/dist/{aws-clients-CnmtbrxD.js.map → aws-clients-Bj7qH5Ph.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-HKmcD4Kn.js → deploy-engine-4K_B3N08.js} +679 -176
- package/dist/deploy-engine-4K_B3N08.js.map +1 -0
- package/dist/{iam-policy-targets-CwKiK9nS.js → iam-policy-targets-Pn2m0R67.js} +3 -3
- package/dist/{iam-policy-targets-CwKiK9nS.js.map → iam-policy-targets-Pn2m0R67.js.map} +1 -1
- package/dist/{iam-role-provider-BiCib2zp.js → iam-role-provider-BKnf387o.js} +47 -7
- package/dist/iam-role-provider-BKnf387o.js.map +1 -0
- package/dist/index.d.ts +24 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{neptune-provider-D3Qcci3J.js → neptune-provider-CR19ID_J.js} +4 -4
- package/dist/{neptune-provider-D3Qcci3J.js.map → neptune-provider-CR19ID_J.js.map} +1 -1
- package/dist/{program-MMwB_CTT.js → program-BgsCaZFy.js} +230 -80
- package/dist/program-BgsCaZFy.js.map +1 -0
- package/dist/{provider-classes--iMwAb7q.js → provider-classes-DxHQcC1K.js} +79 -14
- package/dist/provider-classes-DxHQcC1K.js.map +1 -0
- package/dist/{rds-provider-BdUme0V8.js → rds-provider-BO3U39K0.js} +4 -4
- package/dist/{rds-provider-BdUme0V8.js.map → rds-provider-BO3U39K0.js.map} +1 -1
- package/dist/{version-n6UXfuUI.js → version-DUCWZskc.js} +2 -2
- package/dist/{version-n6UXfuUI.js.map → version-DUCWZskc.js.map} +1 -1
- package/package.json +1 -1
- package/dist/aws-client-defaults-D0q0z4dG.js.map +0 -1
- package/dist/deploy-engine-HKmcD4Kn.js.map +0 -1
- package/dist/iam-role-provider-BiCib2zp.js.map +0 -1
- package/dist/program-MMwB_CTT.js.map +0 -1
- package/dist/provider-classes--iMwAb7q.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as getAwsClients } from "./aws-clients-
|
|
1
|
+
import { r as getAwsClients } from "./aws-clients-Bj7qH5Ph.js";
|
|
2
2
|
import { F as displayStackName, I as isPasteableIdent, N as displayIdent, O as SECRET_REF_MAX_CODE_POINTS, P as displaySafe, R as plainIdentOr, a as getLogger, b as generateResourceNameWithFallback, n as isAwsAuthoredFailure, r as safeStringify, t as describeAwsFailure, y as generateResourceName, z as safeMsg } from "./aws-failure-text-DtvlUugx.js";
|
|
3
|
-
import { $ as protectedReplacementAdvice, $n as isAmbiguousOutcomeError, $t as credentialFingerprint, A as isQuotableImportValue, B as isTerminalDeleteFailure, Bn as withheldTargetClause, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Gt as injectiveKeyPrefix, H as observeThenDisableProtection, In as plainOrDescribed, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mn as hasClauseBreak, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as isInertUnquoted, O as isPlainImportJson, P as remedyLogicalId, Pn as pasteableCommand, Q as pasteableAwsCommand, Qt as clientDefaultsFor, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, V as logGroupProtectionSite, W as rdsFamilyProtectionSite, Wt as injectiveKey, X as WITHHELD_AWS_COMMAND, Xn as markReplayMayCollide, Xt as ambientClientDefaults, Y as UNNAMEABLE_ID_CLAUSE, Yn as markNameCollision, Yt as withPasteableAwsProfile, Z as isAwsCliLiteral, Zt as ambientCredentialConfig, _ as RecentIdSet, _t as createMaskedLogSinks, a as onlySecretDerived, ar as isMarkedNonRetryable, at as startInterruptWatch, b as isInsideWindow, bt as maskDeep, c as recordedPrincipalsRepair, cr as markRedactedCause, ct as canonicalizeRoute53QueryName, dt as compositeIdSkipResult, en as AccountIdUnavailableError, et as renderDisableCommand, ft as logicalIdShown, g as AmbiguousCreateLatch, gn as ProvisioningError, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, ir as THROTTLING_ERROR_NAMES, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jn as commandHole, jt as markAuxiliaryFailure, k as isPlainImportValue, lr as wrapMaskedAwsError, lt as compositeIdFormatMessage, nn as CdkdError, nr as isTransientServerError, o as readPrincipalLists, or as isThrottlingError, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pt as packCompositeId, q as userPoolProtectionSite, r as SECRET_DERIVED_READ_LIVE, sr as markNonRetryable, tr as isRetryableTransientError, u as clearOnUpdateRemoval, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vn as ResourceUpdateNotSupportedError, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation, zn as shellQuote } from "./iam-policy-targets-
|
|
4
|
-
import { s as ambientRegion } from "./aws-client-defaults-
|
|
5
|
-
import { $ as isTruthyCfnBoolean, $
|
|
6
|
-
import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-
|
|
7
|
-
import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-
|
|
8
|
-
import { RDSProvider } from "./rds-provider-
|
|
9
|
-
import { NeptuneProvider } from "./neptune-provider-
|
|
10
|
-
import { ASGProvider } from "./asg-provider-
|
|
3
|
+
import { $ as protectedReplacementAdvice, $n as isAmbiguousOutcomeError, $t as credentialFingerprint, A as isQuotableImportValue, B as isTerminalDeleteFailure, Bn as withheldTargetClause, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Gt as injectiveKeyPrefix, H as observeThenDisableProtection, In as plainOrDescribed, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mn as hasClauseBreak, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as isInertUnquoted, O as isPlainImportJson, P as remedyLogicalId, Pn as pasteableCommand, Q as pasteableAwsCommand, Qt as clientDefaultsFor, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, V as logGroupProtectionSite, W as rdsFamilyProtectionSite, Wt as injectiveKey, X as WITHHELD_AWS_COMMAND, Xn as markReplayMayCollide, Xt as ambientClientDefaults, Y as UNNAMEABLE_ID_CLAUSE, Yn as markNameCollision, Yt as withPasteableAwsProfile, Z as isAwsCliLiteral, Zt as ambientCredentialConfig, _ as RecentIdSet, _t as createMaskedLogSinks, a as onlySecretDerived, ar as isMarkedNonRetryable, at as startInterruptWatch, b as isInsideWindow, bt as maskDeep, c as recordedPrincipalsRepair, cr as markRedactedCause, ct as canonicalizeRoute53QueryName, dt as compositeIdSkipResult, en as AccountIdUnavailableError, et as renderDisableCommand, ft as logicalIdShown, g as AmbiguousCreateLatch, gn as ProvisioningError, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, ir as THROTTLING_ERROR_NAMES, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jn as commandHole, jt as markAuxiliaryFailure, k as isPlainImportValue, lr as wrapMaskedAwsError, lt as compositeIdFormatMessage, nn as CdkdError, nr as isTransientServerError, o as readPrincipalLists, or as isThrottlingError, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pt as packCompositeId, q as userPoolProtectionSite, r as SECRET_DERIVED_READ_LIVE, sr as markNonRetryable, tr as isRetryableTransientError, u as clearOnUpdateRemoval, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vn as ResourceUpdateNotSupportedError, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation, zn as shellQuote } from "./iam-policy-targets-Pn2m0R67.js";
|
|
4
|
+
import { s as ambientRegion } from "./aws-client-defaults-DBXBcg0J.js";
|
|
5
|
+
import { $ as isTruthyCfnBoolean, $n as earliestDefined, Ai as passedParameterClassesOf, B as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Br as observeThenDisableInstanceApiTermination, Bt as getStackRecords, Co as lambdaFunctionNameForMask, Ct as revertNestedChildFromJournal, Di as parseWebACLArn, Dl as renderAssemblyPathEscape, Dr as slowCcOperationTimeoutMs, Dt as getCurrentNestedStackContext, El as displayAssemblyPath, Fr as isWaitAbandonedError, G as resolveDynamoDbDeleteBudgetMs, H as compensateRemovedDeletionProtection, Hr as reEnableInstanceApiTermination, Io as passedNoEchoParametersOf, Ir as markWaitAbandoned, J as deleteTableWithIndexBusyRetry, Ja as withoutSilentDropProperties, K as DELETE_INDEX_WAIT_PROCEED_NOTE, Ka as findSilentDropProperties, Li as accountArgs, Ma as refuseMalformedResourcesForDestroy, Nr as deleteSkipReason, Ol as resolveAssemblyPath, Or as unchangedBehindSecretReference, Ot as withNestedStackContext, Pr as withIndeterminateGuard, Q as hasCdkAutoDeleteTag, Qn as outputReferenceProvenanceOf, Rr as ec2InstanceProtectionSite, Rt as awaitInFlightSibling, So as canonicalLambdaFunctionName, Tl as describeFileReadFailure, U as deleteBudgetKey, Uo as hasMaskableValues, V as beginDeleteWait, Vr as reDisableInstanceApiTermination, W as resolveDynamoDbDeleteBudgetClock, Wa as withheldAccountClause, X as ECR_AUTO_DELETE_IMAGES_TAG, Y as waitForIndexesSettled, Z as S3_AUTO_DELETE_OBJECTS_TAG, _i as getAccountInfo, _o as requireConfigString, a as findNestedTemplateTreeDefect, ai as isSettledInstanceState, an as isRedactedRecordedValue, ao as isWarmThroughputDecrease, ar as DBPROXY_TAG_OPTIONS, b as lookupEachName, bt as getNestedRevertRun, c as renderNestedTemplateTreeDefect, ci as s3BucketDualStackDomainName, co as coerceCfnBoolean, cr as refuseMalformedDesiredTags, cs as dynamicReferenceTokens, dl as decodeListingKey, do as configIntegerRefusal, dr as definedAttributes, es as markSameGenerationBag, et as getPriorAttempts, fa as refuseMalformedNestedChildOutputs, fo as configStringRefusal, fr as stringifyIfAssigned, go as requireConfigObject, gs as recordAttributeIdCopy, hl as derivePartitionAndUrlSuffix, ho as requireConfigArray, hs as physicalNameCopiesOf, ic as stringifyValue, in as REDACTED_DELETE_ADDRESS_SKIP_REASON, io as coerceWarmThroughput$1, ir as DBPROXY_TAGS_WHAT, lc as rewriteTemplateAssetReferences, li as s3BucketRegionalDomainName, lo as coerceCfnInteger, lr as tagMapAsList, ml as canonicalizeRegion, mo as replayWarn, ms as recoverMaskedOutput, nn as getCurrentProducerRegions, ns as snapshotPassProvenance, o as isAbsoluteAssetPath, oi as s3BucketArn, on as redactedDeleteAddressFields, oo as toCfnInteger, or as planTagDiff, os as withoutPhysicalNameCopies, po as readConfigString, q as INDEX_SETTLE_POLL_INTERVAL_MS, ro as WARM_THROUGHPUT_MEMBERS, rr as acquireIdempotencyToken, rs as redactSecretsForState, s as listNestedTemplateRows, si as s3BucketDomainName, sn as redactedDeleteAddressSkip, so as toFiniteNumber, sr as readTagList, t as DeployEngine, tr as reserveStackCreateToken, ts as recordReferenceProvenanceEntry, tt as markRefusedBeforeApplying, ui as s3BucketWebsiteUrl, uo as configBooleanRefusal, ur as tagPlanWarning, v as chunks, wo as sameLambdaFunctionAddress, x as withApiLimit, xo as withRetry, xr as getCurrentResourceSecrets, y as isAccessDeniedError, ys as carriesSecretMask, z as DynamoDBGlobalTableProvider, zr as isTerminationProtectionPropagationError } from "./deploy-engine-4K_B3N08.js";
|
|
6
|
+
import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-BKnf387o.js";
|
|
7
|
+
import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-BgsCaZFy.js";
|
|
8
|
+
import { RDSProvider } from "./rds-provider-BO3U39K0.js";
|
|
9
|
+
import { NeptuneProvider } from "./neptune-provider-CR19ID_J.js";
|
|
10
|
+
import { ASGProvider } from "./asg-provider-CGN1a3d3.js";
|
|
11
11
|
import { createHash, randomUUID } from "node:crypto";
|
|
12
12
|
import { CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
|
|
13
13
|
import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
|
|
@@ -1587,6 +1587,15 @@ var IAMAccessKeyProvider = class {
|
|
|
1587
1587
|
|
|
1588
1588
|
//#endregion
|
|
1589
1589
|
//#region src/provisioning/providers/iam-user-group-provider.ts
|
|
1590
|
+
function isUserOrGroupName(resourceType, id) {
|
|
1591
|
+
return resourceType === "AWS::IAM::User" ? /^[\w+=,.@-]{1,64}$/.test(id) : /^[\w+=,.@-]{1,128}$/.test(id);
|
|
1592
|
+
}
|
|
1593
|
+
function isUserOrGroupType(resourceType) {
|
|
1594
|
+
return resourceType === "AWS::IAM::User" || resourceType === "AWS::IAM::Group";
|
|
1595
|
+
}
|
|
1596
|
+
function userOrGroupIdentityToken(id) {
|
|
1597
|
+
return typeof id === "string" && id !== "" ? id : void 0;
|
|
1598
|
+
}
|
|
1590
1599
|
const MEMBERSHIP_NO_PROPERTIES_SKIP_REASON = "no properties in state — group membership not removed";
|
|
1591
1600
|
const MEMBERSHIP_MISSING_FIELDS_SKIP_REASON = "GroupName/Users missing from state — membership not removed";
|
|
1592
1601
|
const MEMBERSHIP_MALFORMED_USERS_SKIP_REASON = "malformed Users in state — membership not removed";
|
|
@@ -1703,12 +1712,14 @@ var IAMUserGroupProvider = class {
|
|
|
1703
1712
|
const groups = readPrincipalLists({ Groups: properties["Groups"] });
|
|
1704
1713
|
if ("malformed" in groups) throw new ProvisioningError(`Groups of IAM user ${logicalId} is not a list of IAM group names — no user was created`, resourceType, logicalId);
|
|
1705
1714
|
let leftBehind = false;
|
|
1715
|
+
let createdUserIdentity;
|
|
1706
1716
|
try {
|
|
1707
1717
|
const createParams = { UserName: userName };
|
|
1708
1718
|
if (properties["Path"]) createParams.Path = properties["Path"];
|
|
1709
1719
|
if (properties["Tags"] !== void 0 && properties["Tags"] !== null) createParams.Tags = desiredTags;
|
|
1710
1720
|
const response = await (await this.createClient.get()).send(new CreateUserCommand(createParams));
|
|
1711
1721
|
leftBehind = true;
|
|
1722
|
+
createdUserIdentity = userOrGroupIdentityToken(response.User?.UserId);
|
|
1712
1723
|
try {
|
|
1713
1724
|
const permissionsBoundary = properties["PermissionsBoundary"];
|
|
1714
1725
|
if (permissionsBoundary) {
|
|
@@ -1785,7 +1796,7 @@ var IAMUserGroupProvider = class {
|
|
|
1785
1796
|
} catch (error) {
|
|
1786
1797
|
const cause = error instanceof Error ? error : void 0;
|
|
1787
1798
|
const thrown = this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create IAM user ${logicalId}: ${text}`, resourceType, logicalId, userName, cause));
|
|
1788
|
-
if (leftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, userName);
|
|
1799
|
+
if (leftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, userName, createdUserIdentity);
|
|
1789
1800
|
throw thrown;
|
|
1790
1801
|
}
|
|
1791
1802
|
}
|
|
@@ -1874,7 +1885,8 @@ var IAMUserGroupProvider = class {
|
|
|
1874
1885
|
if (error instanceof NoSuchEntityException) {
|
|
1875
1886
|
const clientRegion = await this.iamClient.config.region();
|
|
1876
1887
|
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
1877
|
-
|
|
1888
|
+
if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` IAM user ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
|
|
1889
|
+
else log.debug(`User ${v(physicalId)} does not exist, skipping deletion`);
|
|
1878
1890
|
return;
|
|
1879
1891
|
}
|
|
1880
1892
|
throw error;
|
|
@@ -2085,11 +2097,13 @@ var IAMUserGroupProvider = class {
|
|
|
2085
2097
|
log.debug(`Creating IAM group ${logicalId}`);
|
|
2086
2098
|
const groupName = generateResourceNameWithFallback(properties["GroupName"], logicalId, { maxLength: GROUP_NAME_MAX_LENGTH });
|
|
2087
2099
|
let leftBehind = false;
|
|
2100
|
+
let createdGroupIdentity;
|
|
2088
2101
|
try {
|
|
2089
2102
|
const createParams = { GroupName: groupName };
|
|
2090
2103
|
if (properties["Path"]) createParams.Path = properties["Path"];
|
|
2091
2104
|
const response = await (await this.createClient.get()).send(new CreateGroupCommand(createParams));
|
|
2092
2105
|
leftBehind = true;
|
|
2106
|
+
createdGroupIdentity = userOrGroupIdentityToken(response.Group?.GroupId);
|
|
2093
2107
|
try {
|
|
2094
2108
|
const managedPolicyArns = properties["ManagedPolicyArns"];
|
|
2095
2109
|
if (managedPolicyArns && Array.isArray(managedPolicyArns)) for (const policyArn of managedPolicyArns) {
|
|
@@ -2130,7 +2144,7 @@ var IAMUserGroupProvider = class {
|
|
|
2130
2144
|
} catch (error) {
|
|
2131
2145
|
const cause = error instanceof Error ? error : void 0;
|
|
2132
2146
|
const thrown = this.wrapMaskedError(log.mask, error, (text) => new ProvisioningError(`Failed to create IAM group ${logicalId}: ${text}`, resourceType, logicalId, groupName, cause));
|
|
2133
|
-
if (leftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, groupName);
|
|
2147
|
+
if (leftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, groupName, createdGroupIdentity);
|
|
2134
2148
|
throw thrown;
|
|
2135
2149
|
}
|
|
2136
2150
|
}
|
|
@@ -2166,7 +2180,8 @@ var IAMUserGroupProvider = class {
|
|
|
2166
2180
|
if (error instanceof NoSuchEntityException) {
|
|
2167
2181
|
const clientRegion = await this.iamClient.config.region();
|
|
2168
2182
|
assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
|
|
2169
|
-
|
|
2183
|
+
if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` IAM group ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
|
|
2184
|
+
else log.debug(`Group ${v(physicalId)} does not exist, skipping deletion`);
|
|
2170
2185
|
return;
|
|
2171
2186
|
}
|
|
2172
2187
|
const cause = error instanceof Error ? error : void 0;
|
|
@@ -2448,6 +2463,50 @@ var IAMUserGroupProvider = class {
|
|
|
2448
2463
|
throw maskError(new ProvisioningError(`Failed to delete IAM UserToGroupAddition ${logicalId}: ${mask(error instanceof Error ? error.message : String(error))}`, resourceType, logicalId, physicalId, cause));
|
|
2449
2464
|
}
|
|
2450
2465
|
}
|
|
2466
|
+
async isSameResource(journaledPhysicalId, record, resourceType, context) {
|
|
2467
|
+
if (!isUserOrGroupType(resourceType)) return "unknown";
|
|
2468
|
+
if (!isUserOrGroupName(resourceType, journaledPhysicalId) || !isUserOrGroupName(resourceType, record.physicalId)) return "unknown";
|
|
2469
|
+
if (journaledPhysicalId === record.physicalId) return "same";
|
|
2470
|
+
if (journaledPhysicalId.toLowerCase() === record.physicalId.toLowerCase()) return "unknown";
|
|
2471
|
+
if (await this.iamClient.config.region() !== context.expectedRegion) return "unknown";
|
|
2472
|
+
const recordId = await this.readIdIfExists(resourceType, record.physicalId);
|
|
2473
|
+
if (recordId === void 0) return "unknown";
|
|
2474
|
+
const journaledId = await this.readIdIfExists(resourceType, journaledPhysicalId);
|
|
2475
|
+
if (journaledId === void 0) return "different";
|
|
2476
|
+
return journaledId === recordId ? "same" : "different";
|
|
2477
|
+
}
|
|
2478
|
+
async resourceIdentity(physicalId, resourceType, context) {
|
|
2479
|
+
if (!isUserOrGroupType(resourceType) || !isUserOrGroupName(resourceType, physicalId)) return;
|
|
2480
|
+
if (await this.iamClient.config.region() !== context.expectedRegion) return void 0;
|
|
2481
|
+
const id = await this.readIdIfExists(resourceType, physicalId);
|
|
2482
|
+
return id === void 0 ? RESOURCE_NOT_FOUND : id;
|
|
2483
|
+
}
|
|
2484
|
+
async readIdIfExists(resourceType, name) {
|
|
2485
|
+
let answeredName;
|
|
2486
|
+
let id;
|
|
2487
|
+
try {
|
|
2488
|
+
if (resourceType === "AWS::IAM::User") {
|
|
2489
|
+
const response = await this.iamClient.send(new GetUserCommand({ UserName: name }));
|
|
2490
|
+
answeredName = response.User?.UserName;
|
|
2491
|
+
id = response.User?.UserId;
|
|
2492
|
+
} else {
|
|
2493
|
+
const response = await this.iamClient.send(new GetGroupCommand({
|
|
2494
|
+
GroupName: name,
|
|
2495
|
+
MaxItems: 1
|
|
2496
|
+
}));
|
|
2497
|
+
answeredName = response.Group?.GroupName;
|
|
2498
|
+
id = response.Group?.GroupId;
|
|
2499
|
+
}
|
|
2500
|
+
} catch (error) {
|
|
2501
|
+
if (error instanceof NoSuchEntityException) return void 0;
|
|
2502
|
+
throw error;
|
|
2503
|
+
}
|
|
2504
|
+
const noun = resourceType === "AWS::IAM::User" ? "user" : "group";
|
|
2505
|
+
if (answeredName !== name) throw new Error(`IAM answered for another ${noun} than the one asked for`);
|
|
2506
|
+
const token = userOrGroupIdentityToken(id);
|
|
2507
|
+
if (token === void 0) throw new Error(`IAM returned no ${noun === "user" ? "UserId" : "GroupId"}`);
|
|
2508
|
+
return token;
|
|
2509
|
+
}
|
|
2451
2510
|
async readCurrentState(physicalId, logicalId, resourceType, properties, context) {
|
|
2452
2511
|
switch (resourceType) {
|
|
2453
2512
|
case "AWS::IAM::User": return this.readUserCurrentState(physicalId, properties, context);
|
|
@@ -44522,6 +44581,7 @@ var NestedStackProvider = class {
|
|
|
44522
44581
|
onDestructivePlan: void 0,
|
|
44523
44582
|
...inheritedSecrets && hasMaskableValues(inheritedSecrets) && { inheritedSecrets },
|
|
44524
44583
|
inheritedPhysicalNameCopies: inheritedPhysicalNameCopiesOf(inheritedSecrets),
|
|
44584
|
+
inheritedReferenceProvenance: snapshotPassProvenance(inheritedSecrets),
|
|
44525
44585
|
...passedClasses && { passedParameterClasses: passedClasses },
|
|
44526
44586
|
passedNoEchoParameters: passedNoEchoParametersOf(inheritedSecrets),
|
|
44527
44587
|
inheritedProducerRegions: getCurrentProducerRegions(),
|
|
@@ -44552,6 +44612,11 @@ var NestedStackProvider = class {
|
|
|
44552
44612
|
refuseMalformedNestedChildOutputs(childStateData.state, childStackName, childRegion, runAccountOf(ctx));
|
|
44553
44613
|
const attributes = this.buildOutputsAttributes(childStateData.state.outputs ?? {});
|
|
44554
44614
|
const rowSecrets = getCurrentResourceSecrets();
|
|
44615
|
+
if (rowSecrets !== void 0) for (const outputKey of Object.keys(childStateData.state.outputs ?? {})) {
|
|
44616
|
+
const entries = outputReferenceProvenanceOf(childStateData.state, outputKey);
|
|
44617
|
+
if (entries === void 0) continue;
|
|
44618
|
+
for (const [token, entry] of Object.entries(entries)) recordReferenceProvenanceEntry(rowSecrets, token, entry, "read");
|
|
44619
|
+
}
|
|
44555
44620
|
if (rowSecrets !== void 0) {
|
|
44556
44621
|
const childResources = childStateData.state.resources;
|
|
44557
44622
|
const ids = childResources !== null && typeof childResources === "object" ? Object.values(childResources).map((record) => record?.physicalId).filter((id) => typeof id === "string" && id !== "") : [];
|
|
@@ -45043,4 +45108,4 @@ var ACMCertificateProvider = class {
|
|
|
45043
45108
|
|
|
45044
45109
|
//#endregion
|
|
45045
45110
|
export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaPermissionProvider, LambdaUrlProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider };
|
|
45046
|
-
//# sourceMappingURL=provider-classes
|
|
45111
|
+
//# sourceMappingURL=provider-classes-DxHQcC1K.js.map
|