Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,39 @@ async function onCreate(event: CloudFormationCustomResourceEvent) {

if (groupId) {
if (securityGroupIngress && securityGroupIngress.length > 0) {
// Deleting VPC default security group inbound rule
await throttlingBackOff(() => ec2.revokeSecurityGroupIngress(buildDeleteIngressRequest({ groupId })).promise());
try {
// Deleting VPC default security group inbound rule
await throttlingBackOff(() => ec2.revokeSecurityGroupIngress(buildDeleteIngressRequest({ groupId })).promise());
} catch (error: any) {
console.log('Error trying to remove default security group Ingress rule');
}
}

if (securityGroupEgress && securityGroupEgress.length > 0) {
// Deleting VPC default security group outbound rule
await throttlingBackOff(() => ec2.revokeSecurityGroupEgress(buildDeleteEgressRequest({ groupId })).promise());
try {
// Deleting VPC default security group outbound rule
await throttlingBackOff(() => ec2.revokeSecurityGroupEgress(buildDeleteEgressRequest({ groupId })).promise());
} catch (error: any) {
console.log('Error trying to remove default security group Egress rule');
}
}

if (tags && tags.length === 0) {
// Attaching tags to the VPC default security group
await throttlingBackOff(() =>
ec2
.createTags(
buildCreateTagsRequest({
groupId,
acceleratorName: event.ResourceProperties.acceleratorName,
}),
)
.promise(),
);
try {
// Attaching tags to the VPC default security group
await throttlingBackOff(() =>
ec2
.createTags(
buildCreateTagsRequest({
groupId,
acceleratorName: event.ResourceProperties.acceleratorName,
}),
)
.promise(),
);
} catch (error: any) {
console.log('Error trying to add tags to default security group');
}
}
}

Expand Down