Skip to content

Commit 6e93784

Browse files
committed
#43 Terraform Drift Detectionの計画ステップでのエラーハンドリングを改善し、SNS通知用のトピックにタグを追加
1 parent 9f6372e commit 6e93784

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/tfdrift.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
id: plan
3636
run: |
3737
cd example/actions/terraform
38-
terraform plan -detailed-exitcode -input=false || echo "exit_code=$?" >> $GITHUB_OUTPUT
38+
terraform plan -detailed-exitcode -input=false || EXIT_CODE=$?
39+
echo "exit_code=${EXIT_CODE:-0}" >> $GITHUB_OUTPUT
3940
continue-on-error: true
4041

4142
- name: Send SNS Notification on Plan Failure

example/actions/terraform/sns.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
resource "aws_sns_topic" "drift_notification" {
22
name = "${local.name_prefix}-drift-notification"
3+
4+
tags = {
5+
Environment = "production"
6+
}
37
}
48

59
resource "aws_sns_topic_subscription" "drift_notification_email" {

0 commit comments

Comments
 (0)