Skip to content

Instantly share code, notes, and snippets.

@davidmukiibi
Created December 3, 2019 03:21
Show Gist options
  • Save davidmukiibi/3be1185a44e251d35413726cd69508a4 to your computer and use it in GitHub Desktop.
Save davidmukiibi/3be1185a44e251d35413726cd69508a4 to your computer and use it in GitHub Desktop.
bash Script to revoke ingress access for circleci
#!/bin/bash
set -ex
public_ip_address=$(curl -q http://checkip.amazonaws.com)
/root/bin/aws ec2 revoke-security-group-ingress --group-id sg-006b570caa40214f1 --ip-permissions "[{\"IpProtocol\": \"tcp\", \"FromPort\": 443, \"ToPort\": 443, \"IpRanges\": [{\"CidrIp\": \"${public_ip_address}/32\"}]}]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment