Skip to content

Purge AWS test resources #1

Purge AWS test resources

Purge AWS test resources #1

# ------------------------------------------------------------
# Copyright 2023 The Radius Authors.
#
# 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.
# ------------------------------------------------------------
name: Purge AWS test resources
on:
workflow_dispatch:
schedule:
# Run at 12:00AM PST every day.
- cron: "0 7 * * 0-6"
env:
AWS_REGION: us-west-2
AWS_RESOURCE_TYPES: 'AWS::RDS::DBSubnetGroup,AWS::RDS::DBInstance,AWS::S3::Bucket,AWS::Logs::MetricFilter,AWS::Logs::LogGroup'
jobs:
purge_aws_resources:
name: Delete old AWS resources created by tests
runs-on: ubuntu-latest
if: github.repository == 'radius-project/radius'
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.FUNCTEST_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.FUNCTEST_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Delete old AWS resources
run: |
./.github/scripts/delete_aws_resources.sh ${{ env.AWS_RESOURCE_TYPES }}