Skip to content

Adds the IP address of the Github Action runner to an EC2 security group, and removes it when the job is done.

Notifications You must be signed in to change notification settings

twosense/add-ip-to-ec2-security-group

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add IP to EC2 security group action

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.

Inputs


security-group-id

Required

The EC2 security group ID to add the IP to.

port

Required

The port to open on the security group.

ip

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.

protocol

The protocol to use for the security group rule. Defaults to tcp.

Usage


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

About

Adds the IP address of the Github Action runner to an EC2 security group, and removes it when the job is done.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •