Skip to content

Commit

Permalink
fix(ec2): flowLogName property for FlowLog construct does not work (#…
Browse files Browse the repository at this point in the history
…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*
  • Loading branch information
tam0ri authored Aug 3, 2023
1 parent c84666c commit f910f78
Show file tree
Hide file tree
Showing 22 changed files with 32,655 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"a4b59355abf5d8c0386c7a97a5ba8710aa8bd36803e900fdc1db7cd5898ab07f": {
"35acc9890f56039e55907e0d94b218fc4900a4e3fa8ebfbf44dafe81b20a0e0d": {
"source": {
"path": "FlowLogsTestStack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "a4b59355abf5d8c0386c7a97a5ba8710aa8bd36803e900fdc1db7cd5898ab07f.json",
"objectKey": "35acc9890f56039e55907e0d94b218fc4900a4e3fa8ebfbf44dafe81b20a0e0d.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/VPC"
"Value": "FlowLogsTestStack/VPC/FlowLogsS3"
}
],
"TrafficType": "ALL"
Expand All @@ -441,7 +441,13 @@
}
],
"Version": "2012-10-17"
}
},
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsCW"
}
]
}
},
"FlowLogsCWIAMRoleDefaultPolicy943C8A20": {
Expand Down Expand Up @@ -487,7 +493,13 @@
"FlowLogsCWLogGroup0398E8F8": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"RetentionInDays": 731
"RetentionInDays": 731,
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsCW"
}
]
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
Expand All @@ -510,6 +522,12 @@
"Ref": "VPCB9E5F0B4"
},
"ResourceType": "VPC",
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsCW"
}
],
"TrafficType": "ALL"
}
},
Expand All @@ -527,7 +545,13 @@
}
],
"Version": "2012-10-17"
}
},
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsAllFormatCW"
}
]
}
},
"FlowLogsAllFormatCWIAMRoleDefaultPolicyBE4C71ED": {
Expand Down Expand Up @@ -573,7 +597,13 @@
"FlowLogsAllFormatCWLogGroup3DAB6837": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"RetentionInDays": 731
"RetentionInDays": 731,
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsAllFormatCW"
}
]
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
Expand All @@ -596,6 +626,12 @@
"Ref": "VPCB9E5F0B4"
},
"ResourceType": "VPC",
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsAllFormatCW"
}
],
"TrafficType": "ALL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a4b59355abf5d8c0386c7a97a5ba8710aa8bd36803e900fdc1db7cd5898ab07f.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/35acc9890f56039e55907e0d94b218fc4900a4e3fa8ebfbf44dafe81b20a0e0d.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/VPC"
"value": "FlowLogsTestStack/VPC/FlowLogsS3"
}
],
"trafficType": "ALL"
Expand Down Expand Up @@ -734,7 +734,13 @@
}
],
"Version": "2012-10-17"
}
},
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsCW"
}
]
}
},
"constructInfo": {
Expand Down Expand Up @@ -816,7 +822,13 @@
"attributes": {
"aws:cdk:cloudformation:type": "AWS::Logs::LogGroup",
"aws:cdk:cloudformation:props": {
"retentionInDays": 731
"retentionInDays": 731,
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsCW"
}
]
}
},
"constructInfo": {
Expand Down Expand Up @@ -851,6 +863,12 @@
"Ref": "VPCB9E5F0B4"
},
"resourceType": "VPC",
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsCW"
}
],
"trafficType": "ALL"
}
},
Expand Down Expand Up @@ -898,7 +916,13 @@
}
],
"Version": "2012-10-17"
}
},
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsAllFormatCW"
}
]
}
},
"constructInfo": {
Expand Down Expand Up @@ -980,7 +1004,13 @@
"attributes": {
"aws:cdk:cloudformation:type": "AWS::Logs::LogGroup",
"aws:cdk:cloudformation:props": {
"retentionInDays": 731
"retentionInDays": 731,
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsAllFormatCW"
}
]
}
},
"constructInfo": {
Expand Down Expand Up @@ -1015,6 +1045,12 @@
"Ref": "VPCB9E5F0B4"
},
"resourceType": "VPC",
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsAllFormatCW"
}
],
"trafficType": "ALL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"e2671f8cd84932eccd2cf1e512a31437133da0c6cd4658c3863903f1923e8235": {
"99fa1ff8164e33fddcfd757915d874057dc931fc37a80fdd64428fa78b9698c7": {
"source": {
"path": "FlowLogsTestStack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e2671f8cd84932eccd2cf1e512a31437133da0c6cd4658c3863903f1923e8235.json",
"objectKey": "99fa1ff8164e33fddcfd757915d874057dc931fc37a80fdd64428fa78b9698c7.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/VPC"
"Value": "FlowLogsTestStack/VPC/FlowLogsS3"
}
]
},
Expand Down Expand Up @@ -535,7 +535,7 @@
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/VPC"
"Value": "FlowLogsTestStack/VPC/FlowLogsS3"
}
],
"TrafficType": "ALL"
Expand Down Expand Up @@ -569,7 +569,7 @@
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/VPC"
"Value": "FlowLogsTestStack/VPC/FlowLogsS3KeyPrefix"
}
],
"TrafficType": "ALL"
Expand All @@ -593,7 +593,13 @@
}
],
"Version": "2012-10-17"
}
},
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsCW"
}
]
}
},
"FlowLogsCWIAMRoleDefaultPolicy943C8A20": {
Expand Down Expand Up @@ -639,7 +645,13 @@
"FlowLogsCWLogGroup0398E8F8": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"RetentionInDays": 731
"RetentionInDays": 731,
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsCW"
}
]
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
Expand All @@ -662,6 +674,12 @@
"Ref": "VPCB9E5F0B4"
},
"ResourceType": "VPC",
"Tags": [
{
"Key": "Name",
"Value": "FlowLogsTestStack/FlowLogsCW"
}
],
"TrafficType": "ALL"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e2671f8cd84932eccd2cf1e512a31437133da0c6cd4658c3863903f1923e8235.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/99fa1ff8164e33fddcfd757915d874057dc931fc37a80fdd64428fa78b9698c7.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/VPC"
"value": "FlowLogsTestStack/VPC/FlowLogsS3"
}
]
}
Expand Down Expand Up @@ -830,7 +830,7 @@
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/VPC"
"value": "FlowLogsTestStack/VPC/FlowLogsS3"
}
],
"trafficType": "ALL"
Expand Down Expand Up @@ -879,7 +879,7 @@
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/VPC"
"value": "FlowLogsTestStack/VPC/FlowLogsS3KeyPrefix"
}
],
"trafficType": "ALL"
Expand Down Expand Up @@ -935,7 +935,13 @@
}
],
"Version": "2012-10-17"
}
},
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsCW"
}
]
}
},
"constructInfo": {
Expand Down Expand Up @@ -1017,7 +1023,13 @@
"attributes": {
"aws:cdk:cloudformation:type": "AWS::Logs::LogGroup",
"aws:cdk:cloudformation:props": {
"retentionInDays": 731
"retentionInDays": 731,
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsCW"
}
]
}
},
"constructInfo": {
Expand Down Expand Up @@ -1052,6 +1064,12 @@
"Ref": "VPCB9E5F0B4"
},
"resourceType": "VPC",
"tags": [
{
"key": "Name",
"value": "FlowLogsTestStack/FlowLogsCW"
}
],
"trafficType": "ALL"
}
},
Expand Down
Loading

0 comments on commit f910f78

Please sign in to comment.