karlderkaefer/cdk-notifier

Supress service types in overview section

JohannesKonings opened this issue · 6 comments

Sometimes the changed types are known before and it's not necessary to be made aware of this changes. Therefore it would be helpful to suppress these types. Maybe if the overview parameter looks like this:

--show-overview supress=AWS::ECS::TaskDefinition

cdk diff for stacks

Number of stacks with differences: 1

Click to expand
Stack fargate
Resources
[~] AWS::ECS::TaskDefinition DetailFargateService/TaskDef detailFargateServiceTaskDef795131A3 replace
 └─ [~] ContainerDefinitions (requires replacement)
     └─ @@ -81,7 +81,7 @@
        [ ] ],
        [ ] "Essential": true,
        [ ] "Image": {
-       [-]   "Fn::Sub": "123456789012.dkr.ecr.eu-central-1.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-123456789012-eu-central-1:88f53e8e790ee348fe371bd2dd7365d2cc15be096da0c12d4b0d8bf47aff35d3"
+       [+]   "Fn::Sub": "123456789012.dkr.ecr.eu-central-1.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-123456789012-eu-central-1:64137e051d225c2e197f36cf1156f21c0ec449c2902fa5c8d685e0fbbe822e2d"
        [ ] },
        [ ] "LogConfiguration": {
        [ ]   "LogDriver": "awslogs",
[~] AWS::ECS::TaskDefinition ListFargateService/TaskDef listFargateServiceTaskDef795531A3 replace
 └─ [~] ContainerDefinitions (requires replacement)
     └─ @@ -81,7 +81,7 @@
        [ ] ],
        [ ] "Essential": true,
        [ ] "Image": {
-       [-]   "Fn::Sub": "123456789012.dkr.ecr.eu-central-1.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-123456789012-eu-central-1:88f53e8e790ee348fe371bgt2dd7365d2cc15be096da0c12d4b0d8bf47aff35d3"
+       [+]   "Fn::Sub": "123456789012.dkr.ecr.eu-central-1.${AWS::URLSuffix}/cdk-hnb659fds-container-assets-123456789012-eu-central-1:64137e051d225c2e197f36cf11456f21c0ec449c2902fa5c8d685e0fbbe822e2d"
        [ ] },
        [ ] "LogConfiguration": {
        [ ]   "LogDriver": "awslogs",
Stack lambda
Resources
[~] AWS::Lambda::Function listHandler/Lambda/lambda listHandlerLambdalambdaC875E395 
 ├─ [~] Code
 │   └─ [~] .S3Key:
-│       ├─ [-] 6a8fb4fcc5f635e40d135b1038a814ab0aca7be1e0d85eabb319af0d323a699b.zip
+│       └─ [+] 57a04aad6ab772d1d155746c5b7f3fad7ec005480af335a673aadc88b1005919.zip
 └─ [~] Metadata
     └─ [~] .aws:asset:path:
-        ├─ [-] asset.6a8fb4fcc5f635e40d135b1038a814ab0aca7be1e0d85eabb319af0d323a699b
+        └─ [+] asset.57a04aad6ab772d1d155746c5b7f3fad7ec005480af335a673aadc88b1005919


✨  Number of stacks with differences: 2

@JohannesKonings This is very complicated to achieve with the current code. We had the same issue with functions. This can be resolved on AWS CDK level to void diffs for lambdas. Could you share the example cdk code that would produce such logs?

AwsCustomResource resource is always re-created

When the physicalResourceId hash calculation include dynamic placeholder tokens, the provider function will be also executed, even when there are no real changes in the configuration.
Referring to resource properties such as secret.secretName in config or populating the secrets argument will trigger this issue.

While this behavior is not desired, it causes no harm on the infrastructure for re-runnable processes, such as RDS initialization through re-runnable SQL scripts.

see also aws/aws-cdk#8285

I just have in mind right now adding a --suppress-hash-change , we can go through all changes, if changed resources only contain a hash change, then do not send out diff comment

@JohannesKonings I have found a solution that might work you. please test if #149 works for your use case. I have noticed there are non-hexadecimal values in your docker tag hash. I assume this was a mistake? 71bgt2dd7365

@karlderkaefer thanks, that helps.
A premium solution would be to suppress hash changes depending on its type or for specific resources.
But that can be discussed once the CDK diff can be used as JSON.

aws/aws-cdk#679
aws/aws-cdk-rfcs#300

For now, I'm happy :)

🎉 This issue has been resolved in version 2.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀