diff --git a/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts b/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts index 3a94a026a7f41..41de4bb3ca926 100644 --- a/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts +++ b/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts @@ -38,6 +38,9 @@ import { } from '../../core'; import * as cxapi from '../../cx-api'; +const CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID = { [cxapi.CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID]: true }; + + /** * Allows you to control where to place a new Stage when it's added to the Pipeline. * Note that you can provide only one of the below properties - @@ -823,7 +826,13 @@ export class Pipeline extends PipelineBase { } const app = this.supportScope(); - const supportStackId = `cross-region-stack-${this.reuseCrossRegionSupportStacks ? pipelineAccount : pipelineStack.stackName}:${actionRegion}`; + + + const supportStackId = CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID[cxapi.CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID] + ? `cross-region-stack-${this.reuseCrossRegionSupportStacks ? pipelineAccount : pipelineStack.stackName}-${actionRegion}` + : `cross-region-stack-${this.reuseCrossRegionSupportStacks ? pipelineAccount : pipelineStack.stackName}:${actionRegion}`; + + let supportStack = app.node.tryFindChild(supportStackId) as CrossRegionSupportStack; if (!supportStack) { supportStack = new CrossRegionSupportStack(app, supportStackId, { diff --git a/packages/aws-cdk-lib/cx-api/README.md b/packages/aws-cdk-lib/cx-api/README.md index 7c9457aec56f2..a548f979f86b8 100644 --- a/packages/aws-cdk-lib/cx-api/README.md +++ b/packages/aws-cdk-lib/cx-api/README.md @@ -594,3 +594,15 @@ _cdk.json_ } } ``` + +* `@aws-cdk/aws-codepipeline:removeTheColonFromStackID` +Some stack IDs include colons in their naming, which are not supported by the Windows file system, rendering the repository incompatible with Windows users. Enabling this feature flag removes the colons, allowing Windows users to clone and contribute to the repository. Disabling the flag may create challenges for Windows-based contributors. +_cdk.json_ + +```json +{ + "context": { + "@aws-cdk/aws-codepipeline:removeTheColonFromStackID": true + } +} +``` diff --git a/packages/aws-cdk-lib/cx-api/lib/features.ts b/packages/aws-cdk-lib/cx-api/lib/features.ts index 5991642b93bed..b6bc7ce7527ca 100644 --- a/packages/aws-cdk-lib/cx-api/lib/features.ts +++ b/packages/aws-cdk-lib/cx-api/lib/features.ts @@ -122,6 +122,7 @@ export const Enable_IMDS_Blocking_Deprecated_Feature = '@aws-cdk/aws-ecs:enableI export const Disable_ECS_IMDS_Blocking = '@aws-cdk/aws-ecs:disableEcsImdsBlocking'; export const ALB_DUALSTACK_WITHOUT_PUBLIC_IPV4_SECURITY_GROUP_RULES_DEFAULT = '@aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault'; export const IAM_OIDC_REJECT_UNAUTHORIZED_CONNECTIONS = '@aws-cdk/aws-iam:oidcRejectUnauthorizedConnections'; +export const CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID = '@aws-cdk/aws-codepipeline:removeTheColonFromStackID'; export const FLAGS: Record = { ////////////////////////////////////////////////////////////////////// @@ -1371,6 +1372,16 @@ export const FLAGS: Record = { recommendedValue: true, compatibilityWithOldBehaviorMd: 'Disable the feature flag to allow unsecure OIDC connection.', }, + ////////////////////////////////////////////////////////////////////// + [CODEPIPELINE_REMOVE_THE_COLON_FROM_STACK_ID]: { + type: FlagType.BugFix, + summary: 'When enabled, it removes the colon from the stack ID, making the repository compatible with the Windows file system.', + detailsMd: `The current stack ID uses a colon, which is not supported by the Windows file system and makes the repository incompatible for Windows users. Enable this feature flag to remove the colon, allowing Windows users to clone and contribute to the repository. Disabling the flag poses challenges for Windows-based contributors.`, + introducedIn: { v2: 'V2NEXT' }, + compatibilityWithOldBehaviorMd: '', + defaults: { v2: true }, + recommendedValue: true + }, }; const CURRENT_MV = 'v2';