fix(terraform): mark SDM_ADMIN_TOKEN as sensitive in variables.tf #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Terratest | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| terratest: | |
| name: Run Terratest | |
| runs-on: ubuntu-latest | |
| environment: dev | |
| env: | |
| TF_VAR_aws_region: ${{ secrets.TF_VAR_AWS_REGION }} | |
| TF_VAR_subnet_id: ${{ secrets.TF_VAR_SUBNET_ID }} | |
| TF_VAR_vpc_id: ${{ secrets.TF_VAR_VPC_ID }} | |
| TF_VAR_tags: ${{ vars.TF_VAR_TAGS }} | |
| TF_VAR_SDM_API_ACCESS_KEY: ${{ secrets.SDM_API_ACCESS_KEY }} | |
| TF_VAR_SDM_API_SECRET_KEY: ${{ secrets.SDM_API_SECRET_KEY }} | |
| TF_VAR_SDM_ADMIN_TOKEN: ${{ secrets.SDM_ADMIN_TOKEN }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install SDM CLI | |
| run: | | |
| curl -J -O -L https://app.strongdm.com/releases/cli/linux | |
| unzip sdmcli* && rm sdmcli*.zip | |
| sudo mv sdm /usr/local/bin/ | |
| sdm --version | |
| - name: Authenticate SDM CLI | |
| run: | | |
| sdm login --admin-token='${{ secrets.SDM_ADMIN_TOKEN }}' | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.21' | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: ~1.12 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.TF_VAR_AWS_REGION }} | |
| - name: Run Terraform unit tests | |
| run: | | |
| terraform init | |
| make unit-test | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Run Terratest integration tests | |
| run: make integration-test |