aws / aws/aws-cdk

aws-s3-deployment: SourceMarkers contains duplicates

Open
#21,504 0 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-s3-deployment bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

if same deploy-time value used more then once, produced template conteans duplicates of corresponding marker.
does not affects the functionality,

### Expected Behavior

each distinct marker generated only once

### Current Behavior

duplicates are present:
```
...
"SourceMarkers": [
{
"<>": {
"Fn::GetAtt": [
"testBucketDF4D7D1A",
"DomainName"
]
},
"<>": {
"Fn::GetAtt": [
"testBucketDF4D7D1A",
"RegionalDomainName"
]
}
},
{
"<>": {
"Fn::GetAtt": [
"testBucketDF4D7D1A",
"DomainName"
]
},
"<>": {
"Fn::GetAtt": [
"testBucketDF4D7D1A",
"RegionalDomainName"
]
}
}
],
...
```

### Reproduction Steps

```
@Getter
@ToString
public class Stack2 extends Stack {

private final BucketDeployment dwcWebDeployment;

@SneakyThrows
@lombok.Builder
Stack2(
@NonNull Construct scope,
@NonNull StackProps props,
@NonNull Stack1 stack1
) {
super(scope, "Stack2", props);

Bucket testBucket = Bucket.Builder.create(this, "testBucket").build();

WebConfig webConfig = WebConfig.builder()
.hostUrl(testBucket.getBucketDomainName())
.s3HostUrl(testBucket.getBucketRegionalDomainName() )
.build();

dwcWebDeployment = BucketDeployment.Builder.create(this, "deployment")
.destinationBucket(testBucket)
.logRetention(RetentionDays.ONE_MONTH)
.sources(asList(
Source.jsonData("config.json", webConfig),
Source.jsonData("config2.json", webConfig)
))
.build();
}

@lombok.Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class WebConfig {

@NonNull String hostUrl;
@NonNull String s3HostUrl;
}

}

```

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.27.0 (build 8e89048)

### Framework Version

_No response_

### Node.js Version

v18.7.0

### OS

Windows 10

### Language

Java

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in the aws-s3-deployment marker-generation path, using the Stack2 reproduction with two Source.jsonData inputs that reuse WebConfig. Synthesize the template and inspect SourceMarkers; done means each distinct marker appears only once while deployment behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.