AuthorizeSecurityGroupIngress
Source:
src/AWS/EC2/AuthorizeSecurityGroupIngress.ts
Runtime binding for the AuthorizeSecurityGroupIngress operation scoped to
the bound SecurityGroup (IAM action
ec2:AuthorizeSecurityGroupIngress on the security group ARN).
Adds an inbound rule to the group at runtime — the classic dynamic
IP-allowlisting Lambda that opens a port for an operator’s current address.
Pair with RevokeSecurityGroupIngress to remove the rule afterwards.
Provide the implementation with
Effect.provide(AWS.EC2.AuthorizeSecurityGroupIngressHttp).
Dynamic Security Group Rules
Section titled “Dynamic Security Group Rules”// init — bind the operation to the security groupconst authorizeIngress = yield* AWS.EC2.AuthorizeSecurityGroupIngress(group);
// runtime — open port 22 for the caller's addressyield* authorizeIngress({ IpProtocol: "tcp", FromPort: 22, ToPort: 22, CidrIp: "203.0.113.7/32",});