Skip to content

Instantly share code, notes, and snippets.

@trylix
Created August 30, 2024 14:17
Show Gist options
  • Select an option

  • Save trylix/000b22b29475c928a5d04a0cc8bb77d0 to your computer and use it in GitHub Desktop.

Select an option

Save trylix/000b22b29475c928a5d04a0cc8bb77d0 to your computer and use it in GitHub Desktop.
- name: Schedule Cleanup
run: |
aws events put-rule \
--name "CleanupBranch-${{ github.ref_name }}" \
--schedule-expression "rate(6 hours)" # Ajuste o tempo conforme necessário
aws events put-targets \
--rule "CleanupBranch-${{ github.ref_name }}" \
--targets "Id"="1","Arn"="arn:aws:lambda:us-east-1:123456789012:function:YourCleanupFunction","Input"="{\"branch_name\":\"${{ github.ref_name }}\",\"cluster_name\":\"my-cluster-name\",\"listener_arn\":\"arn:aws:elasticloadbalancing:us-east-1:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/7c7a56b0\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment