Skip to content

Alicloud / Destroy #387

Alicloud / Destroy

Alicloud / Destroy #387

# Copyright (C) Nicolas Lamirault <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
---
name: Alicloud / Destroy
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
env:
description: 'Environment'
required: true
default: 'staging'
tf_version:
description: "Terraform version"
required: true
#datasource=github-tags depName=hashicorp/terraform
default: '1.2.2'
schedule:
- cron: "0 23 * * *"
permissions:
contents: read
jobs:
alicloud_ack:
runs-on: ubuntu-latest
steps:
- run: |
echo "Delete ACK / ${{ github.event.inputs.env }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ github.event.inputs.tf_version }}
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
run: terraform init -upgrade
working-directory: terraform/alicloud/ack/${{ github.event.inputs.env }}
- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: terraform/alicloud/ack/${{ github.event.inputs.env }}
alicloud_key_pair:
needs: alicloud_ack
runs-on: ubuntu-latest
steps:
- run: |
echo "Delete SSH KeyPair / ${{ github.event.inputs.env }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ github.event.inputs.tf_version }}
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
run: terraform init -upgrade
working-directory: terraform/alicloud/key-pair/${{ github.event.inputs.env }}
- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: terraform/alicloud/key-pair/${{ github.event.inputs.env }}
alicloud_eip_nat_gateway:
needs: alicloud_ack
runs-on: ubuntu-latest
steps:
- run: |
echo "Delete Elastic IP Address for NAT Gateway / ${{ github.event.inputs.env }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ github.event.inputs.tf_version }}
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
run: terraform init -upgrade
working-directory: terraform/alicloud/elastic-ips/nat-gateway/${{ github.event.inputs.env }}
- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: terraform/alicloud/elastic-ips/nat-gateway/${{ github.event.inputs.env }}
alicloud_nat_gateway:
needs: alicloud_eip_nat_gateway
runs-on: ubuntu-latest
steps:
- run: |
echo "Delete NAT Gateway / ${{ github.event.inputs.env }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ github.event.inputs.tf_version }}
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
run: terraform init -upgrade
working-directory: terraform/alicloud/nat-gateway/${{ github.event.inputs.env }}
- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: terraform/alicloud/nat-gateway/${{ github.event.inputs.env }}
alicloud_vpc:
needs:
- alicloud_nat_gateway
- alicloud_key_pair
runs-on: ubuntu-latest
steps:
- run: |
echo "Delete VPC / ${{ github.event.inputs.env }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ github.event.inputs.tf_version }}
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
run: terraform init -upgrade
working-directory: terraform/alicloud/vpc/${{ github.event.inputs.env }}
- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: terraform/alicloud/vpc/${{ github.event.inputs.env }}