Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Ask HN: How can I secure my AWS instance's SSH access if I have no static IP?.
tag_name="tmpip"
tag_time=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
aws ec2 authorize-security-group-ingress --group-id sg-86169665d2453e4 --protocol tcp --port 22 --cidr "$ip/32" --tag-specifications "ResourceType=security-group-rule,Tags=[{Key=Name,Value=${tag_name}},{Key=added,Value=${tag_time}}]"
The tag enables replacing the existing rule via tag Name, the further you go the easier it is to use the API SDKs
tag_name="tmpip"
tag_time=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
aws ec2 authorize-security-group-ingress --group-id sg-86169665d2453e4 --protocol tcp --port 22 --cidr "$ip/32" --tag-specifications "ResourceType=security-group-rule,Tags=[{Key=Name,Value=${tag_name}},{Key=added,Value=${tag_time}}]"
The tag enables replacing the existing rule via tag Name, the further you go the easier it is to use the API SDKs