aws / aws/aws-cdk

(core): crossRegionReference resources can not be modified by Aspects

Open
#27,780 8 comments 10 reactions 0 assignees View on GitHub
@aws-cdk/core bug effort/medium p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

This is same issue that has been opened here https://github.com/aws/aws-cdk/issues/22820.

When developers turn on crossRegionReference flag https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib-readme.html, cdk will create custom resources including lambdas and roles. But these custom resources could not be modified by Aspect application we built that tries to make resources conform to predefined rules. For example, we have enabled AWS Hook in aws account that requires IAM roles can be only be created with names has certain prefix. If those resources can not be modified, AWS hook will prevent from resource creation.

### Expected Behavior

Custom resources created by enabling crossRegionReference should be modified by Aspects.

### Current Behavior

Custom resources created by enabling crossRegionReference could not be modified by Aspects.

### Reproduction Steps

```
const stack1 = new Stack(app, "Stack1", {
env: {
region: "us-east-1",
},
crossRegionReferences: true,
});
```

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.93.0

### Framework Version

_No response_

### Node.js Version

20.5.7

### OS

MAC

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the crossRegionReferences reproduction and the linked cross-region reference documentation, then trace the generated custom resources, Lambdas, and IAM roles through Aspect application. Confirm how those resources enter the construct tree and whether an Aspect can modify them. Done means Aspects can change the generated resources, including IAM role names, before deployment.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.