-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-ec2: flow logs for TransitGateway & TransitGatewayAttachment #27222
Comments
Hi @juweeks , thanks for reaching out. Yes, it would be helpful to have these methods in FlowlogsResourceType |
I'll work on it. |
I've implemented it. Could you review? |
…#28605) I have enabled the configuration of flow logs for TransitGateway and TransitGatewayAttachment. Create flow logs from TransitGateway: ```ts declare const tgw: ec2.CfnTransitGateway; new ec2.FlowLog(this, 'TransitGatewayFlowLog', { resourceType: ec2.FlowLogResourceType.fromTransitGatewayId(tgw.ref) }) ``` Create flowlogs from TransitGatewayAttachment: ```ts declare const tgwAttachment: ec2.CfnTransitGatewayAttachment; new ec2.FlowLog(this, 'TransitGatewayAttachmentFlowLog', { resourceType: ec2.FlowLogResourceType.fromTransitGatewayAttachmentId(tgwAttachment.ref) }) ``` Since `trafficType` [cannot be set for flow logs related to TransitGateway resources](https://docs.aws.amazon.com/vpc/latest/tgw/working-with-flow-logs.html#flow-logs-api-cli), I have also added error handling for this. ```ts if (props.resourceType.resourceType === 'TransitGateway' || props.resourceType.resourceType === 'TransitGatewayAttachment') { if (props.trafficType) { throw new Error('trafficType is not supported for Transit Gateway and Transit Gateway Attachment'); } ... } ``` Closes #27222. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the feature
TransitGateway and TransitGatewayAttachment resource types are missing from FlowLogResourceType
Use Case
add flow logs to Transit Gateway resources
Proposed Solution
for FlowLogResourceType, add
from_transit_gateway_id
andfrom_transit_gateway_attachement_id
methodsOther Information
No response
Acknowledgements
CDK version used
2.91
Environment details (OS name and version, etc.)
mac ventura 13.5.2
The text was updated successfully, but these errors were encountered: