2023-12-19 23:04:21 +00:00
|
|
|
# Small, self contained Terraform examples
|
|
|
|
# Scripts should be placed in:
|
|
|
|
# other_langs/terraform/service
|
|
|
|
|
|
|
|
name: Terraform Examples
|
|
|
|
on: [workflow_call]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-12-21 22:18:44 +00:00
|
|
|
service: ["acm", "route53"]
|
2023-12-19 23:04:21 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python 3.8
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: "3.8"
|
|
|
|
- name: Start MotoServer
|
|
|
|
run: |
|
|
|
|
pip install build
|
|
|
|
python -m build
|
|
|
|
docker run --rm -t --name motoserver -e TEST_SERVER_MODE=true -e AWS_SECRET_ACCESS_KEY=server_secret -e AWS_ACCESS_KEY_ID=server_key -v `pwd`:/moto -p 5000:5000 -v /var/run/docker.sock:/var/run/docker.sock python:3.10-slim /moto/scripts/ci_moto_server.sh &
|
|
|
|
python scripts/ci_wait_for_server.py
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
mkdir ~/.aws && touch ~/.aws/credentials && echo -e "[default]\naws_access_key_id = test\naws_secret_access_key = test" > ~/.aws/credentials
|
2023-12-21 22:18:44 +00:00
|
|
|
cd other_langs/terraform/${{ matrix.service }}
|
|
|
|
terraform init
|
|
|
|
terraform apply --auto-approve
|
2024-01-19 23:11:19 +00:00
|
|
|
echo "Verify nothing changes when ACM certificates are validated"
|
|
|
|
sleep 30
|
|
|
|
terraform plan -detailed-exitcode
|
|
|
|
sleep 30
|
|
|
|
terraform plan -detailed-exitcode
|
2023-12-21 22:18:44 +00:00
|
|
|
terraform apply -destroy --auto-approve
|