aws / aws/aws-cdk-cli

(hotswap): AWS::CloudFront::Distribution Attribute Support

Open
#864 5 comments 0 reactions 0 assignees View on GitHub
effort/medium feature-request p2
Dominant language
TypeScript
Stars
105
Forks
122
Avg merge
1d 17h
Merged PRs (30d)
71

Description

### Describe the bug

When doing a hotswap deployment of an ECS instance, the following error was thrown:

```
Could not perform a hotswap deployment, because the CloudFormation template could not be resolved: We don't support attributes of the 'AWS::CloudFront::Distribution' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose
```

Looking at the `cdk synth` output (check current behavior), we can see that one of the ECS instance environment variables is a Distribution DomainName.

Opening this ticket as instructed by the error message. If this isn't the correct place for this ticket, let me know and I can reroute it to the appropriate location.

### Expected Behavior

The hotswap deployment to succeed, since the Distribution DomainName has not changed.

### Current Behavior

The hotswap deployment fails. As far as I can tel, this is because the DomainName attribute of the Distribution resource is not supported. See the below snippet of the `cdk synth` result for more context.

```
ServiceClusterTaskDefF486EB2A:
Type: AWS::ECS::TaskDefinition
Properties:
ContainerDefinitions:
- Cpu: 4096
Environment:
- Name: STAGE
Value: beta
- Name: APPLICATION_NAME
Value: Service
- Name: ENDPOINT
Value:
Fn::GetAtt:
- ASVSelectionServiceCuratedChannelscuratedChannelDistribution0D56EA6F
- DomainName
```

### Reproduction Steps

Run a hotswap deployment for an ECS instance that contains a Distribution attribute in it's definition.

### Possible Solution

Similar to https://github.com/aws/aws-cdk/issues/21320, allow hotswap to tolerate the use of this attribute if it's value hasn't been changed.

### Additional Information/Context

_No response_

### CDK CLI Version

2.127.0

### Framework Version

_No response_

### Node.js Version

14.x

### OS

Linux

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.