@@ -24,6 +24,7 @@ resource "aws_sfn_state_machine" "rotation_machine" {
2424 Resource = " arn:aws:states:::sns:publish.waitForTaskToken" ,
2525 TimeoutSeconds = 86400 ,
2626 Parameters = {
27+ Subject = " Action required: AWSPENDING secret created (Environment: ${ var . environment } )" ,
2728 TopicArn = aws_sns_topic.secret_rotation.arn,
2829 " Message.$" = local.add_jobs_message
2930 },
@@ -44,6 +45,7 @@ resource "aws_sfn_state_machine" "rotation_machine" {
4445 Resource = " arn:aws:states:::sns:publish.waitForTaskToken" ,
4546 TimeoutSeconds = 86400 ,
4647 Parameters = {
48+ Subject = " Action required: Secret AWSPENDING promoted to AWSCURRENT (Environment: ${ var . environment } )" ,
4749 TopicArn = aws_sns_topic.secret_rotation.arn,
4850 " Message.$" = local.delete_jobs_message
4951 },
@@ -59,7 +61,7 @@ resource "aws_sfn_state_machine" "rotation_machine" {
5961 Resource = " arn:aws:states:::sns:publish" ,
6062 Parameters = {
6163 TopicArn = aws_sns_topic.secret_rotation.arn,
62- Subject = " WARNING : Secret Rotation Timed Out " ,
64+ Subject = " Warning : Secret rotation timed out (Environment: ${ var . environment } ) " ,
6365 " Message.$" = local.timeout_message
6466 },
6567 Next = " Fail_Timeout"
@@ -75,7 +77,7 @@ resource "aws_sfn_state_machine" "rotation_machine" {
7577 Resource = " arn:aws:states:::sns:publish" ,
7678 Parameters = {
7779 TopicArn = aws_sns_topic.secret_rotation.arn,
78- Subject = " CRITICAL : Secret Rotation Failed" ,
80+ Subject = " Critical : Secret Rotation Failed (Environment: ${ var . environment } ) " ,
7981 " Message.$" = local.failure_message
8082 },
8183 Next = " Fail_Generic"
@@ -91,7 +93,7 @@ locals {
9193 add_jobs_message = << EOT
9294States.Format('
9395======================================================
94- ACTION REQUIRED: PENDING SECRET CREATED
96+ Action required: AWSPENDING secret created (Environment: ${ var . environment } )
9597======================================================
9698
9799A manual action is required to proceed.
@@ -100,20 +102,19 @@ CONTEXT:
100102Secret Name: ${ module . secrets_manager . aws_hashing_secret_name }
101103
102104INSTRUCTIONS:
103- 1. Run the "Add New Hashes" job.
105+ 1. Run the "Add New Hashes (elid_add_new_salt) " job.
1041062. Ensure the new hashes are working as expected.
1051073. Run the command below to approve and resume the workflow:
106108
107- aws stepfunctions send-task-success --task-token { }
109+ aws stepfunctions send-task-success --task-token $$.Task.Token --task-output {{} }
108110
109111======================================================
110- ', $$.Task.Token)
111112EOT
112113
113114 delete_jobs_message = << EOT
114115States.Format('
115116======================================================
116- ACTION REQUIRED: SECRET AWSPENDING PROMOTED TO AWSCURRENT
117+ Action required: Secret AWSPENDING promoted to AWSCURRENT (Environment: ${ var . environment } )
117118======================================================
118119
119120A manual action is required to proceed.
@@ -122,24 +123,26 @@ CONTEXT:
122123Secret Name: ${ module . secrets_manager . aws_hashing_secret_name }
123124
124125INSTRUCTIONS:
125- 1. Run the "Delete Old Hashes" job.
126+ 1. Run the "Delete Old Hashes (elid_delete_old_salt) " job.
1261272. Ensure the old hashes have been removed successfully.
1271283. Run the command below to approve and resume the workflow:
128129
129- aws stepfunctions send-task-success --task-token { }
130+ aws stepfunctions send-task-success --task-token $$.Task.Token --task-output {{} }
130131
131132======================================================
132- ', $$.Task.Token)
133133EOT
134134
135135 failure_message = << EOT
136136States.Format('
137137======================================================
138- CRITICAL: ROTATION FAILED
138+ Critical: Rotation failed (Environment: ${ var . environment } )
139139======================================================
140140
141141The workflow encountered an error and could not complete.
142142
143+ CONTEXT:
144+ Secret Name: ${ module . secrets_manager . aws_hashing_secret_name }
145+
143146ERROR DETAILS:
144147{}
145148
162165 timeout_message = << EOT
163166States.Format('
164167======================================================
165- WARNING: ROTATION TIMED OUT
168+ Warning: Rotation timed out (Environment: ${ var . environment } )
166169======================================================
167170
168171The manual verification step was not completed within the 24-hour limit.
0 commit comments