Skip to content

RevokeSecurityGroupIngress

Source: src/AWS/EC2/RevokeSecurityGroupIngress.ts

Runtime binding for the RevokeSecurityGroupIngress operation scoped to the bound SecurityGroup (IAM action ec2:RevokeSecurityGroupIngress on the security group ARN).

Removes an inbound rule from the group at runtime — the cleanup half of the dynamic IP-allowlisting pattern (see AuthorizeSecurityGroupIngress). Provide the implementation with Effect.provide(AWS.EC2.RevokeSecurityGroupIngressHttp).

// init — bind the operation to the security group
const revokeIngress = yield* AWS.EC2.RevokeSecurityGroupIngress(group);
// runtime — close port 22 for the address again
yield* revokeIngress({
IpProtocol: "tcp",
FromPort: 22,
ToPort: 22,
CidrIp: "203.0.113.7/32",
});