A body should be created in the SSM automation webhook.
Actual Behavior
An error is thrown. However, the webhook is created but with an empty body.
If a different string replaces "body", for example "payload", no error is produced but again a webhook with no body is created.
Relevant Error/Panic Output Snippet
module.apps.module.asg-terminate-hook.aws_ssm_parameter.test-webhook: Modifying... [id=/d9d01087-4a3f-49e0-b0b4-d568d7826553/ssm/integrations/webhook/OpsgenieWebhook]
╷
│ Error: error updating SSM Parameter (/d9d01087-4a3f-49e0-b0b4-xxxxxxxxxx/ssm/integrations/webhook/OpsgenieWebhook): ValidationException: The content of the integration structure for integration type: webhook is invalid: Invalid integration configuration. Required values are either missing, or unsupported fields have been specified for this configuration.
│ status code: 400, request id: 009edbd2-4a03-4266-9571-xxxxxxxxxx
│
│ with module.apps.module.asg-terminate-hook.aws_ssm_parameter.test-webhook,
│ on ../../modules/asg-terminate-hook/terminate-lifecycle.tf line 112, in resource "aws_ssm_parameter" "test-webhook":
│ 112: resource "aws_ssm_parameter" "test-webhook" {
│
Terraform Configuration Files
resource "aws_ssm_parameter" "test-webhook" {
name = "/d9d01087-4a3f-49e0-b0b4-d568d7826553/ssm/integrations/webhook/test-webhook"
type = "SecureString"
data_type = "aws:ssm:integration" # 15/11/22 This data type now supported by Terraform
value = <<VAL
{
"description": "Interact with Opsgenie Datahub_sysOps API",
"url": "https://api.eu.opsgenie.com/v2/alerts",
"body": "{
"message" : "SSM_ASG_scaledown_test"
}",
"headers": {
"Content-Type": "application/json",
"Authorization":"${local.opsgenie_auth}",
"Method":"POST"
}
}
VAL
}
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.3.5
AWS Provider Version
4.40.0
Affected Resource(s)
aws_ssm_parameter
Expected Behavior
A body should be created in the SSM automation webhook.
Actual Behavior
An error is thrown. However, the webhook is created but with an empty body.
If a different string replaces "body", for example "payload", no error is produced but again a webhook with no body is created.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
resource "aws_ssm_parameter" "test-webhook" { name = "/d9d01087-4a3f-49e0-b0b4-d568d7826553/ssm/integrations/webhook/test-webhook" type = "SecureString" data_type = "aws:ssm:integration" # 15/11/22 This data type now supported by Terraform value = <<VAL { "description": "Interact with Opsgenie Datahub_sysOps API", "url": "https://api.eu.opsgenie.com/v2/alerts", "body": "{ "message" : "SSM_ASG_scaledown_test" }", "headers": { "Content-Type": "application/json", "Authorization":"${local.opsgenie_auth}", "Method":"POST" } } VAL }
Steps to Reproduce
Run terraform against the above code snippet
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No