J Doe
J Doe

Reputation: 1

Temporary deny outbound traffic in AWS

I'm trying to perform a simulation to see how the system would react when it's disconnected and reconnected back. If it's done locally I could easily disable my WIFI and enable it back. If I had done the same in AWS I'd get kicked out from my RDP / SSH session and it wouldn't be possible for me to reconnect back to the session to enable the network back.

Any other suggestion to achieve this?

Upvotes: 0

Views: 163

Answers (2)

Exelian
Exelian

Reputation: 5888

Use an AWS lambda to enable and disable a security group which denies outbound traffic. You could just add a time.sleep(60) to wait a a minute between actions.

Upvotes: 1

Paolo
Paolo

Reputation: 26074

Modify the outbound rules on the security group associated to your instance. You can do this from either the console or the cli, with:

aws ec2 update-security-group-rule-descriptions-egress --group-id id --ip-permissions permissions

See the doc for examples.

Upvotes: 1

Related Questions