Turn on/off Bastion Server #5
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: Turn on/off Bastion Server | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| target-host-environment: | |
| type: choice | |
| description: The AWS environment to deploy (dev/test/prod) | |
| options: | |
| - dev | |
| - test | |
| - prod | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| TerraformPlan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repo | |
| uses: actions/checkout@v4 | |
| - name: Configure aws credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::035866691871:role/gha-incubator | |
| role-session-name: ghaincubatorsession | |
| aws-region: us-west-2 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| - name: Generate and apply plan | |
| run: | | |
| pushd ./terraform-incubator/home-unite-us/qa | |
| terraform init | |
| terraform plan -out tf.plan | |
| terraform apply tf.plan | |
| # - name: Store plan | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: homeuniteus-tf-show | |
| # path: ./terraform-incubator/home-unite-us/dev/homeuniteus.tfshow.tgz | |
| # - name: Store plan | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: homeuniteus-graph | |
| # path: ./terraform-incubator/home-unite-us/dev/graph.png | |
| # - name: Login to Amazon ECR | |
| # id: login-ecr | |
| # uses: aws-actions/amazon-ecr-login@v2 | |
| # with: | |
| # registries: "035866691871" | |
| # - name: Push an example image | |
| # run: | | |
| # docker pull nginx:alpine | |
| # docker tag nginx:alpine '035866691871.dkr.ecr.us-west-2.amazonaws.com/homeuniteus:nginx-20241002.1' | |
| # docker push '035866691871.dkr.ecr.us-west-2.amazonaws.com/homeuniteus:nginx-20241002.1' |