diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 0d009aa43d..f4fa97ebf1 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -183,6 +183,8 @@ jobs: test_repo_url: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_URL }} github_sha: ${{github.sha}} s3_integration_bucket: ${{ vars.S3_INTEGRATION_BUCKET }} + connection_port: ${{vars.LINUX_CONNECTION_PORT}} + # StartLocalStackITAR: # name: 'StartLocalStackITAR' @@ -619,6 +621,8 @@ jobs: terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE }} github_sha: ${{github.sha}} s3_integration_bucket: ${{ vars.S3_INTEGRATION_BUCKET }} + connection_port: ${{vars.LINUX_CONNECTION_PORT}} + # StopLocalStackITAR: # name: 'StopLocalStackITAR' diff --git a/.github/workflows/start-localstack.yml b/.github/workflows/start-localstack.yml index 6dc1096121..1d7c848d93 100644 --- a/.github/workflows/start-localstack.yml +++ b/.github/workflows/start-localstack.yml @@ -28,6 +28,9 @@ on: type: string s3_integration_bucket: type: string + connection_port: + type: number + required: true outputs: local_stack_host_name: value: ${{ jobs.StartLocalStack.outputs.local_stack_host_name }} @@ -57,6 +60,16 @@ jobs: role-to-assume: ${{ inputs.terraform_assume_role }} aws-region: ${{ inputs.region }} + + - name: Add Runner to Security Group + uses: mnavarrocarter/authorize-aws-security-group-ingress-action@v1.0.0 + with: + aws-region: ${{inputs.region}} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-security-group-id: ${{ secrets.AWS_TERRAFORM_SECURITY_GROUP_ID }} + protocol: 'tcp' + port: ${{ inputs.connection_port }} - name: Echo Localstack Config run: echo repo name ${{inputs.test_repo_name}} repo branch ${{ inputs.test_repo_branch }} region ${{ inputs.region }} diff --git a/.github/workflows/stop-localstack.yml b/.github/workflows/stop-localstack.yml index 248e3e85ca..2c47ae796f 100644 --- a/.github/workflows/stop-localstack.yml +++ b/.github/workflows/stop-localstack.yml @@ -25,7 +25,9 @@ on: type: string s3_integration_bucket: type: string - + connection_port: + type: number + required: true jobs: StopLocalStack: @@ -50,6 +52,16 @@ jobs: role-to-assume: ${{ inputs.terraform_assume_role }} aws-region: ${{ inputs.region }} + + - name: Add Runner to Security Group + uses: mnavarrocarter/authorize-aws-security-group-ingress-action@v1.0.0 + with: + aws-region: ${{inputs.region}} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-security-group-id: ${{ secrets.AWS_TERRAFORM_SECURITY_GROUP_ID }} + protocol: 'tcp' + port: ${{ inputs.connection_port }} - name: Copy state run: aws s3 cp s3://${{inputs.s3_integration_bucket}}/integration-test/local-stack-terraform-state/${{inputs.github_sha}}/terraform.tfstate .