You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Add IP address to EC2 security group
v1
This action adds an IP address on a specific port to an EC2 security group. If no IP address is provided, the action will use the IP address of the machine running the action.
The post action will remove the IP address from the security group.
Note: this action assumes that the AWS CLI is installed and configured previously in the workflow.
Required
The EC2 security group ID to add the IP to.
Required
The port to open on the security group.
The IP address to add to the security group. If no IP address is provided, the action will use the IP address of the machine running the action.
The protocol to use for the security group rule. Defaults to tcp
.
Add the following step to your workflow:
- name: Add IP to EC2 security group
uses: twosense/add-ip-to-ec2-security-group@v1
with:
security-group-id: ${{ secrets.SECURITY_GROUP_ID }}
port: 22