Skip to content

Commit f910f78

Browse files
authored
fix(ec2): flowLogName property for FlowLog construct does not work (#26371)
Currently, flowLogName property for FlowLog L2 is never referred in generated CloudFormation template. This PR solves the issue by adding Name tag with the value of flowLogName property. Closes #26370 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c84666c commit f910f78

22 files changed

+32655
-70
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-customformat.js.snapshot/FlowLogsTestStack.assets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"a4b59355abf5d8c0386c7a97a5ba8710aa8bd36803e900fdc1db7cd5898ab07f": {
17+
"35acc9890f56039e55907e0d94b218fc4900a4e3fa8ebfbf44dafe81b20a0e0d": {
1818
"source": {
1919
"path": "FlowLogsTestStack.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "a4b59355abf5d8c0386c7a97a5ba8710aa8bd36803e900fdc1db7cd5898ab07f.json",
25+
"objectKey": "35acc9890f56039e55907e0d94b218fc4900a4e3fa8ebfbf44dafe81b20a0e0d.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-customformat.js.snapshot/FlowLogsTestStack.template.json

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@
417417
"Tags": [
418418
{
419419
"Key": "Name",
420-
"Value": "FlowLogsTestStack/VPC"
420+
"Value": "FlowLogsTestStack/VPC/FlowLogsS3"
421421
}
422422
],
423423
"TrafficType": "ALL"
@@ -441,7 +441,13 @@
441441
}
442442
],
443443
"Version": "2012-10-17"
444-
}
444+
},
445+
"Tags": [
446+
{
447+
"Key": "Name",
448+
"Value": "FlowLogsTestStack/FlowLogsCW"
449+
}
450+
]
445451
}
446452
},
447453
"FlowLogsCWIAMRoleDefaultPolicy943C8A20": {
@@ -487,7 +493,13 @@
487493
"FlowLogsCWLogGroup0398E8F8": {
488494
"Type": "AWS::Logs::LogGroup",
489495
"Properties": {
490-
"RetentionInDays": 731
496+
"RetentionInDays": 731,
497+
"Tags": [
498+
{
499+
"Key": "Name",
500+
"Value": "FlowLogsTestStack/FlowLogsCW"
501+
}
502+
]
491503
},
492504
"UpdateReplacePolicy": "Retain",
493505
"DeletionPolicy": "Retain"
@@ -510,6 +522,12 @@
510522
"Ref": "VPCB9E5F0B4"
511523
},
512524
"ResourceType": "VPC",
525+
"Tags": [
526+
{
527+
"Key": "Name",
528+
"Value": "FlowLogsTestStack/FlowLogsCW"
529+
}
530+
],
513531
"TrafficType": "ALL"
514532
}
515533
},
@@ -527,7 +545,13 @@
527545
}
528546
],
529547
"Version": "2012-10-17"
530-
}
548+
},
549+
"Tags": [
550+
{
551+
"Key": "Name",
552+
"Value": "FlowLogsTestStack/FlowLogsAllFormatCW"
553+
}
554+
]
531555
}
532556
},
533557
"FlowLogsAllFormatCWIAMRoleDefaultPolicyBE4C71ED": {
@@ -573,7 +597,13 @@
573597
"FlowLogsAllFormatCWLogGroup3DAB6837": {
574598
"Type": "AWS::Logs::LogGroup",
575599
"Properties": {
576-
"RetentionInDays": 731
600+
"RetentionInDays": 731,
601+
"Tags": [
602+
{
603+
"Key": "Name",
604+
"Value": "FlowLogsTestStack/FlowLogsAllFormatCW"
605+
}
606+
]
577607
},
578608
"UpdateReplacePolicy": "Retain",
579609
"DeletionPolicy": "Retain"
@@ -596,6 +626,12 @@
596626
"Ref": "VPCB9E5F0B4"
597627
},
598628
"ResourceType": "VPC",
629+
"Tags": [
630+
{
631+
"Key": "Name",
632+
"Value": "FlowLogsTestStack/FlowLogsAllFormatCW"
633+
}
634+
],
599635
"TrafficType": "ALL"
600636
}
601637
},

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-customformat.js.snapshot/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a4b59355abf5d8c0386c7a97a5ba8710aa8bd36803e900fdc1db7cd5898ab07f.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/35acc9890f56039e55907e0d94b218fc4900a4e3fa8ebfbf44dafe81b20a0e0d.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-customformat.js.snapshot/tree.json

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@
678678
"tags": [
679679
{
680680
"key": "Name",
681-
"value": "FlowLogsTestStack/VPC"
681+
"value": "FlowLogsTestStack/VPC/FlowLogsS3"
682682
}
683683
],
684684
"trafficType": "ALL"
@@ -734,7 +734,13 @@
734734
}
735735
],
736736
"Version": "2012-10-17"
737-
}
737+
},
738+
"tags": [
739+
{
740+
"key": "Name",
741+
"value": "FlowLogsTestStack/FlowLogsCW"
742+
}
743+
]
738744
}
739745
},
740746
"constructInfo": {
@@ -816,7 +822,13 @@
816822
"attributes": {
817823
"aws:cdk:cloudformation:type": "AWS::Logs::LogGroup",
818824
"aws:cdk:cloudformation:props": {
819-
"retentionInDays": 731
825+
"retentionInDays": 731,
826+
"tags": [
827+
{
828+
"key": "Name",
829+
"value": "FlowLogsTestStack/FlowLogsCW"
830+
}
831+
]
820832
}
821833
},
822834
"constructInfo": {
@@ -851,6 +863,12 @@
851863
"Ref": "VPCB9E5F0B4"
852864
},
853865
"resourceType": "VPC",
866+
"tags": [
867+
{
868+
"key": "Name",
869+
"value": "FlowLogsTestStack/FlowLogsCW"
870+
}
871+
],
854872
"trafficType": "ALL"
855873
}
856874
},
@@ -898,7 +916,13 @@
898916
}
899917
],
900918
"Version": "2012-10-17"
901-
}
919+
},
920+
"tags": [
921+
{
922+
"key": "Name",
923+
"value": "FlowLogsTestStack/FlowLogsAllFormatCW"
924+
}
925+
]
902926
}
903927
},
904928
"constructInfo": {
@@ -980,7 +1004,13 @@
9801004
"attributes": {
9811005
"aws:cdk:cloudformation:type": "AWS::Logs::LogGroup",
9821006
"aws:cdk:cloudformation:props": {
983-
"retentionInDays": 731
1007+
"retentionInDays": 731,
1008+
"tags": [
1009+
{
1010+
"key": "Name",
1011+
"value": "FlowLogsTestStack/FlowLogsAllFormatCW"
1012+
}
1013+
]
9841014
}
9851015
},
9861016
"constructInfo": {
@@ -1015,6 +1045,12 @@
10151045
"Ref": "VPCB9E5F0B4"
10161046
},
10171047
"resourceType": "VPC",
1048+
"tags": [
1049+
{
1050+
"key": "Name",
1051+
"value": "FlowLogsTestStack/FlowLogsAllFormatCW"
1052+
}
1053+
],
10181054
"trafficType": "ALL"
10191055
}
10201056
},

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-interval.js.snapshot/FlowLogsTestStack.assets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"e2671f8cd84932eccd2cf1e512a31437133da0c6cd4658c3863903f1923e8235": {
17+
"99fa1ff8164e33fddcfd757915d874057dc931fc37a80fdd64428fa78b9698c7": {
1818
"source": {
1919
"path": "FlowLogsTestStack.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "e2671f8cd84932eccd2cf1e512a31437133da0c6cd4658c3863903f1923e8235.json",
25+
"objectKey": "99fa1ff8164e33fddcfd757915d874057dc931fc37a80fdd64428fa78b9698c7.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-interval.js.snapshot/FlowLogsTestStack.template.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397
"Tags": [
398398
{
399399
"Key": "Name",
400-
"Value": "FlowLogsTestStack/VPC"
400+
"Value": "FlowLogsTestStack/VPC/FlowLogsS3"
401401
}
402402
]
403403
},
@@ -535,7 +535,7 @@
535535
"Tags": [
536536
{
537537
"Key": "Name",
538-
"Value": "FlowLogsTestStack/VPC"
538+
"Value": "FlowLogsTestStack/VPC/FlowLogsS3"
539539
}
540540
],
541541
"TrafficType": "ALL"
@@ -569,7 +569,7 @@
569569
"Tags": [
570570
{
571571
"Key": "Name",
572-
"Value": "FlowLogsTestStack/VPC"
572+
"Value": "FlowLogsTestStack/VPC/FlowLogsS3KeyPrefix"
573573
}
574574
],
575575
"TrafficType": "ALL"
@@ -593,7 +593,13 @@
593593
}
594594
],
595595
"Version": "2012-10-17"
596-
}
596+
},
597+
"Tags": [
598+
{
599+
"Key": "Name",
600+
"Value": "FlowLogsTestStack/FlowLogsCW"
601+
}
602+
]
597603
}
598604
},
599605
"FlowLogsCWIAMRoleDefaultPolicy943C8A20": {
@@ -639,7 +645,13 @@
639645
"FlowLogsCWLogGroup0398E8F8": {
640646
"Type": "AWS::Logs::LogGroup",
641647
"Properties": {
642-
"RetentionInDays": 731
648+
"RetentionInDays": 731,
649+
"Tags": [
650+
{
651+
"Key": "Name",
652+
"Value": "FlowLogsTestStack/FlowLogsCW"
653+
}
654+
]
643655
},
644656
"UpdateReplacePolicy": "Retain",
645657
"DeletionPolicy": "Retain"
@@ -662,6 +674,12 @@
662674
"Ref": "VPCB9E5F0B4"
663675
},
664676
"ResourceType": "VPC",
677+
"Tags": [
678+
{
679+
"Key": "Name",
680+
"Value": "FlowLogsTestStack/FlowLogsCW"
681+
}
682+
],
665683
"TrafficType": "ALL"
666684
}
667685
},

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-interval.js.snapshot/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e2671f8cd84932eccd2cf1e512a31437133da0c6cd4658c3863903f1923e8235.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/99fa1ff8164e33fddcfd757915d874057dc931fc37a80fdd64428fa78b9698c7.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.vpc-flow-logs-interval.js.snapshot/tree.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@
662662
"tags": [
663663
{
664664
"key": "Name",
665-
"value": "FlowLogsTestStack/VPC"
665+
"value": "FlowLogsTestStack/VPC/FlowLogsS3"
666666
}
667667
]
668668
}
@@ -830,7 +830,7 @@
830830
"tags": [
831831
{
832832
"key": "Name",
833-
"value": "FlowLogsTestStack/VPC"
833+
"value": "FlowLogsTestStack/VPC/FlowLogsS3"
834834
}
835835
],
836836
"trafficType": "ALL"
@@ -879,7 +879,7 @@
879879
"tags": [
880880
{
881881
"key": "Name",
882-
"value": "FlowLogsTestStack/VPC"
882+
"value": "FlowLogsTestStack/VPC/FlowLogsS3KeyPrefix"
883883
}
884884
],
885885
"trafficType": "ALL"
@@ -935,7 +935,13 @@
935935
}
936936
],
937937
"Version": "2012-10-17"
938-
}
938+
},
939+
"tags": [
940+
{
941+
"key": "Name",
942+
"value": "FlowLogsTestStack/FlowLogsCW"
943+
}
944+
]
939945
}
940946
},
941947
"constructInfo": {
@@ -1017,7 +1023,13 @@
10171023
"attributes": {
10181024
"aws:cdk:cloudformation:type": "AWS::Logs::LogGroup",
10191025
"aws:cdk:cloudformation:props": {
1020-
"retentionInDays": 731
1026+
"retentionInDays": 731,
1027+
"tags": [
1028+
{
1029+
"key": "Name",
1030+
"value": "FlowLogsTestStack/FlowLogsCW"
1031+
}
1032+
]
10211033
}
10221034
},
10231035
"constructInfo": {
@@ -1052,6 +1064,12 @@
10521064
"Ref": "VPCB9E5F0B4"
10531065
},
10541066
"resourceType": "VPC",
1067+
"tags": [
1068+
{
1069+
"key": "Name",
1070+
"value": "FlowLogsTestStack/FlowLogsCW"
1071+
}
1072+
],
10551073
"trafficType": "ALL"
10561074
}
10571075
},

0 commit comments

Comments
 (0)